Post by RiguPhoto » Fri Nov 03, 2023 1:18 am

I've got an odd issue that I can't work out, and I've struggled to find a similar thread with this issue.

I switched from 1.5.6.1 to a fresh install of 3.0.3.8 (Condor's version) this weekend, and I copied over the original database to a new database then made what I believe are all the necessary changes to make it work with Opencart 3. I'm running PHP8.0 and... Journal 3 (I know, I know). I've got a couple of extensions installed that I don't believe go anywhere near customer data (PHPMailer and Optional Order Notifications).

When I go to the customer list page it defaults to organising by customer name (ascending), which is fine, but I click to sort the list by date added it just lists by customer name (descending). Same happens when trying to sort by any of the other column titles.

There's nothing in the error log about it, and the console says it's going to the date_added sorting:
"Navigated to https://XXXXX/admin/index.php?route=cus ... &order=ASC"

I assume that the page uses admin/controller/customer/customer.php to control it's behaviour and that file looks to me like it's normal on my installation. Just to be sure I re-uploaded the original customer.php from and the sorting (or lack of it) behaviour persists.

I've looked in the database and customers from before and after the change are the same. Same group number, language ID.

All the customers are there, I can find the new ones by fitering by date added, it's just the sorting function that won't work. I've also tested this across browsers, and it happens with the default theme as well as Journal, so I don't think this can be pinned on Journal as the culprit.

Any thoughts? It's not the biggest issue, but since it's got me baffled.
Last edited by RiguPhoto on Fri Nov 24, 2023 10:05 am, edited 2 times in total.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by IP_CAM » Fri Nov 03, 2023 2:26 am

I'm running PHP8.0 and... Journal 3 (I know, I know) :D .
Well, then better post such matters in the commercial Section, if you expect someone to assist ;) ...

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by softmonke » Fri Nov 03, 2023 2:54 am

That's strange. If you inspect element on each of the URLs of the headers of the customer list table (Customer Name, E-Mail, Customer Group, Status, IP, Date Added) do they all show the same URLs?

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


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by RiguPhoto » Fri Nov 03, 2023 4:57 am

softmonke wrote:
Fri Nov 03, 2023 2:54 am
That's strange. If you inspect element on each of the URLs of the headers of the customer list table (Customer Name, E-Mail, Customer Group, Status, IP, Date Added) do they all show the same URLs?
They all point to the appropriate links (c.date_added, customer_group, etc.), and when you click on them the URL looks as it should do.

Another strange thing is that I tried to follow the advice in this post/thread to see if it would have any effect: viewtopic.php?t=213601#p763649

Now when I open the customer list the arrow in the table is on date added which suggests that it's opening to the date added URL, but it's still showing data by name ascending.

Like I say, I'm baffled, but it's not that important so unless someone immediately thinks of something obvious I've missed I don't think it deserves much attention.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by paulfeakins » Fri Nov 03, 2023 8:14 pm

RiguPhoto wrote:
Fri Nov 03, 2023 1:18 am
3.0.3.8 ... I'm running PHP8.0
These are not compatible.

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


User avatar
Guru Member
Online

Posts

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

Post by RiguPhoto » Fri Nov 03, 2023 9:19 pm

paulfeakins wrote:
Fri Nov 03, 2023 8:14 pm
RiguPhoto wrote:
Fri Nov 03, 2023 1:18 am
3.0.3.8 ... I'm running PHP8.0
These are not compatible.
Sorry, I forgot to mention that it's the version of OC3.0.3.8 by Condor2 on Github , which I believe is compatible with PHP8 (and the 3.0.3.8-based Maintenance branch should be too?), I'll update the original message. It was late when I was doing the switchover from 1.5.6.1 to this version but I think it specifically said in an error message that it needs PHP 8 when I swapped the folders and that domain was still set to PHP5.6.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by paulfeakins » Mon Nov 06, 2023 10:40 pm

RiguPhoto wrote:
Fri Nov 03, 2023 9:19 pm
Sorry, I forgot to mention that it's the version of OC3.0.3.8 by Condor2 on Github , which I believe is compatible with PHP8 (and the 3.0.3.8-based Maintenance branch should be too?),
There is no such thing as a version of 3.0.3.8, that is like saying a version of a version.

3.0.3.8 is a snapshot of the code at a fixed point in time and is unchanging.

There is a strangely named 3.0.x.x_Maintenance rolling release and an official 3.0.3.9 version. There may also be other versions on the internet that claim to support PHP 8.

As you're using an unknown version and Journal, you will probably need to pay a developer to investigate.

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


User avatar
Guru Member
Online

Posts

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

Post by JNeuhoff » Mon Nov 06, 2023 11:42 pm

