I’ve been trying to implement a discount in my store with the following code: add_action(‘woocommerce_before_calculate_totals’, ‘set_discount’, 10 ); function set_discount( $cart ) { if ( …
Tag: woocommerce
Exclude variations with 2 specific attribute terms from coupon usage in Woocommerce
I need to prevent coupons being used if customer have any specific product variations in their cart with following attribute terms: attribute_pa_style => swirly attribute_pa_style => circle I’ve looked through the Woocommerce scripts that apply to restricting specific products and specific categories, but can’t figure it out with regard to attributes and all coupons. Any help is appreciated. Answer This
Disable specific cart item quantity fields based on WooCommerce product category
In woocommerce I am using Hide “remove item” from cart for WooCommerce product category answer code and I would like to disable the cart quantity field too, avoiding customer to change the item quantity to zero. Is that possible? Any track on this will be appreciated. Answer The following code will remove the “quantity field” from cart for items from
Disable only flat rate shipping method when free shipping is available in Woocommerce
I am using Hide specifics Flat Rates when Free Shipping is available in WooCommerce 3 lightly changed answer code to hide all shipping methods except one. The only method I want showing is a rate from the “Woocommerce Advanced Shipping” plugin. I am using the correct rate ID etc… Everything works fine except when a customer tries to click that
Hide “remove item” from cart for WooCommerce product category
I would like to Hide “remove item” from cart for a specific product category in WooCommerce, just like in “Hide “remove item” from cart for a specific product in WooCommerce” answer thread, but for a specific product category. Any help would be appreciated. Answer The following code will hide “remove item” from cart for a specific product category (that you
Change field label text on Woocommerce login form
This Question is similar to Rename username label on woocommerce login page I am trying to change the Label “Username or email address” to “Your registered email address” I am trying to do this without modifying the form-login.php template file. So far I tried the below code: However, I understand that gettext is very resource intensive function and I was
Pre-fill Woocommerce checkout fields with Url variable before session created
I have wordpress site running woocommerce with a few products. I want to send my customer a url to their product which includes their name and email so i can pre-fill name and email on woocommerce …
How to restrict a menu item and its content to logged users in WooCommerce
On WordPress, I’m setting up my online shop with WooCommerce plugin. I have a PHP script that generate a pricing table. But actually everyone can see it. How can I add it to my WordPress menu and no one could see it without being login in? Answer In your script you will add is_user_logged_in() in an IF statement like: Now
Display specific formatted product attributes in WooCommerce cart items [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question In woocommerce I am able to display some formatted product attributes under my products on the archives pages with the following code: How can I
Remove default selected state from woocommerce checkout billing shipping fields
I have selected default country from admin end United State, but problem is that the state Oregon is coming as the default selected I want to leave state field not default selected so the customer can free to search and select the state any suggest: below is the screenshot country is ok but state need empty to type for the