I am working on project and I need some group help. I am using woocommerce product system and on shop archive page product I am showing attribute-label: attribute-value (just like text). attribute-…
Tag: woocommerce
Get orders shipping items details in WooCommerce 3
How can I get the order shipping method id.? For example ‘flate_rate’. Since WooCommerce 3 it is now complicated as everything has changed. I have tried it with $order->get_data() in a foreach loop but the data is protected. Answer If you want to get the Order Items Shipping data, you need first to get them in a foreach loop (for
Set variations default attributes values for a variable product Programmatically
I’m building a site where WooCommerce Variable products (with Products Variations) are inserted programmatically. I have followed this tutorial successfully: Insert WooCommerce Products & Variations Programmatically I need just something that is missing: How to set variations default attributes values for a variable product? Is it possible? Answer 1). You will need to insert in your json data for each
Set WooCommerce order status when order is created from processing to pending
When a woocommerce order is created the status of the order is “processing”. I need to change the default order-status to “pending”. How can I achieve this? Answer The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked function, but it will not work (as this hook is
Show SKU on cart and checkout pages in Woocommerce 3
I would like to display SKU on cart (Under product column ) and checkout page. I searched SO, but all answers are for old versions of WooCommerce and non of them is for 3.x. How can I show SKU on cart and checkout pages in Woocommerce 3? Answer 2021 Update You can do it with a custom unction hooked in
Nested shortcode to dynamically display WooCommerce products category
I am attempting to display a WooCommerce product category page based on the current user role. I have created a custom function get_user_role() to get the user role and added the shortcode [user_role]…
Displaying full product description on product lightbox
Is there a WooCommerce add_action to display the full product description, this is the text found in the main text edit window (not the Product short description) After a quick google search I was …
Unset product tabs for specific product categories in woocommerce
I am using the code coming from this answer: Hiding tabs only for some products in WooCommerce single product pages Here is that code: This code works fine to unset or hide tabs from specific products. Instead I would like to unset or hide tabs from specific product categories. How can I do it for product categories? Answer As the
Conditionally add a subscription when product added to cart in WooCommerce 3
Hi Im looking for a code that adds my subscription ID (2282) to cart if there is added a normal product but NOT if the user is already subscriber. Feel free to ask questions. I’m in the GMT+1 time zone Wordpress – 4.8.1 WooCommerce – 3.1.1 WooCommerce Subscriptions – 2.2.11 WooCommerce Memberships – 1.8.8 Theme – Shopkeeper – 2.2.3 i’ve
Change product prices via a hook in WooCommerce 3+
IN WooCommerce, I need to multiply all product prices by a number. So I have used the following (via a plugin): But, that doesn’t work for variation products. I have tried the following hooks with no luck: The only one that works half way is this one: But that just changed the overall price, not the selected variation price. See