Post by labeshops » Fri Oct 05, 2012 11:23 pm

Just discovered that when order history is viewed from the front end of any of my stores/any template, only the top like of the order history is showing - when they first placed their order. So customers think their order is still "pending" even if its shipped and not seeing the tracking information. Happens if a registered customer is logged in and looks at the order or thru the order tracking extension I have when using their email and order number to view the order history page.

Cannot figure out why. Any ideas what to check?

I found the section in controller/order.php and it looks fine to me...

Code: Select all

			$this->data['histories'] = array();

			$results = $this->model_account_order->getOrderHistories($this->request->get['order_id']);

      		foreach ($results as $result) {
        		$this->data['histories'][] = array(
          			'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
          			'status'     => $result['status'],
          			'comment'    => nl2br($result['comment'])
        		);
      		}
So cannot figure out why it would only pull one???
Last edited by labeshops on Wed Oct 10, 2012 12:04 am, edited 2 times in total.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Sat Oct 06, 2012 11:37 pm

Still cannot figure this out. Anyone know how I can change the sort order so the most recent comment added will show first? This would be a work around for me so at least my customers can see the last action if not the complete history.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Tue Oct 09, 2012 11:28 pm

Finally found it.

By default, history only shows to customer if you have "notify" to yes, which I rarely do as I send customers more detailed emails.

So I changed in catalog/model/account/order.php

Code: Select all

	public function getOrderHistories($order_id) {

		$query = $this->db->query("SELECT date_added, os.name AS status, oh.comment, oh.notify FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND oh.notify = '1' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");

	

		return $query->rows;

	}	
to

Code: Select all

	public function getOrderHistories($order_id) {

		$query = $this->db->query("SELECT date_added, os.name AS status, oh.comment FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");

	

		return $query->rows;

	}	
and it works :)

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by HoodLaces » Tue Nov 27, 2012 12:04 am

Thank you for this!

User avatar
Newbie

Posts

Joined
Fri Jul 13, 2012 1:45 am

Post by labeshops » Tue Nov 27, 2012 12:25 am

HoodLaces wrote:Thank you for this!
any time :)

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by digitaldept » Wed Feb 05, 2014 10:09 am

So I have used this for a few months now and it works great. Thank you!

My question is this: How would I modify it to only update on the order history page when I check the checkbox to notify customer? In other words, it would not update on the history page unless I check the box and would never email the client.

Many thanks in advance!

New member

Posts

Joined
Fri Aug 31, 2012 12:12 pm
Location - Ohio

Post by labeshops » Wed Feb 05, 2014 10:36 pm

Why would you add a comment that doesn't show on the history page? Seems like a waste of typing a comment, or am I missing something?

Do you mean a comment section just for admins that the customer can never view? If so, I've thought of that and have it on my "to do" list to create one of these days. Just haven't had time to do it. Basically you could clone the history code and remove all the sections to display it on the front end of the stores and email function so customers would never be able to view it.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by digitaldept » Wed Feb 05, 2014 10:59 pm

I have a very specific use for it and it is exactly as you mentioned. So I can make notes on the order without the customer seeing them. Then if I check the box, it would update the order history but NOT email the customer.

It kind of looks like in the code in the above comments there are two notifiers? Maybe one for history and one for email? I know very little about this which is why I turned to the forums and this post in particular which helped tremendously! Now I just need one more small have to make it perfect for my needs. :)

Thanks!

New member

Posts

Joined
Fri Aug 31, 2012 12:12 pm
Location - Ohio

Post by Kakur007 » Tue Dec 02, 2014 8:16 pm

Im having problem wiht comments on online store. The comments shows up for customers when site is in English when its in Estonian, comments are not showing up and order status is still pending. Does this depend on the admin side language as its in English?

Any help where to look would be wonderful. OC version 1.5.6.4 with pav theme but custom modified. Working in English but no comments in Estonian.

GoGoNano is passionate about creating eco-friendly bio cleaners and waterproofing sprays that people feel safe to use within their home and around their family.
https://www.gogonano.com


New member

Posts

Joined
Sun Nov 17, 2013 8:44 pm


Post by marvinac1 » Fri Dec 08, 2017 6:01 am

I updated the Order.php with that code and it works but now I get this below.

Code: Select all

Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 377Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 378Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 379Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 385Notice: Undefined index: trackingpostcode in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 386Notice: Undefined index: shipmentinfo in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 387Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: trackingpostcode in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: notify in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 391

Newbie

Posts

Joined
Mon Jul 31, 2017 11:26 am

Post by straightlight » Fri Dec 08, 2017 11:07 pm

marvinac1 wrote:
Fri Dec 08, 2017 6:01 am
I updated the Order.php with that code and it works but now I get this below.

Code: Select all

Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 377Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 378Notice: Undefined index: carrier_id in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 379Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 385Notice: Undefined index: trackingpostcode in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 386Notice: Undefined index: shipmentinfo in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 387Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: trackingpostcode in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: trackingnumber in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 389Notice: Undefined index: notify in /home/marvinac123/public_html/compsalesusa.com/system/modification/catalog/controller/account/order.php on line 391
These error messages originates from the Openbay extension. There has been lots of changes over the years with this extension. I would suggest to upgrade to a higher version of OC.

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 erwtje » Sun Mar 31, 2019 6:23 am

labeshops wrote:
Tue Oct 09, 2012 11:28 pm
[...] changed to

Code: Select all

	public function getOrderHistories($order_id) {
		$query = $this->db->query("SELECT date_added, os.name AS status, oh.comment FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");
	}	
For me, this didn't work. I got the error
Notice: Undefined index: notify in /home/xxxxxx/domains/xxxxxx/public_html/catalog/controller/account/order.php on line 369

What did work for me, was the following change:

Code: Select all

$query = $this->db->query("SELECT date_added, os.name AS status, oh.comment, 1 as 'notify' FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");
But thanks for pointing me in the right direction!

Newbie

Posts

Joined
Sun Mar 31, 2019 6:08 am

Post by burakislam » Sat May 02, 2020 2:23 am

thanx friend oc 2.3.0.2 solved

Code: Select all

 $query = $this->db->query("SELECT date_added, os.name AS status, oh.comment, 1 as 'notify' FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");

Newbie

Posts

Joined
Wed Apr 29, 2020 9:29 am
Who is online

Users browsing this forum: stefansmith129 and 200 guests