I use this code to set up a “welcome” discount for a registered user: add_action( ‘woocommerce_cart_calculate_fees’, ‘personal_discount_based’, 20, 1 ); function personal_discount_based( $…
Tag: cart
Add to cart validation in WooCommerce based on attribute value and product quantity from the cart page
Actually, I am trying to set a limit for adding to cart for some product ids based on product attribute. What i’ve done is: It works in a loop, but on the product page, it doesn’t take into account quantity input. Is there a way to get quantity add input in my function? Answer woocommerce_add_to_cart_validation contains 5 parameters (the last
Hide “remove item” and “quantity input” from cart in WooCommerce
On the WooCommerce cart page I want to hide: “remove item” button “quantity input” field For items that will go in the comment of // HIDE REMOVE BUTTON & QUNATITY OF THESE ITEMS in the code below Can someone walk me through how to do that? Answer A first option is to hide these fields via jQuery and CSS. You
Disable shipping methods having a specific word and based on a shipping class in WooCommerce
I’ve used a Business Bloomer snippet and tweaked it a bit to unset some shipping methods depending on a shipping class of items in the cart. It works fine with the 4 shipping methods I have tested with but in order to fully work on my website, I have to list all shipping methods values manually and I have A
Remove specific product variation from cart in WooCommerce
I want to remove a variation product from the cart in wordpress, woocommerce. I’m able to remove a simple product but not a variation product. With this code I can remove a simple product. I have tried passing in both the variation id and the parent variation id. I have no idea why its not working, would appreciate if some
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 …
Allow only Local Pickup for specific products outside specific Shipping Zone in WooCommerce
I have several products in the store, however one product (flammable) can only be shipped via a specific shipping company; Unfortunately that company can’t reach the whole country. So in case the customer buys the flammable product and it’s outside the coverage of the only company that can ship the product, he should not see any other shipping option except
Count only top level WooCommerce product categories form custom shipping calculations
I am using Increase Shipping cost per categories count found in WooCommerce cart answer code from my previous question. How to exclude subcategories from the array of product categories Ids, to keep …
WooCommerce buy one get one 50% off, excluding a product variation
I am using WooCommerce discount: buy one get one 50% off with a notice answer code, if customer purchases a specific product, customer get 50% discount off on the 2nd item. Now If the targeted product id is a variable product with for example 3 variations “A”, “B” and “C”, how can I exclude for example the variation “A” from
Woocommerce minimum order total based on user roles
I’m using a snippet code from Woocommerce Minimum Order Amount to set a minimum order total. But I would like to set different minimums per user role. I have some custom user roles: wholesale_prices, wholesale_vat_exc, and distributor_prices. I want to make the code to work based on use roles with different minimum amounts for each role. Here is my code: