I’m using the following code in my theme functions.php file to send order failed email only to customer instead of admin: And it works… But I’m getting the following error in php log file: How can I solve this error? Answer You need to replace billing_email by the WC_Order method get_billing_email() like: Code goes in function.php file of your active
Tag: woocommerce
Changing the titles on My Account pages in Woocommerce
I’ve seen loads of example of how to re-order / change the navigation and page with the WooCommerce my account dashboard. But i can’t for the life of me work out how to change the main titles for each section (My Account, Orders, Downloads, Addresses etc). I’ve searched through the templates but no joy. I’ve tried using conditional php comments
Add a Contact Form to “Out of Stock” product Variations in WooCommerce
I have successfully added a contact form to a product if it is Out of Stock using But I also want to add the same form if a products variation is Out of Stock too. Just unsure as to which hook I can use to tie it in to the Out of Stock message for that variation… I feel like
Woocommerce Session cookie not set on ajax when using admin-ajax.php
I have a Wordpress ajax function which is using the WC()->session to take session data and use it in the function. (for exmaple taking chosen shipping method from the session and displaying it). The …
Make WC_Cart add_to_cart method working for guests in Woocommerce
Im trying to get my code to work. Searching for hours now. I found similar questions like this one. But unfortunately noone seems to find a solution. In my custom plugin I want to add a specific …
Add a custom text under featured products price in Woocommerce product widget
I am trying to add a line of text under the price of my featured products on my homepage. I have tried editing the content-widget-product.php so it looks like this – I added the “Delivery throughout line”… but it doesn’t do anything though. Can someone please tell me why it’s not working. Thanks! Answer Try the following code that will
Display the stock availability for all product types in Woocommerce archive pages
I am using this code in showing the stocks of products: And if the product is a variable I use this answer code to display the stock availability: Get the total stock of all variations from a variable product In Woocommerce How can I merge this codes in a single conditional function? For example. if the products is a simple
Trigger email on order custom status change in Woocommerce
I’ve created a custom email class and added it to WooCommerce. When I go to the emails setting in WooCommerce I can see my template there and when I trigger it manually the email arrives at the target email account. Now I have the problem that I’ve added a action to my class which should detect the order status change
Change gallery thumbnails count & number of related products in Woocommerce [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question In Woocommerce I would like to show 3 thumbnails on single product the gallery image slider and also to get
Add a column with coupons used on admin Orders list in Woocommerce
I am trying to display the coupon(s) used directly on the order admin screen (where all orders are listed in WooCommerce) but for some reason it’s giving me a fatal error because of the break. Here is the code -> Any ideas on how to fix this would be very much appreciated. Answer There is some errors and mistakes in