Category "hook-woocommerce"

Woocommerce shipping address is empty

the option on the site "Default to customer billing address" is selected but the shipping address is still empty. I tried to fix it with code add_action( 'w

Filter WooCommerce products with post__in and additional meta queries

I am trying to find products that are on sale (including product variations) in addition to another meta_query of price under X. The wc_get_product_ids_on_sale(

WooCommerce Additional Information - if empty, hide

I'm working on an eCommerce project at the moment. I'm using WooCommerce in WordPress. I've got ridden of the product data tabs and displayed product descripti

Custom add to cart button URL for specific product in WooCommerce?

I would like the user to be directed to a certain URL when they click the 'add to cart' button. At the moment I have this: /** * Set a custom add to cart URL

Edit product hook WooCommerce

On my product template, I execute this action : <?php /** * woocommerce_single_product_summary hook. * * @hooked woocommerce_template_single

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

I found this posted as a comment on another thread but I don't know what I'm supposed to do with it: if($product->get_stock_quantity() <10){echo 'Limit

How to add a heading in between checkout fields of WooCommerce

I am customizing the WooCommerce checkout page fields. I want to add a heading (text) in between the fields. I have reordered the fields like this add_filter('w

Add free product when a certain coupon is applied in WooCommerce

I can add a product to cart, when a certain coupon is used via the woocommerce_applied_coupon hook and the add_to_cart() function add_action('woocommerce_applie

Add custom CSS class to "add to cart" button on WooCommerce shop and archives pages based on certain condition

I am trying to disable "add to cart" button on WooCommerce shop and archives pages if product's quantity stock is zero or less. I don't want to hide it so I cam