Category "hook-woocommerce"

WooCommerce coupon usage restriction by allowed user roles

we need to make an automatic discount coupon to be applied if the current user role is ( vendor ), we achieved that by creating a normal coupon then used the sn

Add restriction to WooCommerce coupons by allowed user ID

Let's say i'm using this code to create a coupon: $coupon_code = 'CODEOFF'; $amount = '10'; $discount_type = 'percent'; $coupon = array(

Retrieve filled in Add-on data from booking/product

I'm writing a plugin to intercept the creation of bookings in wordpress. To have all the booking information I need to access the information filled in the addo

WooCommerce: how to add suffix to attribute value? [duplicate]

We are building a wine-shop and have a few typical attributes like alcohol, sugar, acid that have values. These attributes are measured in uni

Split a WooCommerce order and create a new order if the original order has products in backorder

I have the custom order status and it works. What I need help with here is looping through the order items and checking if any of them are on backorder and if

Filter WooCommerce related products by Polylang language

I'm using polylang plugin to having multi-languages website. Using WooCommerce with polylang demands duplicating each product for each language, so assuming I h

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.

Get all WooCommerce products within own plugin

Within a plugin how do I get products using wc_get_products()? Or is there another way to do it? if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'a

Don't show recurring price for WooCommerce subscriptions worth 0$

I want to modify the subscription string so it only shows the sign-up fee for variations with 0$ recurring fee. I would also like to show that variation price

WooCommerce single product page by Woolentor : Related product customize

I use WooCommerce, Woolentor, and WooCommerce subscriptions to construct a website. I'm trying to use the 'WL:Related Product' widget for Woolentor's Single Pro

Rearrange (sort by priority) Woocommerce my account fields

How can I rearrange my-account fields .I want to locate billing_address_1 field after billing_state and billing_city fields. I used woocommerce_form_field_args

Display a product custom field only in WooCommerce Admin single orders

This question follows How to show a product custom field (custom SKU) in WooCommerce orders answer to my previous question. How do I make a product custom field

Add customer email and phone in "Order" column to admin orders list on Woocommerce

I am trying to find a way on how to add the customer phone and email below the name on the WooCommerce order view. See picture for reference where I need to ad

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Using the functions below I've applied a custom field to products added in Woocommerce cart and checkout page also to orders and notification email. My questi

Is there a way to direct logging to file instead to stdout?

How could I redirect any logging to files to stdout/err/.. ? (to be specific I have rsyslog going) Basically, I would like what WC_Log_Handler_File produces to

Add rows to Single product Additional information table in WooCommerce 3.6

I am trying to add a row to Single product Additional information table. Actually is there any hooks or filter to do this? I have searched the hook but can'

WooCommerce Subscriptions: Remove role on cancelled subscription

I am using a third-party plugin to assign a role to a user when they purchase a subscription - there are two different roles depending on purchase (silver, gold

Add image caption under image thumbnail in WooCommerce single product page

I'm trying to add the image caption under each image thumbnail on WooCommerce single product page. Here you can see where I want the text to be shown (presently

WooCommerce single product page by Woolentor : Related product customize

I use WooCommerce, Woolentor, and WooCommerce subscriptions to construct a website. I'm trying to use the 'WL:Related Product' widget for Woolentor's Single Pro

Change user role if checkout custom checkbox is checked in WooCommerce

I'm trying to add a custom function to my child-themes functions.php file where a checkbox is added to the bottom of the billing details form on the checkout pa