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.
2,951
questions
0
votes
1
answer
15
views
Woocommerce add new filter and new field to orders table in Analytics orders
I need to add two new fields to woocommerce Analytics > Orders page
one filter and column to the orders table
Filter Image
Order Column Image
0
votes
1
answer
15
views
Custom ordering products based on user role
My shop is currently set to sort products by ascending price.
Is there a way I can sort products by custom ordering for a specific user role only?
Thank you for your help!
1
vote
1
answer
21
views
wordpress pagination page/3 using index template instead of taxonomy-product-cat
I have added pagination to woocommerce custom product everything works fine till page 2 as soon as I click on page 3 nothing shows up and also it is somehow using the index template on page 3.
I am ...
2
votes
1
answer
36
views
No result when using the "woocommerce_new_order" hook when order has status "processing"
I need Telegram notifications to be sent when the order status is "Processing", so I have this code:
add_action( 'woocommerce_new_order', 'new_order_send_tg', 1, 1 );
function ...
0
votes
0
answers
14
views
Why other shipping methods are unavailable when free shipping is available
I would like to know where to find exactly as to why when free shipping is enabled, it automatically disable other shipping methods. I tried checking already the codes of the theme but (default Astra ...
0
votes
2
answers
32
views
Restrict certain user roles from making purchases in Woocommerce
No matter how many ways I try, I can't get it to work. I must mention that I have used this snippet for other purposes, such as restricting the possibility of buying if the product contains a certain ...
0
votes
0
answers
12
views
woocommerce webhooks verification always fail laravel php
anyone here knows how to obtain the woocommerce webhook secret or verify the incoming webhook request programmatically?
The problem I encountered is that my generated signature does not match with the ...
-1
votes
0
answers
32
views
How can a WooCommerce customer edit an Order Meta value from their My Account? [closed]
I'm trying to figure out how to break down this problem, and get to the right.
On my WooCommerce store, I'd like customers to be able to provide extra information after checking out. I'd like this ...
-3
votes
0
answers
14
views
Product Image & Product summary not align in product page in woocommarce [closed]
I want to develop a site where my product image is replaced with fancy product designer(fpd) plugin. But when it replace with product image the fpd designer & product summary not align in columns.
...
0
votes
0
answers
13
views
how to add custom filed in api attributes product in woocommerce
api product
I want custom filed to appear here (attributes array,See picture in the link ) with the product's api
0
votes
0
answers
20
views
Woocommerce tax calculation for coexistence of products incl VAT and excl VAT
Working with Woocommerce I have the following issue:
The shop consists of products with prices the incl VAT and exclude VAT.
All of the products have the same VAT of 19%.
Unfortuantely in Woocommerce ...
0
votes
1
answer
27
views
Price not changing showing Static
I tried to change the price a single way, like WAS, NOW
it's working, But on the single product page, it's not working showing all variation prices line by line and when I change the variation price ...
0
votes
0
answers
11
views
Remove Shipping&Billing Address from WooCommerce Order Search
I have a website with 50k+ orders, when operators search for an order, they search by name or phone number, after some testing and debugging, I've noticed that one of the reason the search is so slow ...
0
votes
0
answers
12
views
How do I remove an item from a subscription created by Woocommerce Subscriptions with a hook in php?
I am using Woocommerce Subscriptions to create my subscription products.
I have a use case where I need to change a product in a newly created subscription with a different product.
To achieve this, ...
0
votes
0
answers
15
views
WooCommerce Order Created Webhook triggering Updated Webhook
I have a laravel project that is dealing with the WooCommerce Webhook. And every time when I create a new order, there will always be two webhooks get fired which are updated and created webhook. May ...
0
votes
1
answer
62
views
Woocommerce Decline Checkout Process
(Theme: Woodmart)
I have one problem, I would like to have a custom meta field in the database of registered users, where I can set his debt and not let him make an order while he has an outstanding ...
1
vote
1
answer
31
views
Woo commerce order not showing in Order page
Hi Customer received an order email confirmation.
He paid via Paypal. but the order is not showing my order tab.
Also, Order showing on Order single page i.e
example.com/wp-admin/post.php?post=15920&...
0
votes
0
answers
31
views
woocommerce and polylang change text proceed to checkout button
Im try to change the checkout text , with dynamics translate using polylang , but i think don't have the good technic for doing this anybody has an idea ? i use the plug-in snippets for push this in ...
0
votes
0
answers
11
views
Cannot match WooCommerce webhook signature and the calculated hmac hash signature - PHP
I am using the following code to verify the incoming webhook request, but the calculated hmac and the signature sent in header always not match, may I know what is wrong?
$signature = $request-...
-1
votes
0
answers
23
views
Do not change the stock when buying a wholesale user
When a user with the wholesale role makes a purchase I don't want the stock of the purchased product to affect, that product to be kept in the same stock.
If a user with the normal role buys it the ...
-1
votes
0
answers
14
views
Custom Information for WooCommerce Bookings
hopefully someone can help me.
I am trying to add specific data to WC bookings. When the customer selects a number of people, I want some text input to appear after the calendar for each person (name, ...
2
votes
1
answer
33
views
Make product unpurchasable based on user geolocated country and product ID in WooCommerce
I have a snippet which I have put in functions.php, what I am trying to achieve is firstly get the users location (I have Geolocate set in WooCommerce settings and MaxMind configured).
If the country ...
0
votes
0
answers
30
views
Adding Custom Code Under Product Description in WooCommerce Wordpress
Trying to add some custom code under the product description but can't seem to find a hook to do this. woocommerce_product_after_tabs works well but it shows on every tab. Is there a specific hook for ...
-1
votes
0
answers
11
views
Woocommerce deposit
Who will tell you how to charge only a deposit of $ 10 in woocommerce shopping cart or checkout. So that the client can see that he pays now 10 and then 100. It needs to be done without the help of a ...
0
votes
0
answers
15
views
woocommerce call .php function from add-to-cart-variation.js
Goal is to create a condition where on a single product page an image is shown based on a variable in a product variation. If variation1 have value=x, then show this. Else don't. I created a function ...
0
votes
0
answers
16
views
Woocommerce save Billing Address without redirecting to end point using edit-address shortcode
I used the function to create shortcode to display the Billing Address fields in My Account page without using end point tabs.
Using the shortcode, Billing address fields are being displayed with save ...
0
votes
0
answers
27
views
How to show product attributes with images in single shop page in simple product type? (woocommerce)
Basically i have used woocommerce swatches and variations for attribute images. what i want is to show attribute name and image of attribute in single shop page, like we show categories or tags but ...
0
votes
0
answers
28
views
WP/WC: Move product meta into attributes table on single product page, keep SKU functionality for variable products
Looking for a solution to move the information inside the WooCommerce product meta area on the single product page into the WooCommerce attributes table on the single product page.
What I come up with ...
0
votes
0
answers
17
views
Dokan Get Vendor ID on checkout page
I am using dokan alongside woo commerce. I need to get the vendor id to my plugin on the checkout page. Does anyone know how to get the Vendor ID on the checkout page?
I tried using
$vendor_id = ...
1
vote
1
answer
92
views
Print styled HTML as custom field output from admin meta box fields in WooCommerce
I have this code, based on Display custom field values of product variations to custom product tab in WooCommerce to display 3 custom field on WooCommerce variations.
In that fields I want to insert ...
0
votes
1
answer
27
views
Woocommerce hook after a successful payment
I'm using emerchantpay for the payment gateway. Sometimes it does not redirect after the successful payment and it only happened during production. I wanted to create a fallback if that happens by ...
1
vote
0
answers
12
views
Updating quantity on 2 products with same bundle_id
I have sucessfully managed to remove a product with the same bundle_id with this code
add_action( 'woocommerce_cart_item_removed', 'remove_bundled_product_from_cart', 10, 2 );
function ...
1
vote
1
answer
31
views
Display badge when product stock reaches 1 item
I would like to create an additional badge which will be displayed if the stock of a product is one or two, i.e. it should be less than 3. For this purpose I wrote the following code but something is ...
-2
votes
0
answers
15
views
woocommerce auto set one option product variation
Good morning,
I am creating an e-commerce in which there are many variable products with the drop-down menus on the product page.
It often happens that, due to the selections made by the user, there ...
-1
votes
0
answers
17
views
Show All Products Button on Category Page - WordPress WooCommerce
I'm trying to add a 'Show All' button underneath the subcategories on the category page but I can't get it to work. I want it so the button shows all products from the parent category.
Example Image
0
votes
1
answer
22
views
WooCommerce One Page Checkout - Hide Product Attribute Colon
I'm currently using WooCommerce OnePage CheckOut
I'd like to remove the "attribute :" text from the product list.
I copied product-list.php
FROM: "/wp-content/plugins/woocommerce-one-...
0
votes
0
answers
29
views
How to change Woocommerce All Products for Subscriptions cart items subscription scheme key before checkout?
I am using Woocommerce Subscriptions and Woocommerce All Prducts for Subscriptions to offer subscription products on my Wordpress Woocommerce site. This works really well, but I want my customers to ...
-1
votes
0
answers
13
views
How can I sort product archives per multiple criteria sequentially?
I would like to sort products in all woocommerce categories by multiple criteria but sequentially. Please let me elaborate:
If a category contains 10 products I would like the first 3 to be the most ...
0
votes
0
answers
15
views
How to disable / increase cache for [products orderby="random"] in Woocommerce
I have the following issue:
Using the shortcode
[products category="" per_page="6" columns="6" orderby="rand" order="desc"]
Generates a couple of sets,...
0
votes
0
answers
22
views
How to create an endpoint that will query the product attributes based on product categories in woocosmmerce
Query to get Attributes based on Product Category selected in WooCommerce?
Just want to create an endpoint for the one answered by Veer
-3
votes
1
answer
55
views
Woocommerce - Pagination links reload same page content in a custom template
I'm trying to build my own custom downloads.php template. Everything works fine except pagination. The error occurs when clicking on any page number, for example; if you click on page 2 the link ...
0
votes
0
answers
57
views
How to redirect to a page conditionally after submission of Elementor Pro Form on Wordpress
I'm using Elementor pro forms to collect data from my customers, and it works as expected, but I need to use the submitted data on the customers next step.
To achieve this, I have made an action after ...
0
votes
0
answers
17
views
Change Woocomerce shipping methods output order
There are 4 methods, and you need to do the last one first. Which I just haven't tried. Hooks don't help.
Checout view
This code selects the delivery method, and I need to move it, that is, make it ...
-1
votes
0
answers
24
views
Woocommerce Change Add To Cart Notice to Custom Notice
I have created a custom Woocommerce notice that I want to display in place of the Success notice that currently shows when a user adds an item to their cart.
I am aware of the ...
1
vote
3
answers
48
views
Add link to WooComerce my account page using hook
I found this code from @LoicTheAztec that adds allows you to add some extra text to the My Account - Dashboard tab in WooComerce.
I am trying to add a hyper link to it however my php knowledge and ...
1
vote
1
answer
35
views
When a specific product is added to WooCommerce cart, empty cart THEN add product
This code currently works to clear cart before adding a product to cart.
// Empty cart when product is added to cart, so we can't have multiple products in cart
add_action( '...
0
votes
0
answers
26
views
Move WooCommerce T&C and "Place Order" Button
I want to move the terms & conditions checkbox and Place Order button to the top of the WooCommerce checkout block (default is at the end of the block). I think the hook for the placement I want ...
1
vote
1
answer
47
views
How do I show custom WooCommerce Subscriptions data on the frontend for customers subscription details?
I am using the WooCommerce Subscriptions plugin to manage recurring orders.
But I want my customers to see custom data, that I add to all new subscriptions, on their subscriptions details page.
I add ...
1
vote
1
answer
42
views
How do I add a custom field for subscriptions in the WooCommerce Subscriptions plugin without touching the core files?
I am using WooCommerce Subscriptions to manage recurring payments on my WordPress site, which sells baby diapers.
I want to add additional detail to my subscriptions, so that my customers can ...
1
vote
1
answer
22
views
Changing the monthly subscription fee based on products in the cart
I have a client who needs a complicated pricing structure for a Woocommerce subscription.
I need to calculate the number of products in the cart (besides the subscription product).
For each of those ...