WooCommerce: Override product info before adding to cart - wordpress

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.
Edit:
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
Dynamic Pricing
Pricing Deals for WooCommerce
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
object.
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
cart.
For a more detailed on the above steps you have a look at the following link,
How to Add Custom Data to WooCommerce Order

Related

Is it possible to field map wpforms data to woocommerce products and add the items to cart?

I am using wpforms elite (with webhooks) in hopes to simplify the order process for woocommerce customers.
When a user submits the form at this url, http://implantlogic.wpengine.com/device-selection/ I hope to have products added to the cart based on users selections.
For example, if the user selects tooth one on the tooth selection page of the form, this product will need to be added to the cart with all fields populated http://implantlogic.wpengine.com/product/tooth-1/ and this applies to other things the user selects on the form as well which would trigger simple field mapping or the addition of simple products to the cart.
Right now I just need to know if this is possible or if I should seek other methods to solve this issue and create the same experience.

Time for category add to cart in WooCommerce

I used this code Time based Enable/Disable Add to Cart in Woocommerce
to close my store based on time setting.
How can make this code work for certain category only and not show message in all pages?

Creating a form with will fill up checkout and cart details on woocommerce

i would like to create a form in which after a client fills in the form and mentions how many units of a product (for example soft toys) he would like, then we could proceed into checkout where he can make the payment.
its basically going to be a random selection page, given that all toys are the same price. If someone goes into the page and fills the form he can select how many he wants and put in his or her details then we will proceed to payment.
I am using wordpress and woocommerce.

Wordpress Woocommerce: Set quantity BEFORE add to cart

What I want to do is have a dropdown/text box for quantity before the user clicks add to cart.
My goal is to have the quantity already set when the product goes into the cart; the user cannot modify the quantity of a product already in the cart for certain reasons (business process).
Woocommerce add_to_cart_url() only takes the product ID.
Does anyone have any experience in doing something similar to this?
You will need to create an override folder hierarchy within wp-content/themes/YOUR-THEME/woocommerce/loop/add-to-cart.php.
You can find more details here. It works perfectly.
Thanks!

woocommerce add_to_cart

When I program:
$woocommerce->cart->add_to_cart( $group_product_id, 1);
with $group_product_id being the product post ID (e.g. 300), the shopping cart shows a quantity of 2 not 1.
When I directly enter the URL (e.g.http://www.mystore.com/shop/stuff?add_to_cart=300), the shopping cart shows a quantity of 1 (the correct expected behavior).
Any suggestions would be really helpful.
Thank you.
P.S. Bonus question: is there any way to program adding multiple items to the cart (not grouped or variations) before taking the user to the cart page?
Grouped products cannot be added to cart directly. Group product is actually a group of simple products. So $group_product_id should be the id of any of the simple products which constitute the grouped product.
The first two parameters you must use on $woocommerce->cart->add_to_cart, are, $product->id and/or quantity to add. The post id has nothing to do here.
You can yes add multiple products at once using ajax calls, but is not so simple to describe on a comment, will depend on your configuration, your theme, etc, but yes, it´s posible, in fact i recently did something like that. The point is to use syncronized ajax calls that actualy call the add_to_cart function. You can use jquery for triggering many add to cart buttons at same time.

Resources