Stroud Vaping Posted December 18, 2013 Share Posted December 18, 2013 (edited) Hi, Apologies in advance if this has already been asked, but I have searched and can't find what I'm looking for. What I want to do is add a section to my delivery slips displaying the shipping carrier selected by the customer at checkout, so that when shipping I can easily see what shipping method has been paid for. I'd like to add it below the payment method, to display like below: Order number: ###### Order Date: ###### Payment Method: ###### Shipping Method: ###### Many thanks in advance for your help! Luke Edited December 30, 2013 by Stroud Vaping (see edit history) Link to comment Share on other sites More sharing options...
Stroud Vaping Posted December 29, 2013 Author Share Posted December 29, 2013 Anyone got any ideas? Link to comment Share on other sites More sharing options...
PascalVG Posted December 29, 2013 Share Posted December 29, 2013 Hi Luke, what PS version do you use? It seems that in 1.5.6.0 (probably some earlier 1.5.x. versions as well) this is standard included already: in file pdf/delivery-slip.tpl: They added this red code: <b>{l s='Payment Method:' pdf='true'}</b><br /> <table style="width: 100%;"> {foreach from=$order_invoice->getOrderPaymentCollection() item=payment} <tr> <td style="width: 50%">{$payment->payment_method}</td> <td style="width: 50%">{displayPrice price=$payment->amount currency=$order->id_currency}</td> </tr> {foreachelse} <tr> <td>{l s='No payment'}</td> </tr> {/foreach} </table> <br /> {if isset($carrier)} <b>{l s='Carrier:' pdf='true'}</b><br /> {$carrier->name}<br /> <br /> {/if} and in file: classes/pdf/HTMLTemplateDeliverySlip.php they modified public function getContent(): public function getContent() { $delivery_address = new Address((int)$this->order->id_address_delivery); $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' '); $formatted_invoice_address = ''; if ($this->order->id_address_delivery != $this->order->id_address_invoice) { $invoice_address = new Address((int)$this->order->id_address_invoice); $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' '); } $carrier = new Carrier($this->order->id_carrier); $carrier->name = ($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name); $this->smarty->assign(array( 'order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier )); return $this->smarty->fetch($this->getTemplate('delivery-slip')); } N.B. Backup your files before you edit them, just in case...) Hope this helps, pascal. 2 Link to comment Share on other sites More sharing options...
Stroud Vaping Posted December 30, 2013 Author Share Posted December 30, 2013 You're a star! Worked a treat exactly as posted (thank God for that, as I didn't backup as suggested!) Thanks so much! (BTW, I'm using PS 1.5.4.1) Link to comment Share on other sites More sharing options...
CARIBEE ITALIA Posted May 23, 2015 Share Posted May 23, 2015 Hi, where do I edit delivery slip (or other documents) with cloud version of presta shop? thank you in advance Link to comment Share on other sites More sharing options...
PascalVG Posted May 23, 2015 Share Posted May 23, 2015 Hi caribee, To edit files, you first need to create an ftp connection: http://doc.prestashop.com/display/CLOUD/Managing+FTP+users hope this helps, pascal. Link to comment Share on other sites More sharing options...
mouse1 Posted June 28, 2016 Share Posted June 28, 2016 Hi everyone, is there maybe a way to add the current order status? {$order->current_state} only displays id number of the current state (e.g. 7), but not the name (e.g. Order canceled). Thank you very much for any help with this. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now