It works fine for OpenCart 3.0.3.9 or the 3.0.x.x branch (the latter is based on 3.0.3.9 with some further small bugfixes).

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by RiguPhoto » Mon Nov 06, 2023 11:54 pm

paulfeakins wrote:
Mon Nov 06, 2023 10:40 pm
RiguPhoto wrote:
Fri Nov 03, 2023 9:19 pm
Sorry, I forgot to mention that it's the version of OC3.0.3.8 by Condor2 on Github , which I believe is compatible with PHP8 (and the 3.0.3.8-based Maintenance branch should be too?),
There is no such thing as a version of 3.0.3.8, that is like saying a version of a version.

3.0.3.8 is a snapshot of the code at a fixed point in time and is unchanging.
I see. I'm not a professional coder and I am just learning whilst trying to run my business, some of my phrasing is not correct.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by RiguPhoto » Mon Nov 06, 2023 11:58 pm

JNeuhoff wrote:
Mon Nov 06, 2023 11:42 pm
It works fine for OpenCart 3.0.3.9 or the 3.0.x.x branch (the latter is based on 3.0.3.9 with some further small bugfixes).
Thank you. Now that I've got myself from 1.5.6.1 up to OC3 I think I've got the experience to move onto 3.0.3.9 or the maintenance branch soon. I'm still confused about this weird issue but it's not really worth mine or anyone elses time to give it much thought.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by paulfeakins » Wed Nov 08, 2023 12:22 am

RiguPhoto wrote:
Mon Nov 06, 2023 11:54 pm
I see. I'm not a professional coder and I am just learning whilst trying to run my business, some of my phrasing is not correct.
No worries, that's why I'm pointing out the specifics.

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


User avatar
Guru Member
Online

Posts

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

Post by RiguPhoto » Fri Nov 24, 2023 10:04 am

I appear to have found the issue and solved it.

I stumbled upon this post by letxobnav in a thread about changing the default sorting order of the product list. That put me on track to look at the files and code that control the sort orders. That thread concerned OC 3.0.3.6 and I'm on something based upon 3.0.3.8 (possibly the maintenance branch from September, but in all honesty I'm not sure), but I suspected these files were unlikely to have changed that much between those versions.

The code should have looked like this:

Code: Select all

		$sort_data = array(
			'pd.name',
			'p.model',
			'p.price',
			'p.quantity',
			'p.status',
			'p.sort_order'
		);
But mine was showing like this:

Code: Select all

		$sort_data = array(
			'p.`product_id`',
			'pd.`name`',
			'p.`model`',
			'p.`price`',
			'p.`quantity`',
			'p.`status`',
			'p.`sort_order`'
		);
I then compared the code from the forum post to the files in the 3.0.x.x maintenance branch and it confirmed that my code was different with the added apostrophes for some reason. I uploaded the file from the 3.0.x.x maintenance branch to replace the one on the server, and bam, I had sorting working, and just needed to add in the product_id to the array to allow sorting by that too.

The thing that still confuses me is what could have caused the addition of these extra characters? I've started to go through other files and see it occurring elsewhere, so whilst the site is largely running fine, I do want to get to the bottom of it, and suspect that a reinstall is likely the long-term solution. I'll mark this as solved as it seems like I've answered this question (whilst giving myself a lot more to investigate!).

EDIT: I've been doing some learning about backticks, and I still can't work out why they would have been in that file, or how they would have got there.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm

Post by ADD Creative » Fri Nov 24, 2023 6:22 pm

The extra backticks seem to be a bug added to the condor2 version. I would stick to the official OpenCart versions.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Fri Nov 24, 2023 7:42 pm

Yeah, we have some obsessive users on github who have been trying to insert unneeded backticks to all sorts of SQL statements, all over the place, completely wracking the prospect of ever being able to use PostgreSQL. This is especially true for the opencart-3 repository, and the OpenCart 4 master branch. I asked Daniel to remove the PostgreSQL driver from OpenCart 4 because currently there is no point in having it in there anymore.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by RiguPhoto » Fri Nov 24, 2023 9:04 pm

Ahhh, so that confirms that I am using the Condor2 version, thank you. I couldn't find the download for it last night when I was trying to reference what I had installed vs what I'd downloaded a few months ago. I can't remember why I chose that version but must have had reasons, maybe something to do with PHP 8 compatibility.

It's all good for the learning process, every time I find and deal with a problem I learn a bit more about how Opencart and other things work (or don't!). Looks like I'll be switching over the 3.0.X.X maintenance branch soon.

Newbie

Posts

Joined
Thu Dec 19, 2013 6:13 pm
Who is online

Users browsing this forum: No registered users and 18 guests