I am showing the product categories on the WooCommerce thank you page using this piece of code: The code above shows all categories, but I need to hide a specific category. Is it possible to hide a specific category by ID in the above code? Answer Woocommerce uses main get_categories() function from Wordpress core. You can exclude any categories with
Tag: woocommerce
WooCommerce Update Group product attributes by child products
HOOK: Add child product attributes values to group product on saving The above code will update the pa_bedrooms attribute on the Group product on the update, not on the first creation. Can anyone tell me what I am missing here? Answer
Why are the products not shown?
The category id is delivered, but it is not clear to me why the products of this selected category are not displayed Answer Try this – Category IDs should be integer
Transition of Woocommerce Percentage Review Chart to Numeric
On my website’s homepage, I use a chart that counts all Woocommerce reviews. These reviews are shown as a percentage for each rating (1 star, 2 star etc …). I need to change functionality to the total number of ratings for each rating section instead of the percentage and display stars instead of labels. Any advice? Now: Goal: Code of
PHP modify fetched variable and return to frontend for JS
Im fetching Product Attributes from Woocommerce, and echo them out in a script tag as variable to use with javascript in frontend. This might be a bad practice, feel free to enlighten me. Example: Product Attributes: Total height: 43m Total length: 55m PHP queries “Total-height” as Attribute Name and “43m” as Attribute Value. PHP replaces empty space with “-“. I
Split discount (coupon) row into multiple deducted cost rows in WooCommerce order totals table
If there are 2 discount coupons used, it shows the sum of 2 coupons in the Woocommerce order totals table, while I want to show the deducted cost of each coupon separately. For example, 2 coupons are inserted, currently it shows: coupon : $100 I want to change this to: coupon1(coupon code) : $50 coupon2(coupon code) : $50 Path from
Add product category in woocommerce archive/shop page
I’m trying to add the product category inside the product card in the woocommerce archive page. Right now it shows “Thumbnail” “Title” “Price” and “Add to cart button”. I’m using this function which should work if the variable “product” is set to the current product displayed. My Question: Is there a way to get the queried Product in this variable?
How to fix php shortcode to show woocommerce download button
I am trying to view the download button belonging to the last order placed by a customer. Basically I have this code. It worked for other things like: displaying the purchase date, order total, product name etc, but it doesn’t work with the downlad. return $last_order->get_downloadable_items(); it shows the word array instead of the download button. Could someone tell me
Show related products by attribute and products that have stock
The code below displays related products based on attributes and works fine. Unfortunately, products that are out of stock are also displayed. I tried to add this But it didn’t work. Does anyone know how to make the products displayed are products with available stock only? Any help is greatly appreciated, Thank You Answer You were starting on the right
Disable default country in WooCommerce if geolocation fails
WooCommerce has settings for what the default country should be for customer. It can be disabled, set to shop address country, or set by geolocation. My issue is that when using the geolocation option, if that fails to return a country that’s permissible on the store, it will now revert to using the shop address country. What I would like