hide products from users who are not logged in (using tags)?

Pretty simple concept... I want to hide all products that have the tag "Wholesale" from everywhere in WooCommerce if the user is not logged in... I have gotten close, but no dice just yet. What I...

woocommerce_order_status_completed not triggered

I want to write a custom plugin that does some action after woocommerce order is completed, but I can't get this hook to work. I can see this question asked many times. Like here:...

Woocommerce REST API get products by attributes

Using the woocommerce v3 API, I want to filter/get products by attributes. For example: www.mydomain.com/products?filter[pa_color]=green&fields=id,attributes How can I hook/modify the API so it...

Woocommerce Cash On Delivery Add Custom Field

How can I add a custom textarea field right below cah on delivery so when you click on the cash on delivery radio button a textarea appears to enter details that get saved into the order?

How do I return only image src from "woocommerce_get_product_thumbnail()"?

echo woocommerce_get_product_thumbnail(); That output the whole image tag. How can I get only the image source? Same problems solution with just WordPress: How do I get image url only on...

Woocommerce added to cart hook (after the product was successfully added to cart)

I need a hook that fires after a product was added to cart. Something like a "woocommerce_add_to_cart" successful callback. I imagine it would be something like "woocommerce_added_to_cart", but...

Woocommerce API Read Only On Products

I want to give a user ability only to view (read) products using the Woocommerce API only. I have looked everywhere and although there are role "permissions" for read_product, it doesn't seem to...

set Woocommerce brand image as product placeholder image

I want to show woocommerce brand image as default product image if there is no image assigned to the product. for example, Suppose a product of assigned with amazon store don't have an image by...

Adding Extra Add to cart button below product summary in Woocommerce

In WooCommerce, I am trying to add an extra add to cart button below product summary. I successfully added an extra button following this code which works for single products: add_action(...

Add custom content for a specific product on WooCommerce single product pages

In Woocommerce, How can I add a custom content for a specific product on single product pages? Here is an explicit screen shot:

Hide “free trial” text from Woocommerce Subscriptions price but keep the Sign-Up Fee

The first part of the question (Hide the “free trial” text from Woocommerce Subscriptions price) was answered in this awesome...

Display a custom taxonomy in Woocommerce single product pages

I have added a new taxonomy called "Vendor" to Woocommerce with the following code: // hook into the init action and call taxonomy when it fires add_action( 'init', 'create_vendor_taxonomy', 0...

Add the product image to Woocommerce my account order view

I would like to add image on my account view order pages in Woocommerce.some one I am able to get the image but the size is too large and I don't know where I need to add this code: <?php //...

Display custom checkout field value on admin order detail section in Woocommerce

Hello I'm trying to display the custom checkout field in the admin order details page. My Custom field is Delivery Option and it allows the user to pick the to pick a value from checkbox. I use...

Woocommerce Subscriptions get next payment date when subscription is renewed

I’m using Woocommerce Subscriptions plugin in my Woocommerce site. I want to post the new renewal date for a subscription to an external API when a subscription is renewed. I’m trying to use...

Woocommerce: Translate/change order item meta key before output

There's an action called 'woocommerce_checkout_create_order_line_item' where you can use the method 'add_meta_data(meta_key, meta_value)' to add meta data to the order item. Every example did use...

How to display item meta data in email confirmation using woocommerce_order_item_meta_end

Our store sells software and we're adding a software voucher code to each purchased. Once the purchase is completed (via the woocommerce_payment_complete hook) we generate the voucher code and add...

woocommerce_update_product action – fire only once for every product update

Which workaround is there for making the woocommerce_update_product action fire only once? I've read that it fires twice because it needs to save once internally to retrieve an ID for...

Add a new custom field to WooCommerce checkout and display on admin order pages and email notifications

I have the code that should work, but for some reason it doesnt. I want to add a new custom field called "City" under Woocommerce checkout, using this code: // Display a custom checkout select...

$order get transaction id empty woocommerce

Hi I'm currently developing a plugin for woo-commerce payment gateway I need help to access transaction id on process payment function based on documentation to get transaction id by using this...

Create a webhook programmatically in wordpress/woocommerce

i'm making a Plugin to make a integration of one ERP to Woocommerce and i'm thinking about using the web hooks for that integration, the problem create the web hooks when the plugin is activated...

How to display the product weight in kg, if more than 1000 grams

In Storefront theme, I use the code below that change the formatted weight from 1000g to 1kg: add_action('woocommerce_after_shop_loop_item_title', 'show_weight', 10); function show_weight() { ...

How to add custom stock status to products in WooCommerce 4+

I am using the following code to add new stock statuses in WooCommerce 4.0. The new statuses are: Preorder Contact us function add_custom_stock_type() { ?> <script...

Switch product image on hover on WooCommerce archive page

Is there a way (maybe via functions.php) to change the product-image in woocommerce shops (archive page) on hover with the first attached gallery image of the product? I cannot find how to target...

Hide woocommerce orders page learn more button

When orders page is empty there is a button that is **learn more about orders button ** also another button in coupons button .. we need a way to hide this button is there is a hook or something...

Updating Google Sheet with WooCommerce Order

I need to be able to automatically update a google sheet file every time an order is placed through WooCommerce. I've found the solution below, but using this each individual item ordered is...

Replace zero cost to "Free" from WooCommerce shipping method full label

To display the shipping cost when it's equal to zero I am using the following code (because woocommerce hide zero cost for shipping methods): add_filter(...

Change some strings and substrings in Woocommerce using gettext hook

The code I used over the years (example below) hasn't worked for awhile. Tried some other code posted on here, but no joy. It seems WC has changed how to filter/translate and each text changed...

Change position of all coupon code related WooCommerce messages at checkout

I would like to change the position of all the coupon code related WooCommerce messages in the checkout page. I have successfully moved the coupon code form from its original position (top of the...

How to change product Image when variables are selected in Shop and Archive Pages?

I use this hook to show variations on the shop page. However, the product image does not change when a variable is selected. It works on a Single product page. New to WordPress and PHP, I have...