Post by sascha2012 » Tue Nov 19, 2024 11:04 pm

How can I add order status to the invoice layout?

Newbie

Posts

Joined
Tue Jul 08, 2014 11:03 am

Post by softmonke » Tue Nov 19, 2024 11:59 pm

sascha2012 wrote:
Tue Nov 19, 2024 11:04 pm
How can I add order status to the invoice layout?
Go to "admin/controller/sale/order.php" and look for the "invoice" function. In that function, you should see the following line of code:

Code: Select all

$data['orders'][] = array(
Just add the order status into the array, like:

Code: Select all

'order_status' => $order_info['order_status']
and just display the order status in the template file (admin/view/template/sale/order_invoice.twig), like:

Code: Select all

{{order.order_status}}

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by sascha2012 » Sun Nov 24, 2024 2:55 pm

Unfortunately that doesn't work

Newbie

Posts

Joined
Tue Jul 08, 2014 11:03 am

Post by OSWorX » Sun Nov 24, 2024 10:50 pm

sascha2012 wrote:
Sun Nov 24, 2024 2:55 pm
Unfortunately that doesn't work
What is not working?
Did you added the code as advised?

If all is done correct, the status will be displayed (IF there is s status already and NOT 0)

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Mon Nov 25, 2024 8:21 pm

sascha2012 wrote:
Sun Nov 24, 2024 2:55 pm
Unfortunately that doesn't work
Please read this: https://www.antropy.co.uk/blog/how-to-r ... right-way/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by sascha2012 » Wed Nov 27, 2024 1:49 pm

OSWorX wrote:
Sun Nov 24, 2024 10:50 pm
sascha2012 wrote:
Sun Nov 24, 2024 2:55 pm
Unfortunately that doesn't work
What is not working?
Did you added the code as advised?

If all is done correct, the status will be displayed (IF there is s status already and NOT 0)
Of course I added code and order status is Complete.
And I tried that, {% if order.order_status %}{{ order.order_status }}{% endif %}
but that doesn't work either. Order status is not displayed on the invoice print

Newbie

Posts

Joined
Tue Jul 08, 2014 11:03 am

Post by sascha2012 » Wed Nov 27, 2024 2:06 pm

Ok my mistake. Now it works. OSWorX thanks

Newbie

Posts

Joined
Tue Jul 08, 2014 11:03 am
Who is online

Users browsing this forum: maffe, tdaubs and 51 guests