Public Ticket #3959170

Question regarding group rules

Closed
Comments
7 Tickets 2
Kamil started the conversation 1 year ago on April 17, 2025 at 2:02pm

I would like to ask if its possible to set up group rules with discount based on product brand?

I saw there is option to set it by tags and categories but there is no option to attach it to brands, it would be helpfull as my customers have 20% discount for brand "A" and 30% discount for brand "B"

2,762
KingsPlugins replied 1 year ago on April 17, 2025 at 9:41pm

Hi Kamil,

It is possible, with a code snippet, to also add support for a custom taxonomy in dynamic rules - usually the brand is a taxonomy.

The snippet to add is:

add_filter('b2bking_dynamic_rules_taxonomy_option', function($val){
    return 'brand';
}, 10, 1);
add_filter('b2bking_custom_taxonomy_backend_name', function($name){
    return 'Brand Name';
}, 10, 1);

Here it sets it to a 'brand' taxonomy instead (assuming that's the slug of the taxonomy and not something else).

That should result in brands becoming available for selection in rules:

8848721643.png

 

Kind regards,

Stefan

Sign In