Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get the status message if can't add more products in the cart #200

Open
nikkodelacruz opened this issue Mar 3, 2021 · 1 comment

Comments

@nikkodelacruz
Copy link

nikkodelacruz commented Mar 3, 2021

This is the code that I'm using from cart js

$(document).on('cart.requestComplete', function(event, cart) {
      $('#CartCount').removeClass('hide');
      $('#CartCount span[data-cart-count]').html(cart.item_count);
       console.log(cart)
  });

But the problem is I can't print or get the response that shows this from the console

description: "You can't add more -Product name-  to the cart."
message: "Cart Error"
status: 422

I need a work-around to display It on frontend to notify the customer

@psydigital
Copy link

+1

@discolabs how do you get the error bag from the requestComplete returned event?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants