I wrote an API that takes a WooCommerce webhook and inputs the data into our CRM. I’m using: The whole script is in one file because it’s so simple. My question is what happens if php://input receives two or more webhooks at the same time. Would it operate like a queue or could one be potentially dropped? Reason I ask
Tag: woocommerce
Woocommerce Shipping method based on user role
I want to enable or disable Shipping Methods, according to user role. I have tested various different codes and approaches, none of which have worked so far. The current code: (source: stacklink ) (Have tested the original snippet as well, without changes, accept for the user role ) Does not work for me. I tested it with ‘local_pickup’ as well,
how to get specific key and its value from object
How do I get specific key and its value from object? Example I have output of my query: “attribute_summary”:”Color: Red”, “meta_data”:[ { “id”:…
WooCommerce custom shipping costs for min required subtotal with tax calculations
I have set some Shipping methods with taxable option enabled in WooCommerce. I use this code to set up different shipping cost if spend over X amount: But the problem is the tax calculations. My code doesn’t handle taxes. How can I adjust taxes from custom shipping cost? How to enable taxes in cost calculations? Any advice is appreciated. Answer
Remove all taxes in WooCommerce for a min cart total and specific countries
we need to charge 0 VAT for UK orders that are greater than 150 euro including shipping and payment gateway fees but excluding the 20% normal VAT. So if a British residential address orders something at 130 and shipping and payment gateway fees are 9 then we charge VAT so the customer pays 139+9+20% VAT, but, if the order is
How to get Shipping Methods custom additional data in Woocommerce?
From this comment I’ve created custom field “Shipping Method Description” inside shipping methods: But I can’t understand how to get this data in front-end inside my custom shipping template(/cart/cart-shipping.php) like: This comment isn’t clear for me how to get this instance settings. Can anyone suggest a solution? Answer WooCommerce shipping method settings are stored in wp_options table on option_name column
WooCommerce: Avoid checkout If all cart item custom fields are not filled in
I wrote a function that disables the ordering button when additional fields (with display in cart) in each of the products have not been completed (fields appear only if there are more than 2 items in the cart). But it only works when the page is refreshed in the browser. How can I make the function refresh every time something
Add content to WooCommerce My account dashboard main page section
Hi I have been searching for how to add items or custom HTML to the main dashboard landing page of the “my account” section of WooCommerce but cant find it. I am adding this in my child theme and all I can find through searches is how to directly edit the woocommerce_account_content. Since I want to do this out of
How to target all pages except WooCommerce Thankyou page
I have a hook that looks like this: This works well, however I now need the opposite. All pages that don’t use this hook… Can I embed the above into an IF statement and then use the ELSE statement to resolve? Answer As the hook woocommerce_thankyou is triggered in WooCommerce “Order received” page, To target all pages except WooCommerce Thankyou
Filter a custom product loop to get products from a category in WooCommerce
I have this function which calls me all products type “promotion_package” in WooCommerce: I would like to get only products from “vip” product category. I tried using $product->get_categories() to find “vip” category, but it didn’t worked. How can I show only products from “vip” category? Answer You can try has_term() conditional function for ‘product_cat’ procuct category taxonomy as follows: It