Custom Product In Woocommerce using Ajax + POST

Job ID: 35442163

Budget: $30 – $250 AUD

Hello! I have a custom woocommerce / wordpress script which generates a unique product each time.
It requires us to pass the product price, description and an image to the checkout cart when ready for checkout.

It uses the one Woocommerce product ID
Use POST /wp-admin/admin-ajax.php to pass the product details to cart.

<input type="hidden" name="price" value="">
<input type="hidden" name="text" value="">
<input type="hidden" name="imagename" value="">

The details of the product are dynamic and are the following items:

var data = {
Text: $('[name=text]').val(),
prices: $('[name=price]').val(),
imgname: $('[name=imagename]').val(),
}

You will be required to provide the code for above to make this works.
It will include the functions.php code and perhaps some for JS and PHP.

Important: I am not able to provide access to the Wordpress website where this is located.
As such, you will need to understand the above requirements and provide the code OR agree to do this locally and be willing to share the site once ready (basic woocommerce template)

Thanks
Related categories: PHP JavaScript AJAX WordPress WooCommerce