>> The Customer will provide two values prior and based on those values, I have to add the appropriate product to cart directly using Woocommerce hooks WC()->cart->add_to_cart( 1326 )
We are a little bit unclear about your exact requirement. Could you please clarify us with more details?
>> how do I set the value for the additional field manually before adding the product to cart?
The field created using our plugin will be available on the product page. If you want to pre-define the values for the field then you can use the field type “Select”. Also, you can show the field to a particular product by providing a conditional rule for the field based on the product.
>> how do I display this in the Cart and Checkout page? Will the field automatically show up along with the cart information?
Yes, the value selected or provided on the extra product field will display in both cart and checkout.
>> Will it work with Oxygen Builder?
It is compatible with the functionality of the oxygen builder plugin. However, there are few display style issues.
Thank you!
Hi ThemeHigh,
Sorry for the ambiguity. What I mean is, I’ll be using URL params based on the visitor’s activity on the website, and using those URL params I’ll be dynamically placing the order using Woocommerce PHP functions.
So the visitor will never see the Product page. I need to input one of those URL params in the text custom field so that the Addon Field is visible in the Cart, Checkout, and Order page.
I hope that gives some clarity to my question!
You can pass the value as shown below:
?add-to-cart=8&field_name1=field_name1_value&field_name2=field_name2_value&thwepof_product_fields=field_name1,field_name2
You need to pass each field with its value. Then add additional argument thwepof_product_fields whose value equal to the comma-separated field names.
Thank you!
Please ensure that you have checked the option “Allow posting extra options as url parameters” in the plugin’s Advanced Settings tab.
Thank you!
Hi ThemeHigh,
You’ve solved my problem! Thank you for the swift help! This is exactly what I was looking for!