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?
Related
I need a solution that reduces the stock level and hide the product from others directly when the product is added to the cart. I have set stock amount to 1 and only allow one purchase of each product.
I´ve tried plugins like WooCommerce Cart Stock Reducer, it does the trick but doesnt hide the product instead it gives me a message that its out of stock.
Help anyone?
From the left side panel in your admin, go to WooCommerce->Settings->Products->Inventory
then check the Hide out of stock items from the catalog option.
You should be good.
I am currently working on a ecommerce site. The word press theme I'm using is Astra. I have a form which calculate the prices for certain products. I want the add to cart button to get the final price from the form. How can I do that? Please help.
I am trying to change the product price in Woocommerce, I know that I can make massive changes by clicking on "Filter" and "Edit" to apply one change to every product. That works fine with simple products, but with variable products that do not happen.
Is there a plugin to make those changes?
I have a single product with variables but I need it to show on a user profile page. I can easily put a sidebar in with best products or popular products but that means it needs another click to get to the product page. So I need the product displayed on a certain page with all the variables showing and add to cart also showing.
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