Okay
  Public Ticket #3959170
Question regarding group rules
Closed

Comments

  •  2
    Kamil started the conversation

    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
    Kamil replied

    attaching a screenshot for clarity 

    Attached files:  c11.png

  •  2,406
    WebWizards replied

    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

  •  2
    Kamil replied

    It worked I can see the brands now thank your for your help! :)