Products Remove Condition

[ad_1]

Heya everyone.

I am wondering if anyone knows of a plugin or functionality that can remove products from the cart and checkout page based on a customers shipping state/province (not the country) that they choose.

i.e. John has product A and product B in the cart table if John selects the province “XA” then product B should be removed from the table.

[ad_2]
1 Comment
  1. You should be preventing them from being added to the cart in the first place, but you can use any of several ways to do this using existing hooks.

    Shipping class is a common one, product category another. You want to use wc()->cart->remove_cart_item() in your conditional statement that checks the cart contents

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer