Post by gunnysack263 » Mon Jul 24, 2017 10:14 pm

My cart is caching prior information and I can't get it to refresh to the current items in the cart.

Example:
Item A added to cart - Item A Shows up in cart at the top of the page correctly.
Item B added to cart - Cart total is correct and shows two items. Click on cart button and only Item A shows up with the total of only item A.
Click Refresh Page - Both Items A & B show up with correct total.
Click Cart button at top and delete Item A - Cart at top of page shows one item and correct amount.
Click cart button at top - Cart shows both Items A & B.
Click Refresh button - Cart shows only item B

It seems to be either an ajax issue or a caching issue, but I can't figure it out and can not find help online for OpenCart Version 3.0.1.1.

Thank you!

Newbie

Posts

Joined
Fri Jul 07, 2017 4:48 am

Post by labeshops » Tue Jul 25, 2017 9:37 pm

You should add this to the bug reports section. I confirm the same thing is happening in v3.0.2.0

It is also occurring when you view cart from the mini cart - it only showed 1 product in the cart until I refreshed the page when the second suddenly appeared.

Running Opencart v2.2 with multi-stores from http://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

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

Post by vaughnchill » Mon Mar 05, 2018 4:59 pm

Was there ever a fix for this? I am having a similar issue. I don't remember this being an issue when I first downloaded 3.0.2, so not sure if I did something wrong.

Newbie

Posts

Joined
Thu Aug 31, 2017 2:11 pm

Post by cosmicx » Sat May 05, 2018 5:38 pm

UPDATE: Problem Fixed!

The fix:
I did another clean install of OpenCart 3.0.2.0 and imported my database dump and voila!

I'm thinking maybe the previous version I downloaded was a different build than the lated I used.
---------------------------------
This might be an OpenCart bug?

I've been working to find the culprit, at first I though it was the Journal Theme causing the issue. I contacted their support and told them the issue, along with videos and necessary issue reporting. But even after setting the Default Theme of OpenCart, same issue occurs.

Issues:
1. Adding products does not update/refresh the mini cart. The part which shows the product image, sub-total and total.
2. Removing products by clicking on the 'x' button does not update/refresh the mini cart. To remove them, remove products one by one, by clicking x button then reload the page, then do the same for the rest of the products.


My Setup:
- OpenCart 3.0.2.0 - downloaded from OpenCart.com
- VPS running Ubuntu 16.04, PHP7.0, VestaCP Control Panel
- storage/ directory is outside of public_html
- Multi-store setup, sub-domain for each multi-store.

What I've tried:

- Did another setup on the same VPS, but different domain name, and single store setup only.
- Installed Journal Theme and Imported a demo.
- Mini cart works fine as it should
Last edited by cosmicx on Mon May 07, 2018 6:15 pm, edited 2 times in total.

Active Member

Posts

Joined
Mon Jan 09, 2012 6:27 pm

Post by IP_CAM » Mon May 07, 2018 7:59 am

Well, this Extension could possibly solve this problem.
Ernie
---
Notice of addition
Displays a notice about adding goods to the cart, wishlist, compare.
https://www.opencart.com/index.php?rout ... n_id=32459
---
Image
---

For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

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

Post by Fabienlolo » Sat Jul 28, 2018 2:31 am

Hi, i downloaded OC 3.0.2. few days ago, and i have this issue as well. I opened a new topic. I guess i am not good at finding topics, because i just find yours now.
Unfortunately, no solutions for me right now. viewtopic.php?f=202&t=205891#top
I found this https://github.com/opencart/opencart/issues/2980 for another version, but may be that means, that there should be some server requierements that are not metionned.
Any way, 3.0.2 dowloaded on the 24/07/18 still have this issue for me.

New member

Posts

Joined
Fri Jun 29, 2018 7:24 am
Location - Q.Roo, Mexico

Post by theitwebcare » Wed Aug 01, 2018 2:49 am

Very strange cart and checkout does't refreshing after deleting or adding product or update qty. need to full reload page ctrl+f5

I am same issue Opencart Version 3.0.2.0 Journal 2.16.2.

when change add to cart qty or delete product from cart page don't update.... I have to hard reload or ctrl+f5 many times then after it get updated pages.

NO CACHING ACTIVE , OPENCART CACHE DISABLE , JOURNAL CACHE DISABLE , SERVER CACHE DISABLE .HTACCESS CACHE DISABLE. ALL DISABLED

any one have solution ? path please reply thx in advance.

Newbie

Posts

Joined
Wed Aug 01, 2018 2:01 am

Post by Fabienlolo » Thu Aug 02, 2018 6:50 am

Hi, thank for your concern.
I made it. Problem fixed, because of my web hosting guy. He did not explained what he did exactly, but since this guy came into play the whole updating cart/coupons/payment methods and other stuff, is updating just the right way.
Here is my original post. viewtopic.php?f=202&t=205891
as soon as i have an explanation, i will post it in that topic because this is the one i opened.
Thanks again for your attention.

New member

Posts

Joined
Fri Jun 29, 2018 7:24 am
Location - Q.Roo, Mexico

Post by nationalpc » Sun Sep 16, 2018 7:44 pm

