I want to prevent users from adding products from different categories into cart at once. Say if the user navigates to another categories and tries to add product to cart, they get the cart cleared out first. Please anybody know how i might approach this? I am a newbie at things like this. Thanks Answer I’ve solved this before. My
Tag: woocommerce
how to delete completed orders in woocommerce using a my sql query
I want to delete completed all orders in woocommerce by using a single my sql query. Because, I’m having a problem with my WordPress Dashboard. I can’t view the completed orders from the back-end. It’…
If cart is empty, the cart page will redirect to shop page in WooCommerce?
In WooCommerce, I want to redirect the cart page to shop page when the cart page is empty otherwise shows the cart page. Can anyone have the solution ? Here is the code I have tried, but it does not …
How to modify woocommerce_before_cart action
I’m trying to make my woocommerce cart template display as a full 12 column layout. The existing layout is using bootstrap’s col-sm-8 column. I need to change it to col-sm-12. I checked out the relevant woo-templates shown here, and copied the cart.php template into my theme to override. However, it looks like I need to modify the woocommerce_before_cart action to
woocommerce get list of attribute values
I’m using woocommerce on wordpress to create a simple shop site and I’ve added a couple attributes to a product. These are namely, size and color. Under size I have a variety of values including Small, Medium and Large. Same with color ie. Red, Blue, Green. What I want to do is show these values in a dropdown. Basically just
Refer to specific product ID in WordPress / WooCommerce in PHP
I have this script that adds a download button to every product page in WooCommerce but I need to exclude a product page from having the download button. I tried changing the first line to but it is failing, I think I am on the right track but need to reference it correctly (It should only enter the if function
Merging a general wordpress search with a woocommerce product search?
I am using the following two codes to generate a wordpress search and a woo commerce product search? Is there a code to merge theme into one search bar doing both functions? <?php …
Get custom product attributes in Woocommerce
In Woocommerce, I am trying to get product custom attribute values but I fail miserably and I don’t get anything. So I tried: And I’m getting this raw data: I know that there is a value because it is shown in the attribute section, but I just can’t find a way to get it displayed with my custom code. Answer
WooCommerce return product object by id
I am creating a custom theme for woocommerce and I need to be able to create a mini product display. I am having problems finding documentation on the woocommerce api. I have a comma delimited list of product IDs that I need to iterate through and display a custom mini product display for each in sequence. Any help would be