Jurist Posted August 2, 2017 Share Posted August 2, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now