Questions tagged [hook-woocommerce]

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

WooCommerce - Calculate Tax Before Applying Coupons

I'm working on a WooCommerce project, and I need to calculate taxes based on the original price of products before applying any coupons (discounts). Currently, the default behavior is that taxes are ...
Henri Bunt's user avatar
0 votes
0 answers
15 views

Display the product attribute "color" count for a Woocommerce variable product(Total Numbers of Colors Available)

I have some simple products and several Variable products with size and or color variants. On the products that are offered in various colors I would like to show on Product Page, how many color ...
Abhishek Sharma's user avatar
-3 votes
0 answers
25 views

Non-updating and inactive payment gateway and shipping type selection elements on the WooCommerce checkout page

There is a WordPress site built with WooCommerce, but we recently encountered a strange problem on this page, and that is WooCommerce does not update, and the payment page always looks like this. I ...
pasra's user avatar
  • 1
0 votes
0 answers
14 views

WooCommerce Configure the Product List Display [duplicate]

I am trying to figure out a way to display the information of the products differently, but not to sort them on this matter. Currently, it is showing first product name then product price and last it ...
Digital Shield's user avatar
-3 votes
0 answers
13 views

I am unable to view revenue in my woocommerce app even though I got sales [closed]

The woocommerce app says revenue as $0 for the day, week and month even though there are sales coming in. It used to work find earlier. What can be the possible issue ?
user3467773's user avatar
0 votes
1 answer
54 views

Show all available variations on archive pages with a button linked to WooCommerce single product

In WooCommerce, I want to show all available variations of a product in shop and archive page as separate products, so that user can see all available color options without going to details page. i ...
Harish Ksoft's user avatar
-2 votes
0 answers
22 views

Dynamic WooCommerce Price Based on Zip Code

I'm working on a WooCommerce-based e-commerce website, and I have a specific pricing requirement. I need to adjust product prices dynamically based on the customer's zip code before they can add items ...
MD SOBUZ CHANDAR's user avatar
-2 votes
1 answer
32 views

How to make woocommerce settings from loop [closed]

I'm making a woocommerce plugin where you can turn the plugin on or off for certain gateways. The issue I'm having is that since I'm using a for loop to create the settings. They reset everytime I ...
KalebSmith's user avatar
-3 votes
0 answers
18 views

woocommerce variable drop down replace with input field

I want to replace WooCommerce variable drop down with an input field system. For example I have variable for a product "red", "black", "pink". Now it shows as dropdown ...
sobuz islam's user avatar
2 votes
1 answer
35 views

Conditionally make Postcode Checkout Field required except for specific country in WooCommerce

I want to make a WooCommerce Postcode Checkout Field that only required when the country is not saudi Arabia . This field should only be required when the customer chose a country other then saudi ...
shareef alfahmi's user avatar
0 votes
0 answers
24 views

Show WooCommerce short description/excerpt but not in mega menu

I have code in my child theme functions.php that shows the WooCommerce product short description or excerpt on category pages, but I have products in my 'mega' menu and the short description is also ...
ColossalYouth's user avatar
-1 votes
0 answers
9 views

Woocommerce - add Admin field to record check numbers