Hi,
I am also facing the same issue. I have tried a lot, My hosting (Hostgator Cloud) support replied that, it's a bug from Opencart !!

What to do now ??

Newbie

Posts

Joined
Mon Sep 03, 2018 2:53 am

Post by daniGo » Mon Sep 17, 2018 12:32 am

Try replace in catalog/view/javascript/common.js

in add function

Code: Select all

if (json['success']) {
	$('#content').parent().before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

	// Need to set timeout otherwise it wont update the total
	setTimeout(function () {
		$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
	}, 100);

	$('html, body').animate({ scrollTop: 0 }, 'slow');

	$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
with

Code: Select all

if (json['success']) {
    $.ajax({
        url: 'index.php?route=common/cart/info',
        dataType: 'html',
        cache: false,
        success: function(html) {
            $('#cart > ul').html($(html).find('#cart > ul').html());
        },
	error: function(xhr, ajaxOptions, thrownError) {
		alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
    }).done(function() {
        $('#content').parent().before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

        $('html, body').animate({ scrollTop: 0 }, 'slow');

        $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
    });
}
edit function

Code: Select all

// Need to set timeout otherwise it wont update the total
setTimeout(function () {
	$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
}, 100);

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');
}
with

Code: Select all

if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
    location = 'index.php?route=checkout/cart';
} else {
    $.ajax({
        url: 'index.php?route=common/cart/info',
        dataType: 'html',
        cache: false,
        success: function(html) {
            $('#cart > ul').html($(html).find('#cart > ul').html());
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
    }).done(function() {
        $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
    });
}
remove function

Code: Select all

// Need to set timeout otherwise it wont update the total
setTimeout(function () {
    $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
}, 100);

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');
}
with

Code: Select all

if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
    location = 'index.php?route=checkout/cart';
} else {
    $.ajax({
        url: 'index.php?route=common/cart/info',
        dataType: 'html',
        cache: false,
        success: function(html) {
            $('#cart > ul').html($(html).find('#cart > ul').html());
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
    }).done(function() {
        $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
    });
}

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by Lavingstar » Mon Sep 17, 2018 2:26 am

I've tried it right now, but in my case it did not change anything unfortunately ... :-\

Newbie

Posts

Joined
Thu Jun 21, 2018 2:02 am

Post by nationalpc » Thu Sep 20, 2018 9:56 pm

I am facing the same issue in my Hostgator cloud business server. Hostgator support team is claiming that, it's a opencart issue. They did not find any error in the log file. That's why they are unable to solve this issue.

Newbie

Posts

Joined
Mon Sep 03, 2018 2:53 am

Post by IP_CAM » Fri Sep 21, 2018 3:01 am

Well, I just run into a similar Problem again, by testing some of YOOCART's free
v.2.x Bootstrap Themes, and yoohan-2031 + yoobeat-2031 worked,
but the yoobento-2302 Theme makes use of the $product['cart_id']
Variable, wich prevented, in my Case and OC-Version, products to be removed
from the header CART again.

So, make sure, if you use any Custom Theme, that this $product[' xxx '] Variable
meets your OC Version 'standard', to so at least solve one potential problem, related
with this. But I also could not yet find out, why it shows Products in this Cart, but it
still only tells you, that the cart is empty, if clicked on, in some test installs at
least... :choke:

Please note: The Image only displays the Value, not working in MY OC Version, so,
check in your own OC Version, wich one needs to exist, before changing anything.
or then, just REMOVE the cart.tpl file from the Custom Theme, then, the default
Theme .../template/common/cart.tpl File automatically will be used instead!
Just in case, but DON't do it with Journal - Pavo - and other heavy loaded Theme
Extensions, they are built differently, and may no longer function after such ! ;)
Ernie
---
It now works! :D (PEKU's OC-2.0.3.1 Theme enhanced OC v.1.5.6.5 EDGE used)
http://www.ipcam.li/shop/en/Components/ ... 25c28.html
---
Image

Attachments

oc_header_cart_product_removal_error.jpg

oc_header_cart_product_removal_error.jpg (132.01 KiB) Viewed 268 times


For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

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

Post by IP_CAM » Mon Sep 24, 2018 12:44 pm

Good News, I found my Problem, after all. And I recall, to have been
wondering about the Fact, that the cart.tpl file has been moved from
the Theme module/... Directory to the Theme common/...
Directory from OC v.2 up.

But I forgot about this, up to now, by finding out, that a few of my OC-2 Custom
Themes only 'Header-Cart-autoupdate-function' as planned, if I let OC use
the default Theme product.tpl file instead, by simply removing the Custom
Theme product.tpl, on my latest Multitheme Test Site:
http://www.ejacob.ch/shop/index.php
---
It might at least be of some help for those, mixing 1.5.6.x Version Source with later
Version responsive Themes ! :D But if one has a working (default) Theme, and only
problems with Custom Themes on this, just either remove the Custom Theme product.tpl,
or replace it with the working Theme product.tpl file, to probably make it work.
Ernie
---
Image

Attachments

add_to_cart_display_update_problem.jpg

add_to_cart_display_update_problem.jpg (113.52 KiB) Viewed 205 times


For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

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

Users browsing this forum: No registered users and 18 guests