Use this tag for questions related to WooCommerce hooks. Hooks essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.
Questions tagged [hook-woocommerce]
3266 questions
62
votes
3 answers
WooCommerce - Remove downloads from menu in my account page
I would like to remove downloads menu from my account page.
How can I do this? Is it any hook to remove a specific item from the menu?
Thanks.

techiva.blogspot.com
- 1,170
- 3
- 17
- 37
36
votes
1 answer
WooCommerce action hooks and overriding templates
I have started to learn how to create templates with WooCommerce and I had faced with a little problem. For instance, in the php file content-single-product.php of Woocommerce plugin I have strings like that:

Dmitry Shulga
- 588
- 1
- 6
- 19
26
votes
4 answers
Sorry, no products matched your selection. Please choose a different combination WooCommerce
I have changed dropdown to radio button using wc-variations-radio-buttons-master
The different color is also actually radio button.
The current link product have 12 such variation which have product and not other. Some combination I can explain…

Sajid anwar
- 1,194
- 14
- 41
24
votes
1 answer
Add custom field to shipping zone form - Woocommerce
I am trying to add a select field to Woocommerce Shipping tab and to Shipping Zones section of it while creating a new shipping zone. I found this on official documentation of Woocommerce while searching for the solution.
What I've tried so far…

rmalviya
- 1,847
- 12
- 39
24
votes
3 answers
Adding custom field to product category
How can I add custom fields to product category? I have added custom field to product but I can't find any extension which provide facility to add custom field to product category.

Vidhi
- 2,026
- 2
- 20
- 31
17
votes
5 answers
How to add Custom Description field in Shipping methods (Backend)
I want to add a custom field in Shipping Zone page under shipping method, it will be a text input, the user will able to add a custom message and I'll show that message in the front end.
I noticed it saves the data in…

Raunak Gupta
- 10,412
- 3
- 58
- 97
17
votes
8 answers
Woocommerce: Which hook to replace deprecated "woocommerce_add_order_item_meta"
Need to add custom meta to order items. Googled it and most articles says to use "woocommerce_add_order_item_meta" hook. This hook is deprecated in the newest version 2.3.7. Someone, please tell me which hook to use…

user3339988
- 404
- 2
- 5
- 12
16
votes
1 answer
Remove the reset variation button on WooCommerce variable products
On variable products, I would like to remove the reset variation button that appears on my WooCommerce product page when selecting variations (ex. Size, colour), that allows to reset all the choices that have been made.
This pop-up, even when not…

Olivier Chambault
- 161
- 1
- 1
- 3
14
votes
5 answers
Delete a product by ID using PHP in WooCommerce
Since there is a command:
wp_insert_post()
shouldn't there be a command:
wp_delete_post()
Seems like it does not exist, what is an alternative that you use when you have the ID of a product in the database and you want to delete it?

dimitrisr
- 185
- 1
- 1
- 6
14
votes
3 answers
Change WooCommerce default password security level
I am trying to change the WooCommerce Registration form minimum password strength and I am unable to do much.
Can anyone please share a solution by which I can amend the minimum password strength and allow users to user a password that's 7…

Husnain Abbas
- 159
- 1
- 1
- 10
12
votes
1 answer
How to create multiple simple-products with same SKU in WooCommerce?
I want to create multiple simple-product with same SKU in WooCommerce.
I search in admin settings but there I cannot find any settings to enable this features. Is there any hook so I can disable this features.

dineshkashera
- 1,442
- 1
- 15
- 26
12
votes
3 answers
WooCommerce: Check if coupon is valid
I am trying to check if a coupon is still valid (hasn't reached its usage limit) and display content under this condition.
The reason for this is that I want to be able to hand out a coupon code to particular visitors, but obviously don't want to…

NuclearApe
- 573
- 2
- 6
- 16
11
votes
1 answer
Add custom content to WooCommerce product description
I'm trying to inject some text in my description ending.
Is it possible with filter?
Or do i need to do this via child theme?
Been trying to find the hook for description but can only find one for short description.
Example:
This is a description.…

Oscar vs
- 376
- 2
- 4
- 17
11
votes
2 answers
Can I modify WooCommerce functions within the 'wc-template-functions.php' file or should I stick with the 'functions.php' file for such modifications?
Why is it the preferred choice, to have WooCommerce function modifications placed inside the theme's 'function.php' file? Overtime, this would make the file rather large. I am of the understanding that it is generally better practice to have lots…

Craig
- 1,872
- 5
- 23
- 56
10
votes
2 answers
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+
The new statuses are:
Preorder
Contact us
function add_custom_stock_type() {
?>