I am using opencart 3.0.4.0 for a new site and everything is working and using a theme called electronic and having a issue where the delete button is not refreshing/updating the shopping cart page and so the product stays there when the button is clicked. I have to refresh the page and then product is removed from the shopping cart page
It does it on the default theme as well and I remember it did it on the opencart 2.3.0.2 site I used to have but I can't remember what I did to solve it
It does it on the default theme as well and I remember it did it on the opencart 2.3.0.2 site I used to have but I can't remember what I did to solve it
It works with the default theme on OC 3.0.4.0, see e.g. our demo site. Hence you should contact the theme author. Or provide a link to your OpenCart site here if you want some more help.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Ahh ok sounds like it's theme related, the link to the site is https://www.it-doneright.co.uk/shop/
I'll also contact the theme developer to see if they can help too
I'll also contact the theme developer to see if they can help too
You made your cart url SEO friendly and did not adjust the ajax logic in common.js accordingly.ianhaney50 wrote: ↑Sat Dec 07, 2024 7:47 pmAhh ok sounds like it's theme related, the link to the site is https://www.it-doneright.co.uk/shop/
I'll also contact the theme developer to see if they can help too
That logic does not expect an SEO friendly url for the cart and will therefore not redirect properly, as in not at all.
Ahh ok, I have updated the code in the common.js file but it didn't work
From
TO (This is what I had in the 2.3.0.2 common.js file
From
Code: Select all
if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
TO (This is what I had in the 2.3.0.2 common.js file
Code: Select all
if ($(location).attr('href') == 'https://www.it-doneright.co.uk/shop/cart' || $(location).attr('href') == 'https://www.it-doneright.co.uk/shop/checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
May we assume you cleared your caches? Your browser cache in particular?ianhaney50 wrote: ↑Sat Dec 07, 2024 9:16 pmAhh ok, I have updated the code in the common.js file but it didn't work
FromCode: Select all
if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info ul li'); }
TO (This is what I had in the 2.3.0.2 common.js fileCode: Select all
if ($(location).attr('href') == 'https://www.it-doneright.co.uk/shop/cart' || $(location).attr('href') == 'https://www.it-doneright.co.uk/shop/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info ul li'); }
Yeah I've cleared the cache in firefox and the cache from cloudflare but I set a rule in cloudflare to ignore the shop directory but I cleared the cache anyway within cloudflarenonnedelectari wrote: ↑Sat Dec 07, 2024 9:23 pmMay we assume you cleared your caches? Your browser cache in particular?ianhaney50 wrote: ↑Sat Dec 07, 2024 9:16 pmAhh ok, I have updated the code in the common.js file but it didn't work
FromCode: Select all
if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info ul li'); }
TO (This is what I had in the 2.3.0.2 common.js fileCode: Select all
if ($(location).attr('href') == 'https://www.it-doneright.co.uk/shop/cart' || $(location).attr('href') == 'https://www.it-doneright.co.uk/shop/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info ul li'); }
Personally I would just put something like this in htaccess or your httpd.conf:
then you can leave the javascript with all those hardcoded references alone.
Normally I would not recommend to put SEO url logic in htaccess but for the checkout and account paths, which OC explicitly excluded for good reason, that is often the best way in OC as many ajax call have hardcoded references to the non-SEO urls.
On the other hand, SEO urls for paths which will never be indexed by SEs is rather futile, they are called SEO urls for a reason.
Code: Select all
RewriteRule ^shop/cart$ index.php?route=checkout/cart [L]
RewriteRule ^shop/checkout$ index.php?route=checkout/checkout [L]
Normally I would not recommend to put SEO url logic in htaccess but for the checkout and account paths, which OC explicitly excluded for good reason, that is often the best way in OC as many ajax call have hardcoded references to the non-SEO urls.
On the other hand, SEO urls for paths which will never be indexed by SEs is rather futile, they are called SEO urls for a reason.
I have put the original code back in the common.js file and added the two lines you mentioned to the htaccess file (I put them just under the RewriteBase /shop/ linenonnedelectari wrote: ↑Sat Dec 07, 2024 9:37 pmPersonally I would just put something like this in htaccess or your httpd.conf:then you can leave the javascript with all those hardcoded references alone.Code: Select all
RewriteRule ^shop/cart$ index.php?route=checkout/cart [L] RewriteRule ^shop/checkout$ index.php?route=checkout/checkout [L]
Normally I would not recommend to put SEO url logic in htaccess but for the checkout and account paths, which OC explicitly excluded for good reason, that is often the best way in OC as many ajax call have hardcoded references to the non-SEO urls.
On the other hand, SEO urls for paths which will never be indexed by SEs is rather futile, they are called SEO urls for a reason.
I've cleared the cache again but still got the same issue
Well, maybe put:
before that redirect logic and see what it says in your web dev tools console when you click remove.
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
I'll try that but have since been advised by the developer of the theme that it's best to have the site on a subdomain such as shop.domain.co.uk then I won't run into issues as they said having the opencart site in a subfolder such as /shop/ it will generate issuesnonnedelectari wrote: ↑Sat Dec 07, 2024 10:29 pmWell, maybe put:before that redirect logic and see what it says in your web dev tools console when you click remove.Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
nonsense, you can run multiple OC sites in subfolders, besides, not sure how long you have been running this but moving to a sub domain might impact your ranking.ianhaney50 wrote: ↑Sat Dec 07, 2024 10:50 pmI'll try that but have since been advised by the developer of the theme that it's best to have the site on a subdomain such as shop.domain.co.uk then I won't run into issues as they said having the opencart site in a subfolder such as /shop/ it will generate issuesnonnedelectari wrote: ↑Sat Dec 07, 2024 10:29 pmWell, maybe put:before that redirect logic and see what it says in your web dev tools console when you click remove.Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
It's not been running long and not had many sales on it to be honest so not too worried as hopefully it will start ranking for the new subdomainnonnedelectari wrote: ↑Sat Dec 07, 2024 11:13 pmnonsense, you can run multiple OC sites in subfolders, besides, not sure how long you have been running this but moving to a sub domain might impact your ranking.ianhaney50 wrote: ↑Sat Dec 07, 2024 10:50 pmI'll try that but have since been advised by the developer of the theme that it's best to have the site on a subdomain such as shop.domain.co.uk then I won't run into issues as they said having the opencart site in a subfolder such as /shop/ it will generate issuesnonnedelectari wrote: ↑Sat Dec 07, 2024 10:29 pmWell, maybe put:before that redirect logic and see what it says in your web dev tools console when you click remove.Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
Sorry where do I put the linenonnedelectari wrote: ↑Sat Dec 07, 2024 10:29 pmWell, maybe put:before that redirect logic and see what it says in your web dev tools console when you click remove.Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
Code: Select all
console.log(getURLVar('route'));
I put the code back into the common.js file and tried again and looked at the console log in firefox and it says the following when I clicked the delete buttonnonnedelectari wrote: ↑Sat Dec 07, 2024 10:29 pmWell, maybe put:before that redirect logic and see what it says in your web dev tools console when you click remove.Code: Select all
console.log(getURLVar('route'));
Your cart update seems to work but remove still goes to https://www.it-doneright.co.uk/shop/ind ... /cart/info which means it does not recognize the checkout/cart or checkout/checkout url.
POST
https://shop.it-doneright.co.uk/index.p ... art/remove
GET
https://shop.it-doneright.co.uk/index.p ... /cart/info
I was unsure if I need to also add them two lines of code back into the htaccess file and unsure where to put the other code
Code: Select all
console.log(getURLVar('route'));
I've put the following code back into the common.js file but it's not showing anything in the console tab in firefox
Not sure if I need to alter the code as not 100% at complicated code
Code: Select all
console.log(getURLVar('route'));
if ($(getURLVar).attr('route') == 'https://shop.it-doneright.co.uk/cart' || $(getURLVar).attr('route') == 'https://shop.it-doneright.co.uk/checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
I've checked the console log in chrome but it's already got two errors showing before I clicked the delete button
The errors it shows are below
Uncaught (in promise) Error: QUOTA_BYTES quota exceeded
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
The errors it shows are below
Uncaught (in promise) Error: QUOTA_BYTES quota exceeded
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
It looks like your electronics theme uses its own common.js:
catalog/view/theme/electronic/js/common.js
it doesn't use the
catalog/view/javascript/common.js
Hence, changing the latter won't make any difference.
In any case, you shouldn't use SEO Urls for the checkout cart events in the first place, they are of no interest to the search engines.
catalog/view/theme/electronic/js/common.js
it doesn't use the
catalog/view/javascript/common.js
Hence, changing the latter won't make any difference.
In any case, you shouldn't use SEO Urls for the checkout cart events in the first place, they are of no interest to the search engines.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Ahh that did it but after it refreshed the page, it shows a The page you requested cannot be found.JNeuhoff wrote: ↑Sun Dec 08, 2024 5:39 amIt looks like your electronics theme uses its own common.js:
catalog/view/theme/electronic/js/common.js
it doesn't use the
catalog/view/javascript/common.js
Hence, changing the latter won't make any difference.
In any case, you shouldn't use SEO Urls for the checkout cart events in the first place, they are of no interest to the search engines.
The url is https://shop.it-doneright.co.uk/://DOMAIN_ROOT/cart which is because of a extension I installed called /ocmod.space/seo_common_urls from https://www.opencart.com/index.php?rout ... n_id=45444 unless there is another way I can remove the index.php?route=common/home from the home page URL etc
yes, in seo_url controller, search for it as it has been addressed many times, sure there is a free extension for it as well.ianhaney50 wrote: ↑Sun Dec 08, 2024 6:19 amAhh that did it but after it refreshed the page, it shows a The page you requested cannot be found.JNeuhoff wrote: ↑Sun Dec 08, 2024 5:39 amIt looks like your electronics theme uses its own common.js:
catalog/view/theme/electronic/js/common.js
it doesn't use the
catalog/view/javascript/common.js
Hence, changing the latter won't make any difference.
In any case, you shouldn't use SEO Urls for the checkout cart events in the first place, they are of no interest to the search engines.
The url is https://shop.it-doneright.co.uk/://DOMAIN_ROOT/cart which is because of a extension I installed called /ocmod.space/seo_common_urls from https://www.opencart.com/index.php?rout ... n_id=45444 unless there is another way I can remove the index.php?route=common/home from the home page URL etc
Who is online
Users browsing this forum: lockiedownunder and 16 guests