php - Is possible to add Wishlist products with quantity and other attributes to Cart in prestashop -
Is it possible to add Wishlist product with quantity and other attributes to make purchases in the cart?
I used the code below to add the product to the cart in managewishlist.tpl and remove it from wishlist.
Please let me know Tell me how to pass the value of quantity so that I can get the result. For example, if I have a product in the wish list and its volume is 3
so when I click on add to cart I should add it to 3 volumes of the same product.
Also tell me how I am available in the will Color and size properties.
Code for the buttons (themes / your_template / modules / Blockwishlist / views / templates / front / in managewishlist) Tpl:
one square = "exclusive button ajax_add_to_cart_button add-to-cart-in-wl" href = "{$ link - & gt; GetPageLink ('cart', true, zero, "Qty = {$ product.quantity | intval} & amp; id_product = {$ product.id_product | intval} and add"). Escape: 'html': 'UTF-8'} "data-id-attribute =" {$ product.id_product_attribute} "data-id-product =" {$ product.id_product | Intval} "data-min_name =" {$ product.quantity | Intl} "title =" {ls = 'add to cart' mod = 'blockwishlist'} "& gt; & lt; span & gt; {ls = 'Add to cart' mod = 'blockwishlist'}} & lt; / Span & gt; & lt; / a & gt;
and you need to change the code in the file theme / your_template / js / modules / blockcart / ajax-cart.js An element clicks the event at ".ajax_add_to_cart_button".:
$ (document) .off ('click', '.ajax_add_to_cart_button'). 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 Min Q Uantity = parseInt ($ (this) .data ('minimum_quality')), if ($ (this) .is ('add-to-cart-in-wl')) {quan = $ (this) .closest ( '.product_infos'). If ($ (this) .prop ('disabled') ('.wishlist_product_detail input.form-control'). Val (); if (quan! = MinimalQuantity) Minimum Quantity = quan;} If (! Minimum quantity) minimum value = 1; ! = 'Disabled') ajaxCart.add (idProduct, idProductAttribute, incorrect, this, least quantity););
Comments
Post a Comment