Taking back the Add To Cart button in the Product list (Prestashop 1.7)

If you started using PrestaShop 1.7 (brave!) and you miss the Add to Cart button in the product list, let’s see how to take it back with 4 lines of code!

You like the tuts and want to say "thank you"? Well, you can always feel free to donate:

  • Chris Rabkin

    Great post- is it possible to change the “Add to cart” label to “In someone’s cart or sold” when someone puts the product in their cart? This case – the prestashop owner has only 1 of each product in stock. So when someone puts a product in their cart- no one else can be allowed to purchase. But I need to notify them – your solution seems like a good way to do this.

  • Revelateur

    Hi Nemo,

    Thanks for the tutorial.
    I came back in this post to share an issue with this tutorial.

    In Prestashop 1.7.4 if you are connected, your form won’t work until you add the static token.

    So if you have the same problem than me, follow Nemo’s tutorial and in form (file : product.tpl) add an hidden input like this before the button :

    This sould fix your problem.

    Sorry for my bad english. :D

    Hope it’s help. ;)

  • Abhishek Aggarwal

    Hi Nemo,
    Great tutorial! I have a question though. Shouldn’t this just add the default combination of the product to the cart? I’ve noticed that id_product for all the combinations is the same so how would you specify a particular combination here?

  • Łukasz Olszewski

    It happens like that, when You’re out of stock.

  • Łukasz Olszewski

    Nice, but after changes my “Quick view” is beig “covered” and i can’t clik it.

  • Carl Valcke

    Hello Nemo,

    For any reason it doesn’t seem to work on my site.
    Also the display is not working fine.

    I am also looking to tweek the code you have made to use the prestashop translation according to the langauage used.

    Thanks for your help!

  • NemoPS

    This is exclusively for 1.7, 1.6 already supports the add to cart button. If not, check your theme options, or copy it straight from the 1.6 default template :)

  • G N Vinod Kumar

    Hi. Thanks for the tutorial. It works perfect. But products which are not in stock or out of stock, then also, it shows Add to Cart button. If a customer clicks add to cart button, it shows pop up message of successfully added to cart without any product. And products with attributes like size and colours, by default which product will be added in catalogue view. Do we have any control over that. Thank You

  • Yes

    Hello, Fabio.
    This method doesn’t work if customer logged in.
    No errors in console. can you assist?

    • Yes

      Ok, found it by myself.
      add this into code

      and then it works flawlessly

  • Caglar

    Beautiful and life saver post. Thanks a lot!

  • Ibrahim Roman Morlans

    Can you paste de code here please? or where can copy? too long for take from the video :-)

    Thanks for your great website!!

  • Coco

    Nice tip thanks! I was wondering if you know how to put back the price range selector that was available in PS 1.6vs and that disappear for 1.7? :(

    • Fabio Porta

      I guess they just got rid of it :(

      • Coco

        how disappointing :/

        • NemoPS

          You can try out http://thirtybees.com, it’s a prestashop 1.6 fork :)

        • Coco

          Thanks for the advice. On the off-chance, do you know how to put javascript in a tpl file?

    • NemoPS

      I guess they just got rid of it :(

  • Serproo Gcv

    This works for me in prestashop but not when u use first the faceted filter ?

  • Neo

    Unfortunately, this don’t work in PS, the button indicates the click, but nothing happens.

Store Top Sales

You like the tuts and want to say "thank you"? Well, you can always feel free to donate: