Post by nightwing » Mon Oct 12, 2020 3:29 am

Hi Team - I would like to find a way to display only the current order status under Date Added in the Order details table when the customer visits their account to view the order in

Code: Select all

catalog/view/theme/*/template/account/order_info.twig
Image:
https://pasteboard.co/Jvc0IMU.png

This should only show Statues and not comments for example: Complete, Pending, Shipped, Preparing for Shipment.
I have hidden the history section below the order summary, but would like this so customers can view at a glance.

I am using version 3.0.3.2 Default theme.

Thanks in advance for your help!
Last edited by nightwing on Mon Oct 12, 2020 8:22 am, edited 1 time in total.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by straightlight » Mon Oct 12, 2020 6:31 am

This could either be done with OCMod or as an event.

OCMod e.g: In catalog/controller/account/order.php file,

find:

Code: Select all

$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
add below:

Code: Select all

$this->load->model('localisation/order_status');

$order_status = $this->model_localisation_order_status->getOrderStatus($order_info['order_status_id']);

$data['order_status'] = html_entity_decode($order_status['name'], ENT_QUOTES, 'UTF-8');
In your catalog/view/theme/default/template/account/order.twig file,

find:

Code: Select all

<b>{{ text_date_added }}</b> {{ date_added }}</td>
replace with:

Code: Select all

<b>{{ text_date_added }}</b> {{ date_added }}
<br>
<b>{{ text_order_status }}</b> {{ order_status }}</td>
Then, in your catalog/language/<your_language>/account/order.php file,

add at the bottom of the file:

Code: Select all

$_['text_order_status'] = 'Order Status:';
Then, clear your OC cache: viewtopic.php?f=134&t=215776#p718325 .

This should resolved the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by nightwing » Mon Oct 12, 2020 8:22 am

Awesome! Thank you straightlight, this worked!
straightlight wrote:
Mon Oct 12, 2020 6:31 am
This could either be done with OCMod or as an event.

OCMod e.g: In catalog/controller/account/order.php file,

find:

Code: Select all

$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
add below:

Code: Select all

$this->load->model('localisation/order_status');

$order_status = $this->model_localisation_order_status->getOrderStatus($order_info['order_status_id']);

$data['order_status'] = html_entity_decode($order_status['name'], ENT_QUOTES, 'UTF-8');
In your catalog/view/theme/default/template/account/order.twig file,

find:

Code: Select all

<b>{{ text_date_added }}</b> {{ date_added }}</td>
replace with:

Code: Select all

<b>{{ text_date_added }}</b> {{ date_added }}
<br>
<b>{{ text_order_status }}</b> {{ order_status }}</td>
Then, in your catalog/language/<your_language>/account/order.php file,

add at the bottom of the file:

Code: Select all

$_['text_order_status'] = 'Order Status:';
Then, clear your OC cache: viewtopic.php?f=134&t=215776#p718325 .

This should resolved the issue.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm

Who is online

Users browsing this forum: Bing [Bot], jagall, moreduff and 261 guests