Include some javascript code in HEAD on WooCommerce Order received

Goal: I need to include an event snippet for specific tracking on the Woocommerce Order Confirmation page (the page immediately following a purchase). I must pass order_id, currency and total to the …

WooCommerce – removing country field from my-account page prevents from saving address

I sell and ship products only to one country so I don’t want to display billing_country and shipping_country field to the customers. I removed the fields from both checkout and my-account addresses …

Assign a percentage fee to WooCommerce payment methods based on user roles

How do I expand this snippet to include 2 more payment gateways with different fees? The payment gateways I want to add are ‘cardgategiropay’ and ‘cardgateideal’ and the fees are 3% and 2% …

Hook woocommerce_checkout_order_processed order items issue

I am working on a WooCommerce project. I need to add some entry based on ordered item in my custom table. If user ordered 3 items then those 3 entry will be place along with some data in my custom …

WooCommerce cart subtotal: Display ‘free’ instead of ‘0,00’

i am searching for a solution to display ‘free’ instead of €0,00 in the WooCommerce Cart/Checkout. I know, there is a snippet for the Single Produkt itself, but is there a possibillity to change the …

Set a custom shipping cost on every 10th Order in WooCommerce

WP 5.3.3 I need to change shipping cost programmatically, after order creation. This code doesn’t affect: add_action(‘woocommerce_new_order’, ‘custom_shipping_costs’, 1, 1); function …

Add 50% discount per 3 products on the cheapest products (WooCommerce)

I’m adding the discount rule for every 3 products: 3,6,9,12,15.. on the cart and it should apply to discount 50% only the cheapest products. So if you have 9, only the 3 cheapest gets 50% off. This …

Check WooCommerce User Role and Payment Gateway and if they match – Apply fee

I’m struggling with applying a fee for an array of user roles if and when a specific payment gateway is selected. The code I’ve written works fine if I do not check the user role, but once I try and …

Validate phone number in WooCommerce

I would like to add custom validation to the phone number (billing_phone) on the checkout page and the register page. With 05 Accept 10 numbers Validate phone number in woocommerce checkout page

How to add a new field to my account details between other fields

With the snippet below we add a billing phone field to the account edit details. This works without problems, only we would have liked to add the new field between the email and the password change …