Jump to content

Cart doesn't update: TypeError


Ruup

Recommended Posts

Hi,

 

While in shopping cart and change quantity of the item, the price and item doesn't update automatically. Deleting items is the same story.

Firebugs shows 'TypeError: e.reason is undefined' See screenshot.

 

A manual page refresh does work. Ajax is turned on in de cart module. Version 1.7.2.0

What's te problem?

 

Thanks in advance.

post-1409054-0-65001100-1500834098_thumb.png

Edited by Ruup (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

While in shopping cart and change quantity of the item, the price and item doesn't update automatically. Deleting items is the same story.

Firebugs shows 'TypeError: e.reason is undefined' See screenshot.

 

A manual page refresh does work. Ajax is turned on in de cart module. Version 1.7.2.0

What's te problem?

 

Thanks in advance.

 

Can you give the site url? I'd like to check the issue and see if I can help. I think it may be a prolem of javascript if you're using a custom theme

Link to comment
Share on other sites

You can try copy file themes/classic/assets/js/theme.js to paste in your theme.

And then you copy file:

classic/templates/checkout/_partials/cart-summary-product-line.tpl

classic/templates/checkout/_partials/art-detailed-product-line.tpl

and also paste in your theme again.

 

hi that may work, but it's can possibly mess the theme styles, may be they're looking for a way to fix the issue and have their custom theme work as expected

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

 i have same problem. When I click "add to cart" then nothing happened unless when i refresh page than the product is in the cart...any solution?

Thank you, Petr.

http://tompet.cz/plynova-topidla/8-plynove-topidlo-ma-tech-15-kw-s-termostatem.html

PS 1.7.2.1, classic theme

 

Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.readAjaxFields (front.js:101)
    at HTMLDocument.<anonymous> (front.js:33)
    at fire (core.js:690)
    at Object.fireWith [as resolveWith] (core.js:711)
    at Function.ready (core.js:745)
    at HTMLDocument.completed (core.js:748)

Edited by Euronymous
Fixed - it was Packetry module (zasilkovna) (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi everyone, 

 

I had the same issue. What I did was following the reply of kornwaikas in this post https://www.prestashop.com/forums/topic/622554-problem-with-cart-updating-in-prestashop-172/

I replaced the theme.js file I had in my theme/assets/js folder by one I had in a fresh install. 

it doesn't solve the issue but it helped me and I hope it can help other people. 

Nohossat

Link to comment
Share on other sites

  • 9 months later...
  • 7 months later...

Merci Undesigned !
Sur une version 1.7.5.1 avec le thème de base Prestashop non modifié j'avais le même problème de panier ajax qui ne se mettait pas à jour!
Une erreur baseUri is not defined at Object.refresh (ajax-cart.js:) dans la console de Chrome et tapant Panier dans le gestionnaire de modules, 2 modules sont apparus !
Panier v2.0.2 et Bloc panier V1.6.2 
Voilà donc les 2 modules qui étaient en conflit.
J'ai désactivé le module Bloc Panier V1.6.2 et maintenant c'est OK la panier se rafraichit bien quand on ajoute un produit.
J'explique le souci et surtout la solution en détail et français histoire que d'autres ne perdent pas autant de temps que moi...

Link to comment
Share on other sites

  • 3 months later...
On 12/5/2017 at 12:36 AM, nohossattraore said:

Hi everyone, 

 

I had the same issue. What I did was following the reply of kornwaikas in this post https://www.prestashop.com/forums/topic/622554-problem-with-cart-updating-in-prestashop-172/

I replaced the theme.js file I had in my theme/assets/js folder by one I had in a fresh install. 

it doesn't solve the issue but it helped me and I hope it can help other people. 

Nohossat

Overwriting the default theme.js to your theme's js is a very bad idea, since you are going to lose any custom functionality added by your theme that relies on javascript. Unless your theme adds nothing js related it is better to seek a different solution.

In the case of a site I support, which exhibited same behavior, after gathering the error reports from debugging out of both Firefox and Chrome, we came to a solution that involves editing the core.js file, in /themes/ However, this solution may or may not work in your case. And in any scenario you should check that main functions of your website work correctly after any change.

Edited by aramonkg
Adding information (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Hey everybody, I don't want to create new thread so I will ask here.

I have the same problem and no errors. When I add product to the cart ps_shopingcart module count in the header is updated, but cart that shows up when you press on the cart icon is not updated. For example add product to cart. press on cart icon and for example try to delete it. In network it says deleted but it is not updated. I noticed that there is one request missing that should call cart controller with params ajax=1 and action=refresh but it is not fired. Debug mode has no errors. I have no idea where it the problem. Can you help me? Because my customer (this is not my shop) wants to use module for product reservation and it is based on update cart.

url: https://kuckis.lt

Thank you very much. 

Link to comment
Share on other sites

Hi,

as an temporary solution you can add this code to your custom.js, and this will trigger the cart dropdown to be updated after removing item from cart:


	$(document).on('click', '.remove-from-cart',function() {
	    setTimeout("prestashop.emit('updateCart', {reason: {linkAction: 'refresh'}, resp: {}});", 10);
    });

Also the best way (and recommended one) would be to contact your theme developer or your cart module developer, so he can fix this inside his theme/module.

Kind regards, Leo

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...