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!
Related
Is it possible that Woocommerce category should not delete if it has product. I am facing this issue and I know it can possible but how this is possible.
No There is no option like you are asking we need to create by doing custom code because in backend if you go and press delete button on category it will deleted you need to add php code to restrict that if this category has product not allow to delete...
My Question is to automatically make all the products set to bookable using Woocommerce Booking Extension by Woothemes. I just purchased this expensive plugin but i want to make ALL products bookable since all my products are already bookable. I need to set them all at one, instead of going through each product and set it manually. This is because we have lots of products in this business and going through product one by one would take time.
If you are a developer its easy for you to code the to make the products bookable whenever a new product is create( In this case the code from this link would be useful for you).
Or else add a new bulk action to woocommerce saying 'Make Bookable' , here you will get all the selected product's ids and for the same you have to check and create bookings.
I am new to WordPress and since I created one e-commerce store using woocommerce plugin.
There is some page created by woocommerce plugin called cart, account, checkout, etc.
I already created store and its working fine when I place order for any product with some quantity suppose it is 5 each of $5 and I am going to cart page it is showing total ammount of $25.
but in cart page when I change the quantity of product the total amount is not changing.
So, please somebody help me how I can solve this, I want that instant change in total amount on quantity changing in cart page.
It should be a bug,don't try to write custome code on the plugin here are steps that you can follow :
try to deactivate all plugins.
If not fixed , try to change your current theme.
The last solution is to try new installation of WP And WooCommerce.
I want to add 3 checkboxes to the product page which are product options such as assembly, gift wrap & accessories. I want these to be assigned to the single product.
For example if i'm on a single product page underneath add to cart the customer can check these options.
I know of add_to_cart() but that adds single products to cart i want these options to be linked to the current product?
What is the correct way of doing this? at the moment i can't update woocommerce, so the plugins that accomplish this use functions not available in woocommerce 2.0
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