Jump to content

PS 1.6 check if cart is not empty in Javascript


Recommended Posts

Hello,

 

How to check if the cart contains product in javascript?

 

I want to do this, for example on page load, if cart is not empty, add some specific style, for example:

 

if (cart_not_empty){

  //

}

 

I know that there's variable $cart_qties but it's smarty.

 

Also there's ajaxCart.nb_total_products, but it shows 0 unless you add another product to cart (if you have 1 product and refresh the cart ajaxCart.nb_total_products says 0, if you then add another product to the basket ajaxCart.nb_total_products equals correct number).

 

Many thanks.

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...