Jump to content

Show product flag "Product is already in cart" in product-list


dianacd

Recommended Posts

Hello there, 


I am new developer in Prestashop, I use Prestashop 1.7

 

I added a sold out flag when product quantity is 0 with the following code:

 

    {if $product.quantity==0}
        <li>
            <img src="soldout.png" style="position:absolute;max-width:65px" />
        </li>
    {/if}


But when the customer adds the product to the cart (if the only quantity available is 1) the sold out label will be shown in the product list.


I would like to instead, show a flag that says "Already in cart" in this case but I am not sure how to verify if the current product is on cart.

 

Someone has any idea in how to do the condition to verify current product is in cart?

 

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