owengna Posted April 9, 2015 Share Posted April 9, 2015 Hi, Is there anyway to modify the wishlist module to include add to cart button on products on wishlist? To be honest, the wishlist module doesn't work that well, some of my clients are quite confused with the wishlist module especially the priority and quantity part. Is there any alternatives? Link to comment Share on other sites More sharing options...
mirekcerno Posted August 5, 2015 Share Posted August 5, 2015 Hi, I got the same feeling. I need to add a button which adds all products from wishlist to cart. Any clue how to do it? Thx Mirek Link to comment Share on other sites More sharing options...
M03G Posted September 22, 2015 Share Posted September 22, 2015 Hi, Is there anyway to modify the wishlist module to include add to cart button on products on wishlist? To be honest, the wishlist module doesn't work that well, some of my clients are quite confused with the wishlist module especially the priority and quantity part. Is there any alternatives? Hi, I got the same feeling. I need to add a button which adds all products from wishlist to cart. Any clue how to do it? Thx Mirek Hello. You need to add the button code in the file themes/your_template/modules/blockwishlist/views/templates/front/managewishlist.tpl at the end of the element ".btn_action": <a class="exclusive button ajax_add_to_cart_button add-to-cart-in-wl" href="{$link->getPageLink('cart', true, NULL, "qty={$product.quantity|intval}&id_product={$product.id_product|intval}&add")|escape:'html':'UTF-8'}" data-id-attribute="{$product.id_product_attribute}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{$product.quantity|intval}" title="{l s='Add to cart' mod='blockwishlist'}"><span>{l s='Add to cart' mod='blockwishlist'}</span></a> And you need to change the code in the file themes/your_template/js/modules/blockcart/ajax-cart.js that handles the event "click" on an element ".ajax_add_to_cart_button": $(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function(e){ e.preventDefault(); var idProduct = parseInt($(this).data('id-product')); var idProductAttribute = parseInt($(this).data('id-product-attribute')); var minimalQuantity = parseInt($(this).data('minimal_quantity')); if ($(this).is('.add-to-cart-in-wl')) { quan = $(this).closest('.product_infos').find('.wishlist_product_detail input.form-control').val(); if (quan != minimalQuantity) minimalQuantity = quan; } if (!minimalQuantity) minimalQuantity = 1; if ($(this).prop('disabled') != 'disabled') ajaxCart.add(idProduct, idProductAttribute, false, this, minimalQuantity); }); For more information (in Russian) can be found here. Link to comment Share on other sites More sharing options...
Jonathan Turpin Posted June 26, 2018 Share Posted June 26, 2018 Thank you for this piece of code. Very useful for me! Greetings. Link to comment Share on other sites More sharing options...
tomikk Posted August 19, 2018 Share Posted August 19, 2018 (edited) This tutorial is ok, but I've got problem because combinations are not adding to cart (instead this it takes default combinations). Has anybody similiar problem? Maybe somebody already fix this? Add to cart link looks like: <a class="exclusive button ajax_add_to_cart_button add-to-cart-in-wl" data-id-attribute="53" data-id-product="9" data-minimal_quantity="1" title="Add to cart" href="http://www.XXXXXXX.eu/cart?qty=1&id_product=4&add="><span>Add to cart</span></a> Prestashop 1.6.19 Edited August 19, 2018 by tomikk Something added (see edit history) Link to comment Share on other sites More sharing options...
Oleh7772 Posted July 11, 2019 Share Posted July 11, 2019 (edited) Hello. Can you help me, I want to find a module ADD TO WISHLIST, maybe have everyone, help me please. (PRESTASHOP 1.7 FOR ME - FOR NOT PRODUCTION) Edited July 11, 2019 by Oleh7772 (see edit history) 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