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
Who is online

Users browsing this forum: No registered users and 16 guests