I'd like to add a field within the Admin page to record the check numbers used when customers pay by check. Ideally, this field would also display on the Orders page after it's been entered (by a ...
userA's user avatar
  • 1
0 votes
1 answer
22 views

How to access Settings array for Woocommerce plugins?

So I've been having a lot of trouble developing plugins for Woocommerce. Idk if I suck at reading documentation or just that barely any exists. How do I actually access the values in this settings ...
KalebSmith's user avatar
1 vote
1 answer
49 views

Increase product stock on custom order status in WooCommerce

So. I'm trying to create a new order status with PHP, I need that new status to increase the stock of the product that are list in that order, when I do it, it doesn't work, never change anything, ...
Pri's user avatar
  • 13
-1 votes
0 answers
18 views

Change the Thank you message on Woocommerce Order received page

Since a recent Wocoommerce update, the solution in this question The message is shown after default message, and the html code is also shown. message shown on thank you page I am not any php guru. ...
Anders's user avatar
  • 1
0 votes
0 answers
14 views

How to access order actions present in edit order page from custom plugin in woocommerce [duplicate]

I am creating the custom woocommerce plugin for a accessing the order actions present in edit order page. Image attach please have a look. I am trying to trigger these order status actions via custom ...
Siddharth's user avatar
-3 votes
0 answers
23 views

Set minimum price of product in woocommerce

I got a problem. Few days ago I commited a mistake, I saved a product in my ecommerce with the price of $1 and someone noticed it, so, I had to sell it at that price (outch). And I'm wondering if ...
AlanJR24's user avatar
0 votes
1 answer
25 views

How to display Percent instead of Sale on Woocommerce Product Tag Box

My home page contains a woocommerce product tag box. I tried to change the sale button so that percent appears instead. I work with Astra Theme. I have tried Display the default discounted price and ...
Marianne's user avatar
2 votes
1 answer
46 views

Alter Woocommerce product name when price is on sale

We use "NET" to identify products that are on sale. I have written the following code to automatically add or remove NET to/from products as they go on or off sale. function ...
AlexTSF's user avatar
  • 125
0 votes
1 answer
27 views

Changing tax rate on certain cart items in Woocommerce

I am inserting a control in the Wocommerce cart which, based on certain properties of the user and the inserted item, modifies the tax rate for that specific item. The code I'm using, inside a plugin, ...
Alberto Bairati's user avatar
0 votes
1 answer
27 views

how to convert woocommerce product category to woocommerce product attribute - no plugin i wanna do this programicality

I have a WordPress site and I use the WooCommerce plugin, I created a product category called Brand and placed the brands in my store under this category. But now I realized that it is better to ...
MahmoodZamaniNemati's user avatar
2 votes
1 answer
27 views

Remove Totals section from WooCommerce Cart while keeping Subtotal line

I've found some code from here: How to remove order total from cart and checkout page woocommerce that will let me remove the entire 'Cart Totals' block from my cart page: //removal of 'Total' block ...
Tetra84's user avatar
  • 23
-1 votes
0 answers
24 views

Display specific data in a custom column on Woocommerce admin Product list

I'm customizing WooCommerce admin product list. My goal is to remove certain columns and add several custom field columns. I have been able to remove successfully some columns. I trying to add a new ...
Ankit Prajapati's user avatar
1 vote
2 answers
60 views

Is it possible to use hooks in gutenberg blocks?

In my home page use gutenberg blocks (WooCommerce Products Recents), works fine. But I need add some text itens on title of products. When using WooCommerce shortcodes, works fine but not work when ...
John Henrique's user avatar
1 vote
2 answers
61 views

Update Woocommerce Product Description from Quick Edit

I'm adding some features to the quck edit area of wordpress. I have everything working except updating post_content. I am able to update the meta values using update_post_meta, but the method I'm ...
AlexTSF's user avatar
  • 125
0 votes
0 answers
20 views

How to change the position of the product video on the single product page on WooCommerce

I'm using the old WooCommerce method to place the product video on the Single Product Page next to the product image gallery. The hook below is being used on the functions.php page add_action('...
Paulo do Porto's user avatar
-2 votes
0 answers
12 views

How to change woocommerce lost password default redirection after submit [duplicate]

I hope someone can help me about this, i want to change the redirection after submit WooCommerce forget password to other page. Like home or login page. Currently, it will redirect to WooCommerce My ...
Charles Austine Velasco's user avatar
-2 votes
0 answers
38 views

How to add custom checkout fee reports in Woocommerce Analytics

I'm trying to get reports for tips that customers are able to add to their orders. Currently Woocommerce analytics does not break this down individually, and just lumps them into net sales. You can ...
TryingHermosa17's user avatar
1 vote
2 answers
61 views

Update dynamically custom content on WooCommerce update checkout event

class CheckoutTax { public function __construct() { // add a note after the order details, when a tax is charged and country changes // the html snippet is shown ...
Fritz Herbers's user avatar
0 votes
0 answers
9 views

I need to save a booking id returning from an external api in meta data field but add action do action and filter where to place these to call please

I want to add a function with filter but i dont know what to pass add_filter what i read it needs 4 arguments is there anything fixed to pass this function please help Please help i am super confused ...
Sahar Ali's user avatar
2 votes
1 answer
38 views

When and where woocommerce_order_status_completed_notification hook is executed in WooCommerce?

I have WooCommerce 8.0.3 installed on my e-shop. In short, let's say I have an order with ID 123 in status processing. In a specific situation, I'm running this code: // Make sure e-mails are ...
Pavel Vybíral's user avatar
0 votes
0 answers
9 views

hide button for specific product(s)

All items on my woocommerce shop have this button: <a class="button e-custom-product " onclick="return loadProductDesign(this);" data-product_id="108" href="https:...
Jason Dana's user avatar
0 votes
0 answers
27 views

How to change order status after form submission in WooCommerce

I am using the "Forminator" form plugin to handle refund requests for WooCommerce orders with the following snippet: add_filter( 'woocommerce_my_account_my_orders_actions', '...
Adam's user avatar
  • 1
2 votes
1 answer
54 views

woocommerce_available_payment_gateways filter hook triggered multiple times

For some reason when I run the woocommerce_available_payment_gateways filter it runs twice on the checkout page as a test I make it echo 123123 on the checkout page and it shows 1231235555 (which is ...
needsumhelp's user avatar
1 vote
1 answer
50 views

Enable WooCommerce My account Payment Methods allowing Customer To Add a Payment Method

I am trying to allow the customer to add a payment method just like he or she can edit their address and everything else. So, I added this code to the My account => Payment Methods. But when ...
Learning WooStoreFront's user avatar
2 votes
1 answer
51 views

Reset order date paid for a custom order status in WooCommerce

The following answer code is not working, as I use the custom order status pre-ordered: Change admin payment status back to unpaid for pending order status in Woocommerce All my products are pre-...
Joost van Ginneken's user avatar
1 vote
1 answer
48 views

Save product "custom fields" values using woocommerce_checkout_create_order_line_item hook

I was trying to set WooCommerce product price dynamically using user inputted values in custom fields in product page. Everything works fine except, I cannot show the custom fields data into admin ...
mRashid's user avatar
  • 23
1 vote
1 answer
40 views

Add products per page filter in WooCommerce Product archives

I have set the main shop page via WooCommerce settings, right? You can choose only one main shop page. Additionally, I have created another simple page using Elementor (both were created using ...
legalpsyxo's user avatar
0 votes
0 answers
66 views

Get Total Subtotal for products in 1 specific category in WooCommerce

I'm trying to use this code to get the subtotal for a specific category shoes and replace the default subtotal as i don't want to include subtotals from products in other categories. function ...
Sam's user avatar
  • 587
0 votes
0 answers
44 views

Set Cart Total for a defined product Category in WooCommerce

I need to get the total cart price by product category, minus any products which aren't in the specific category on the cart page so just the subtotal for a specific category. add_filter( '...
Sam's user avatar
  • 587
-1 votes
0 answers
41 views

Issue when using woocommerce_checkout_process hook in WooCommerce

I need some help. I have a plugin on WooCommerce to create referral discount and I want to apply the discount to: add_action('woocommerce_checkout_process', 'save_referral_code_to_order'); But it ...
johndoe's user avatar
1 vote
1 answer
64 views

How to Combine Different Woocommerce Fees into One Name?

I'm setting up California Redemption value fees for my site. The code that I have found on here works, however I would like for the different fees to be combined under the same name, which would just ...
TryingHermosa17's user avatar
2 votes
1 answer
46 views

Add a filter by date to My Account Orders in WooCommerce

Here is the Function, which enables me to create filter by date fields for WooCommerce orders in frontend (MY ACCOUNT). It's working, but when I choose date when there are no orders, Filter fields ...
Gelebrin7's user avatar
1 vote
1 answer
40 views

Woocommerce Force Guest Users to Register on a Specific Gateway

I am using following code for auto register on guest user checkout. However, my "Specific Gateway" after successfully payment will not redirect to the woocommerce thankyou page, so this code ...
goomember's user avatar
0 votes
1 answer
55 views

Add a button linked to the order received Url in WooCommerce Admin Orders list

I'm trying to save the order-received URL in the Admin Area "Order Details Page". According to this article posted 2 years, 7 months ago, it should work, but I followed all the Two Simple ...
Paulo do Porto's user avatar
0 votes
0 answers
9 views

Replace certain woocommerce product names with an image

I'm using this script for add an image near product name title in woocommerce, but i need to edit only some product ids: remove_action('woocommerce_single_product_summary', '...
Andrea Infunti's user avatar
1 vote
1 answer
63 views

Replace WooCommerce Single product short description with custom code

In the code below, I inserted a php block "shop_content" within a WordPress hook. In the output, as it should, the inserted php block shows up before the woocommerce_single_product_summary ...
J82's user avatar
  • 8,277
3 votes
1 answer
63 views

Calculate_totals() triggers early email notification with 0 order total

I'm splitting an order into 2 upon hook woocommerce_order_status_changed by creating a new order and moving order items to it. However the moment calculate_totals() is called, calculate_taxes() will ...
shadryck's user avatar
  • 191
0 votes
1 answer
43 views

How to round Woocommerce cart item (product) subtotal and calculate cart subtotal and total from item subtotal?

I have been conducting extensive research on rounding at the cart item subtotal level, but I have not been able to find a solution. What I want to do is to round the product subtotal after discout ...
Kelvin Winter's user avatar
2 votes
1 answer
56 views

WooCommerce wc_get_related_products function is not working

As a developer, i tried to develop a WooCommerce based plugin. I want to add related product in woocommerce_after_add_to_cart_button hook in single product page: function custom_popup_on_add_to_cart(){...
FERDAUS SK's user avatar

1
2 3 4 5
66