Show popup when customer press "add to cart" on product page with combinations in PrestaShop

Hi Milos, I have one customer who uses Pop-up pro from you and therefore I know a little bit about the set up. Now another customer needs a popup to be shown after the customer push the buy button for a certain product. I can't find such setting for this module. Is it something you can add for this customer as a customization if they buy the module? 

All the products which has to have this function is attribute products which have to be bought from the product page.
You are clear over that it’s only some products, not all. I know we can set a popup to appear when you enter a product. Will this customization be connected to this feature in your PopUp pro module?

how to show custom popup with pressing 'add to cart' button ?

So, if it will be related only to products that have combinations it will be necessary to add this kind of script at the end of product.js file (themes/your-theme/js/product.js)
$(document).ready(function() {
    var id_of_popup_to_show = 1;
    if (attributesCombinations.length>0) {
        $('#add_to_cart').click(function() {
             var postoptions = "getparams=" + id_of_popup_to_show;
            $.post(baseDir + "modules/popuppro/ajax_popuppro.php", postoptions, function (data) {
just replace value of id_of_popup_to_show with ID of popup you want to display, id of popu you can get here: 

Result of script: 
poup that will be spawned only for products that have combinations. on screencast i show script workflow for product with and without combinations (to show differencies)

I provided it for free as a part of module support,
so if your customer already have this module - it will be enough to use the script i shared above.

best regards,
Share on Google Plus


This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment


Post a Comment