Post by supak111 » Wed Dec 18, 2024 7:08 pm

In my shopping cart when I click the X button to remote the only item, page should refresh so that the cart looks empty but it doesn't.
This work fine on fresh 3.0.3.2 install, but not on my site so something is causing this...

How can I track down why the cart/page isn't refreshing after clicking the remote X button?
Last edited by supak111 on Sat Dec 21, 2024 4:00 pm, edited 1 time in total.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by paulfeakins » Wed Dec 18, 2024 8:11 pm

supak111 wrote:
Wed Dec 18, 2024 7:08 pm
How can I track down why the cart/page isn't refreshing after clicking the remote X button?
Disable your OCMODs one-by-one until the problem disappears.

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 ADD Creative » Wed Dec 18, 2024 8:58 pm

Use your web browser's developer tool to look for error. There should be a POST via common.js to /index.php?route=checkout/cart/remove which will return JSON and trigger a JavaScript redirect.

www.add-creative.co.uk


Guru Member

Posts

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

Post by Cue4cheap » Wed Dec 18, 2024 9:41 pm

supak111 wrote:
Wed Dec 18, 2024 7:08 pm
In my shopping cart when I click the X button to remote the only item, page should refresh so that the cart looks empty but it doesn't.
This work fine on fresh 3.0.3.2 install, but not on my site so something is causing this...

How can I track down why the cart/page isn't refreshing after clicking the remote X button?
There has been some discussion about SEO keywords causing this like this post entry (last one from OpenQuestion) viewtopic.php?t=186083
Do you have seo keywords setup for your checkout?
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by JNeuhoff » Wed Dec 18, 2024 9:56 pm

It would be helpful to give us some more details, e.g. website URL, theme, extensions installed, etc.

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 supak111 » Wed Dec 18, 2024 10:25 pm

Hey guys. I figured out which extension was causing this. Yes I recently installed a SEO friendly URLs extension for all the footer URLs, so that was it.

https://www.opencart.com/index.php?rout ... n_id=31993

There is another similar extension that says this code should fix the X remove cart button issue:

"
How to fix the issue:
For example default OPENCART theme:
1) Locate file: Your-Store\catalog\view\javascript\common.js
2) locate this line:

Code: Select all

if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
- You should find it 3x

Remove whole if - else statement and add this instead:

Code: Select all

var url_seo = document.URL;
var m = url_seo.match(/\/([^\/]+)[\/]?$/);

if (m[1] == 'cart' || m[1] == 'checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
Each m[1] in this statement refers to your url in seo. That means that now it will check if m[1] is cart or checkout than it
will reload the cart thus removing the product"

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by Cue4cheap » Wed Dec 18, 2024 10:54 pm

supak111 wrote:
Wed Dec 18, 2024 10:25 pm
Hey guys. I figured out which extension was causing this. Yes I recently installed a SEO friendly URLs extension for all the footer URLs, so that was it.
Good that it is fixed but in my opinion don't do SEO URLs for the checkout pages. But that is only my opinion. :)

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by supak111 » Wed Dec 18, 2024 11:04 pm

Cue4cheap wrote:
Wed Dec 18, 2024 10:54 pm
Good that it is fixed but in my opinion don't do SEO URLs for the checkout pages. But that is only my opinion. :)
Why do you recommend this? Is it just to be safe and make sure no issue arise during checkout?

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by Cue4cheap » Wed Dec 18, 2024 11:37 pm

supak111 wrote:
Wed Dec 18, 2024 11:04 pm
Cue4cheap wrote:
Wed Dec 18, 2024 10:54 pm
Good that it is fixed but in my opinion don't do SEO URLs for the checkout pages. But that is only my opinion. :)
Why do you recommend this? Is it just to be safe and make sure no issue arise with during checkout?
Not really needed. The SEO to help people find your pages. Pages like checkout have no real need to be found by people. Maybe slightly wanted to ensure people know they can buy something from you but I think that is pretty intuitive by looking at product pages and the add to cart.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by paulfeakins » Thu Dec 19, 2024 11:17 pm

supak111 wrote:
Wed Dec 18, 2024 10:25 pm
I figured out which extension was causing this.
Great, can we mark this as [SOLVED]?

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 supak111 » Sat Dec 21, 2024 4:00 pm

paulfeakins wrote:
Thu Dec 19, 2024 11:17 pm
supak111 wrote:
Wed Dec 18, 2024 10:25 pm
I figured out which extension was causing this.
Great, can we mark this as [SOLVED]?
sure thing boss

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by supak111 » Sun Dec 22, 2024 1:17 pm

ADD Creative wrote:
Wed Dec 18, 2024 8:58 pm
Use your web browser's developer tool to look for error. There should be a POST via common.js to /index.php?route=checkout/cart/remove which will return JSON and trigger a JavaScript redirect.
I would love to be educated on this... I looked and didn't see anything

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by nonnedelectari » Sun Dec 22, 2024 8:05 pm

supak111 wrote:
Sun Dec 22, 2024 1:17 pm
ADD Creative wrote:
Wed Dec 18, 2024 8:58 pm
Use your web browser's developer tool to look for error. There should be a POST via common.js to /index.php?route=checkout/cart/remove which will return JSON and trigger a JavaScript redirect.
I would love to be educated on this... I looked and didn't see anything
In the network tab you can see any request made by the browser, what is requested, send, received, the works, including that request.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by JNeuhoff » Sun Dec 22, 2024 8:33 pm

Or, if you use Firefox, just press the F12 function key, and then click on the network tab.

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

Who is online

Users browsing this forum: Amazon [Bot] and 11 guests