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.

"b" - & gt; GetPageLink ('cart', false, tap, "add = 1 and id_product = {$ product.id_product | intval} & amp; volume = {$ product.quantity}", false). 'Html': 'UTF-8'} "rel =" nofollow "title =" {ls = 'Add to Cart'} "Data-id-product =" {$ product.id_product | Intval} "onclick =" wishlist product management ('' $ {product_id} ) .val (), $ ('# priority_ {$ product.id_product} _ {$ product.id_product_attribute}'). Val ()); "& Gt; & lt; span & gt; {ls = 'add to cart'}

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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -