Post by gunownergear » Fri Aug 29, 2025 7:31 am

So, here's a good one for all of you great Opencart problem solving guru's.
Opencart version 4.1.0.3
Yes, I know, version 4 has a lot of bugs and I should be using something else...
What fun would that be?

Product Compare.
When I click on product compare on a product page I get this message:

Image

Although there is an X, which indicates the message should show until you click the X,
or click the link, this message fades fast, and if you are not quick
enough to click the link to the Product Comparison page, then I can't find
the Product Comparison page anywhere.
So, I put a link at the top of the website, between Account and Wishlist.
If you are quick enough to click the link in the message box, it takes you
to the Product Comparison page and nothing changes at the top.

Image

What I didn't see before I put the link up there, what actually happens is this:

Image

If you miss clicking the link in the message and let it fade away it changes the
Wishlist link to read Product Compare and puts a (1) next to it.
You will notice the heart is still there.
If you click on that link it shows the Wishlist page that is empty unless
you have products in your Wishlist it will show those products.
After you view that and go to something else, the link goes back to normal
reading Wishlist again.

The link that I made for Product Compare will have actual product that I want to compare.

I think when it adds the Product Compare to the top and puts the counter with it is pretty cool.
I would like that to happen.

So what I would like to do is one of these options:
1. Make that automatic link with the counter make it's own space instead of overwriting the Wishlist.
2. Make it overwrite the Product Compare link I made.
3. Make it quit overwriting the Wish list and make my link have a counter.
4. Make it so when the Compare Button is clicked on the product page it opens the Product Comparison page immediately, and have a counter on the link.
Now, that's not too much to ask, is it?

If you want to see what happens visit: https://gunownergear.com
Click on any product and then the compare button

Happy coding and thanks !
Dan

New member

Posts

Joined
Sun Mar 16, 2025 7:06 am

Post by paulfeakins » Fri Aug 29, 2025 11:06 pm

So there's some confusion about the Wishlist and Compare list?

You could report it as a bug on Github, if you're sure it happens in a fresh install?

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


User avatar
Legendary Member

Posts

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

Post by gunownergear » Sat Aug 30, 2025 9:33 am

paulfeakins wrote:
Fri Aug 29, 2025 11:06 pm
So there's some confusion about the Wishlist and Compare list?

You could report it as a bug on Github, if you're sure it happens in a fresh install?
Hi Paul,
I thought I explained the problem pretty well, but I don't really know, am not "sure", if this is a "fresh" install issue.
I installed this back in March, and I'm just now getting around to see if everything is working right.
The Wishlist and the Comparison pages both "work" fine.

I had an issue with the wish list not too long age, which was solved by Exel and cgarofalo.
You can read their solutions in the post: [SOLVED] Wishlist Issues, which is posted below this post, and see if their coding could cause this problem.
The wish list issue was causing some crazy problems but seems to be fixed now.

The issue now is with compare, which is explained the best I can explain it, and even includes pictures.
The only extensions installed are Paypal, USPS shipping by Johnathan, and one called plusminus.twig.
Those seem to be working also.
Then I have modified some files to fix other things that were broken with code found here in this forum.
Some were to get rid of errors by khnaz35, which worked perfect.
I don't think I caused any problems. I have not changed anything in Compare for sure, and the ones I did change were code given to me by the experts here.
Maybe the problems are from the fresh install from March, and I am just now getting around to finding them, but I have checked out other posts and searches and did not find any topics related to this one.
I have confidence that this problem can be fixed by the knowledgeable folks here in this forum.
Thanks,
Dan

New member

Posts

Joined
Sun Mar 16, 2025 7:06 am

Post by khnaz35 » Sat Aug 30, 2025 4:51 pm

Hi Dan,
To fully isolate the issue, you can try creating a fresh store in a subdirectory and check if the problem also occurs on a clean installation. Please make sure not to install any additional extensions, plugins, modules, or themes. Just use a plain new OpenCart store and compare whether the same issue appears on the same version.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by gunownergear » Sat Aug 30, 2025 11:39 pm

Hi Guys,
OK, installed a fresh 4.1.0.3
I created an account.
When adding a product to Product Compare, it does not change the wording Wishlist to Product Compare at the top.
Nor is there any link what so ever to the Product Comparison page other than to click the link in the message you get after clicking the compare button on the product page, which fades fast.
So, what I would like to do is one of the 4 options listed near the bottom of my original post.

What the fresh install does do is the problem I had with the wishlist:

I had an issue with the wish list not too long age, which was solved by Exel and cgarofalo.
You can read their solutions in the post: [SOLVED] Wishlist Issues, which is posted below this post, and see if their coding could cause this problem.
The wish list issue was causing some crazy problems but seems to be fixed now.


Maybe some of that code which fixed wish list issue is causing this problem? That is the only changes I made to the wish list.
I'm not worried about changing core files, I am not planning to upgrade this version to a "newer" one.
Thank you for your time and help,
Dan

Update:

I believe this is the cause of the problem.
This code was used to make the wish list update (refresh).

catalog\view\javascript\common.js
Find:
Code: Select all

Code: Select all

if (url !== undefined && target !== undefined) {
                        $(target).load(url);
                    }
Below it add:
Code: Select all

Code: Select all

 if(json['total']) {
                        $('#wishlist-total').attr('title', json['total']).find('span').text(json['total']);
                    }

When I remove this code the "Wish List" text does not change to "Product Compare".
On the left side next to the numbers there is a yellow triangle with a ! that reads "['total'] is better written in dot notation"
but there a many of those in catalog\view\javascript\common.js
Any way to fix this and add a "total" to the link I made for the Product Compare?
Thanks,
Dan

New member

Posts

Joined
Sun Mar 16, 2025 7:06 am

Post by paulfeakins » Mon Sep 01, 2025 7:37 pm

gunownergear wrote:
Sat Aug 30, 2025 11:39 pm
OK, installed a fresh 4.1.0.3
I created an account.
When adding a product to Product Compare, it does not change the wording Wishlist to Product Compare at the top.
Nor is there any link what so ever to the Product Comparison page other than to click the link in the message you get after clicking the compare button on the product page, which fades fast.
So to be clear, you think this is an actual bug in OpenCart 4.1.0.3?

If so, could you report it here: https://github.com/opencart/opencart/issues

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


User avatar
Legendary Member

Posts

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

Users browsing this forum: Majestic-12 [Bot] and 7 guests