Questions tagged [woocommerce-theming]
307 questions
2
votes
1 answer
WooCommerce how to update order meta data key value with woo rest api 3
I've been searching around but can't get it to work.
Using the api v3 I'm able to get all orders and everything is ok, but now I need to be able to update a metadata, when I use insomnia I manage to update the metadata, but now I need to do it from…

tyrese humphreys
- 101
- 9
2
votes
0 answers
WooCommerce sort by percentage discount amount in woo shortcode
I want to make custom sort option and use it into shortcode.
i want to make custom sort by percent discont for sale products.
Here is my code:
add_action('woocommerce_process_product_meta', 'woo_calc_my_discount');
function woo_calc_my_discount(…

Vladimir Kyatipov
- 686
- 4
- 17
2
votes
1 answer
Move title & ratings above image gallery on mobile devices in Woocommerce
I am trying to move my title and ratings above the image gallery in woocommerce but only on mobile. Desktop version should remain the same.
I found a php code that i pasted in my theme's functions.php and it does the job but it moves them above on…

Vaibhav
- 23
- 4
2
votes
1 answer
Woocommerce if product has upsells show badge in product listing
I'm trying to make a dynamic product badge show in the product listings on a Woocommerce site. The product badge should only show if the product has upsells assigned to it.
I just did this on the single product page with good results using this code…

Edvin Uddfalk
- 381
- 3
- 13
2
votes
1 answer
WooCommerce how to hide "Description" tab if product description is empty
I want to hide the "Description" heading of the WooCommerce product whenever the product's long description field is empty.
I've tried this:
// Remove Empty Tabs
add_filter( 'woocommerce_product_tabs', 'yikes_woo_remove_empty_tabs', 20, 1…

user3169905
- 199
- 3
- 19
2
votes
1 answer
Woocommerce my account page runs an extra loop for new customers
I have a problem on the "my account" page of my woocommerce store. Indeed, when I log in with a new customer account that has never placed an order, my dashboard has display bugs with disappearing containers.
After testing, the bug disappears only…

Loris GFT
- 87
- 6
2
votes
1 answer
Woocommerce how to move coupon form to the bottom of the checkout page
I have tried removeing the form-coupon.php under the checkout template in woocommerce with this code on the child theme functions.php file with this code:
add_filter( 'woocommerce_review_order_before_payment' , 'coupon_code' );
function…

Site Lab
- 35
- 5
2
votes
1 answer
WooCommerce how to check if the product is in stock
I think there is quite an easy solution:
In WooCommerce I want to apply my delivery time filter to a single product, but only if it is available/in stock. I am getting an error when it comes to any kind of checking the products stock.
function…

F Hughes
- 35
- 1
- 8
2
votes
1 answer
Getting Shipping Address from WooCommerce Checkout Page?
i'm a little bit stuck.
I've figured out how to retrieve the addresses assigned to a customers profile via the follow:
print_r(WC()->customer);
But I can't for the life of me figure out what the hook or whichever is required in order to get the…

sylargaf
- 346
- 1
- 6
- 19
2
votes
1 answer
Woocommerce how to get rid of order query on shop page
When using the order panel of woocommerce I noticed that an unnecessary query is executed on using search.
This is the query on Woocommerce file
(/includes/data-stores/class-wc-order-data-store-cpt.php):
SELECT order_id
FROM…

josem075
- 51
- 5
2
votes
2 answers
WooCommerce how to show Information on Product Archive IF by Certain Author
I want to echo some text before the cart on a product archive page (shop listings) but ONLY on the products that are by a certain author.
I have this code which shows the information I want where I want it:
add_filter(…

Shelley
- 23
- 4
2
votes
1 answer
WooCommerce how to update product category description and thumbnail ID
I've got an array of data with which I'd like to update my products categories (taxanomy) metadata. Specifically, I'm trying to update description as well as thumbnail url values. I tried to use multiple wordpress functions but none of them worked!…

Ruvee
- 8,611
- 4
- 18
- 44
2
votes
1 answer
How to update woocommerce order number to a custom ACF field? (wordpress)
I have a custom post called "project", and it has an acf field called "ponum".
When a customer purchases a product, I'd like to add the customer's order number to the "ponum" field of the user’s post in the custom post "project".
Getting an order…

Aino
- 121
- 8
2
votes
1 answer
How to edit fields in “ship to different address” form in Woocommerce?
I want to unset one field from checkout. I made simple function
add_filter( 'woocommerce_checkout_fields' , 'remove_checkout_fields' );
function remove_checkout_fields( $fields ){
unset($fields['billing']['billing_country']);
return…

MMPL1
- 533
- 7
- 21
2
votes
1 answer
Adding product attribute column to edit order page in Woocommerce
Any help with this greatly appreciated.
Tried a number of things so far to no avail, including the suggestions here:
Add product short description to Woocommerce admin orders preview
This is what I have so far:
add_action(…

Sean Doherty
- 2,273
- 1
- 13
- 20