Page 1 of 1

Custom Printing Shipping Label

Posted: Thu Jul 12, 2018 5:59 am
by Wiggiez
Hello,

I would like to make custom Printing Shipping Label , may i know how to get specific function or keyword :

{{ order.shipping_postcode }} ,

i have tried this however it doesn't show me anything.

Thanks

Re: Custom Printing Shipping Label

Posted: Thu Jul 12, 2018 6:28 am
by straightlight
What does that explain? As a new forum user, please read the forum rules: viewtopic.php?f=176&p=728050#p708937

Re: Custom Printing Shipping Label

Posted: Thu Jul 12, 2018 3:12 pm
by dswtpl
This is not enough information to understand your problem/question. Please provide us more in details question in place of short language.

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 7:08 am
by Wiggiez
Hello ,

I want to make custom shipping consignment note using this file :
admin/view/template/sale/order_shipping.twig
i would like to get postcode from order to display on my consignment note , therefore i need to know what keyword do i have to put to display postcode?

Thank you

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 5:42 pm
by kestas
It is because your requested data not defined in controller file. You need to define it.
find in admin/controller/sale/order.php
line arround 1835 find:

Code: Select all

'shipping_method'  => $order_info['shipping_method'],
add after:

Code: Select all

'postcode'  => $order_info['shipping_postcode'],
after you make this changes do not forget refresh modifications and clear cache in your admin dashboard... blue gear icon upper right corner.

Cheers

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 7:07 pm
by Wiggiez
Hi Kestas ,

i have tried exactly as u guide and I'm using {{ order.shipping_postcode }} but postcode still doesn't show up.

Regards

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 7:23 pm
by kestas
Wiggiez wrote:
Fri Jul 13, 2018 7:07 pm
Hi Kestas ,

i have tried exactly as u guide and I'm using {{ order.shipping_postcode }} but postcode still doesn't show up.

Regards
In my example postcode defined like postcode. So you should use {{ order.postcode }}

Cheers

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 7:57 pm
by ostechnologies
You need to perform some changes

Step 1 : Navigate to file admin/controller/sale/order.php and search for:
$this->response->setOutput($this->load->view('sale/order_shipping', $data));
Add before:
$data['postcode'] = $order_info['shipping_postcode'];

Step 2 : Navigate to file admin/view/template/sale/order_shipping.twig do some changes:
Search : <td><b>{{ column_model }}</b></td>
Add After : <td><Consignment Note</b></td>
Search : <td>{{ product.model }}</td>
Add After : <td>{{ postcode }}</td>

Now you can see a column after “Model” with name “Consignment Note” and postal code as its value.

NOTE: Do not forget to clear your dashboard to see the changes.

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 8:10 pm
by kestas
ostechnologies wrote:
Fri Jul 13, 2018 7:57 pm
You need to perform some changes

Step 1 : Navigate to file admin/controller/sale/order.php and search for:
$this->response->setOutput($this->load->view('sale/order_shipping', $data));
Add before:
$data['postcode'] = $order_info['shipping_postcode'];

Step 2 : Navigate to file admin/view/template/sale/order_shipping.twig do some changes:
Search : <td><b>{{ column_model }}</b></td>
Add After : <td><Consignment Note</b></td>
Search : <td>{{ product.model }}</td>
Add After : <td>{{ postcode }}</td>

Now you can see a column after “Model” with name “Consignment Note” and postal code as its value.

NOTE: Do not forget to clear your dashboard to see the changes.
it is not necessary if you want it retrieve like:

Code: Select all

{% for order in orders %} 
 {{ order.postcode }} 
 {% endfor %}
Cheers

Re: Custom Printing Shipping Label

Posted: Fri Jul 13, 2018 8:58 pm
by Wiggiez
Thank you so much for your help

i now able to show postcode using this tag : {{ order.postcode }}

Thank you to All of you