WooCommerce: filter from selling by Country and selected Attribute 'brand'

49 Views Asked by At

Is it possible to restrict by condition COUNTRY and ATTRIBUTES with WooCommerce?

I have two idea to archive it:

  • Made a snippet

  • Create separated Query:

  1. Extract from WooCommerce the country of the billing and shipping dropdown. (2 queries)
  2. Extract the Attribute meta 'brand' from the product in the cart.
  3. Merge them for the Dynamic Visibility of checkout button or to show some warning.

Thank you for any kind of help!

Ex:

If someone select "Italy" and in the cart or checkout there is a product with the Attributes (Brand) BREMBO, It's allowed to process the order.

If there is any other country or at least one product with BREMBO Attribute, checkout button will not available.

0

There are 0 best solutions below