Hi Im looking for a code that adds my subscription ID (2282) to cart if there is added a normal product but NOT if the user is already subscriber. Feel free to ask questions. I’m in the GMT+1 time zone WordPress – 4.8.1 WooCommerce – 3.1.1 WooCommerce Subscriptions – 2.2.11 WooCommerce Membe…
Tag: wordpress
Change product prices via a hook in WooCommerce 3+
IN WooCommerce, I need to multiply all product prices by a number. So I have used the following (via a plugin): But, that doesn’t work for variation products. I have tried the following hooks with no luck: The only one that works half way is this one: But that just changed the overall price, not the sel…
Send an email notification when order status change from pending to cancelled
In previous versions of Woocommerce, an email notification was sent automatically when an order was changed from pending status to cancelled status (In my case, this happens after an allotted time set in the inventory section of the admin). In WooCommerce 3.0.8 they have removed this automation and labelled a…
Product category linked terms list related to current product in WooCommerce
I’ve found online a snippet of code that currently lists all categories on this WooCommerce website. How to I make it specific to show the category related to the product they are viewing? Here is the code that I’ve tweaked: Answer There is a more much simpler way: To display it as coma separated …
Update all variations prices of a variable product in Woocommerce
I need to get all variation id and update price in loop. Simple query and loop looks like: I think not working this: or this: Answer First in your code ‘ or ’ should be replaced by ‘. Also if used $post-ID should be replaced by $post->ID Depending on where and how you are using this code, you should …
Saving the value of a custom field phone number in WooCommerce My account > Account details
Trying to add a field for Woocommerce billing_phone to the my-account/edit-account/. It is present within the update address pages but when adding to the form-edit-account.php it does not update. Currently adding by following the same code as the other fields, such as first_name: Image of form with billing_ph…
wordpress date format change function
I am using below function getting dates from advanced custom fields pro plugin my below code displays the dates from options , i want date format is different i have used below code to change the format but not working , here the_field(‘event_start_date’); directly displaying without print/echo An…
Custom conditional redirections after WooCommerce checkout payment
I use Lirox One theme on WordPress with WooCommerce. I want make custom redirections after payment: If a customer buy product ID 333, It will be redirected to product 444 (for example). I have make some custom code but it doesn’t works, I get an error 500 (and debug is empty). What I am doing wrong and …
Get WooCommerce featured products with a custom shortcode
I tried to get array of featured products to use theme in my own plugin with jquery slider I have made this function and get attrs from class-wc-shortcodes.php but no results what I must add or change to get it works I use it now as shortcode in welcome page just for testing Answer There was some errors in yo…
Change WooCommerce variable product title based on variations
I’ve coded in a custom select box to a group of my products that changes the price based on the user’s selection. It works well, but now I need to change the product title too based on their selection. Basically if option 1 is chosen, the product name stays the same. But is option 2 is chosen, I n…