I’ve found the following example (WooCommerce: Add product to cart with price override?) which lets the user add a product to the cart. However, it hard codes the prices directly on the cart itself.
Is there a way to make adjustments to a product instance i.e. costs, append additional user input, etc. and then add the product to the cart?
Thank you very much for everyones help.
Having another crack at explaining, as doublesharp has pointed out it’s not quite clear.
Joe clicks on a product, he then chooses various options on the product form which then calculates a custom cost after the ‘add to cart’ button is clicked but before it is added to the cart.
These options need to be completely custom as the calculations involved are outside of scope of a woocommerce ‘variable product’. What I’m trying to achieve is the customer being able to add multiple instances of the same product with various costs and info associated with it.
With regards to the first part of your question where you want to add multiple instances of a product with various costs, you can have a look at the following plugins to achieve that objective
As for the second part of your question where you want to append additional user input to the cart. This can be done using the following steps
Create a custom session and add the custom data to this session.
Add the data from the custom session to the WooCommerce session.
Extract custom data from WooCommerce session and insert it into cart
Display custom data in Cart and Checkout page.
Add custom data as metadata to the order items.
Remove the associated custom data if an item is removed from the
For a more detailed on the above steps you have a look at the following link,
How to Add Custom Data to WooCommerce Order