js ajax function call – WooCommerce Product Add-ons
-
Hello, I’m trying for weeks to find o solution for my problem. This is the closest I get. I want to use woocommerce ajax call but is not working with the WooCommerce Product Add-ons or I don’t do it right. The product is added to cart but i have error on cart page because my input variation field is required so is not working with out it.
Can you tell me what i need to add in the data so when i run the javascript function its added with the product add-ons field.This is from network, i have no idea how to make a payload like by ajax
------WebKitFormBoundaryUlx95mk8GtLIn8He Content-Disposition: form-data; name="addon-101513[brand]" AEG ------WebKitFormBoundaryUlx95mk8GtLIn8He Content-Disposition: form-data; name="addon-101513[model]" 9050 ------WebKitFormBoundaryUlx95mk8GtLIn8He Content-Disposition: form-data; name="add-to-cart" 101513 ------WebKitFormBoundaryUlx95mk8GtLIn8He--
This code is copyed from product page.
<form class="cart" method="post" enctype="multipart/form-data"> <div class="required-product-addon product-addon product-addon-"> <h3 class="addon-name">. <abbr class="required" title="required">*</abbr></h3> <p class="form-row form-row-wide addon-wrap-101513 brand "> <label>Brand </label> <input type="text" class="input-text addon addon-custom" data-price="" name="addon-101513[brand]" value="" disabled=""> </p> <p class="form-row form-row-wide addon-wrap-101513 model "> <label>Model </label> <input type="text" class="input-text addon addon-custom" data-price="" name="addon-101513[model]" value="" disabled=""> </p> <div class="clear"></div> </div><div id="product-addons-total" data-type="simple" data-price="0.5"></div> <input type="hidden" name="add-to-cart" value="101513"> <button type="submit" class="single_add_to_cart_button button alt">Add to cart</button> </form>
https://www.ads-software.com/plugins/woocommerce-ajax-add-to-cart-for-variable-products/
- The topic ‘js ajax function call – WooCommerce Product Add-ons’ is closed to new replies.