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”:…
Tag: wordpress
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
Disable only specific flat rate shipping method when free shipping is available in WooCommerce
I have two flat rates on my WooCommerce site and I want to disable one of them, when free shipping is enabled. I have a function which is working for all flat rates only. How do I check for an instance id on a shipping rate? Can anyone help me understand how to check for the instance id? I Was
WooCommerce – Can’t add a inside the return
I’m using the following code to change the add to cart button text in WooCommerce. add_filter( ‘woocommerce_product_add_to_cart_text’, ‘custom_add_to_cart_price’, 20, 2 ); // Shop and other archives …