Post by Wiggiez » Thu Jul 12, 2018 5:59 am

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

Newbie

Posts

Joined
Sat Apr 23, 2016 6:33 pm

Post by straightlight » Thu Jul 12, 2018 6:28 am

What does that explain? As a new forum user, please read the forum rules: viewtopic.php?f=176&p=728050#p708937

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dswtpl » Thu Jul 12, 2018 3:12 pm

This is not enough information to understand your problem/question. Please provide us more in details question in place of short language.

New member

Posts

Joined
Thu Feb 12, 2015 10:17 pm

Post by Wiggiez » Fri Jul 13, 2018 7:08 am

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

Newbie

Posts

Joined
Sat Apr 23, 2016 6:33 pm

Post by kestas » Fri Jul 13, 2018 5:42 pm

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

Custom OpenCart modules and solutions. Just PM me... Extensions you can find here and here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by Wiggiez » 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

Newbie

Posts

Joined
Sat Apr 23, 2016 6:33 pm

Post by kestas » Fri Jul 13, 2018 7:23 pm

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

Custom OpenCart modules and solutions. Just PM me... Extensions you can find here and here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by ostechnologies » 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.

Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
Mon Apr 06, 2015 1:30 pm

Post by kestas » Fri Jul 13, 2018 8:10 pm

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

Custom OpenCart modules and solutions. Just PM me... Extensions you can find here and here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by Wiggiez » Fri Jul 13, 2018 8:58 pm

Thank you so much for your help

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

Thank you to All of you

Newbie

Posts

Joined
Sat Apr 23, 2016 6:33 pm
Who is online

Users browsing this forum: No registered users and 10 guests