Okay
  Public Ticket #4529722
Required Multiple (Quantity Step)
Open

Comments

  • Kjetil Toth started the conversation

    Hi,

    When adding "Required Multiple (Quantity Step)", and select a product category, and also choose "Apply to each individual product" I have some issues.
    When testing, it works with variable product. I get a message when going to cart, that says that for this product I have to buy X.
    But is it not possible to lock the function, so customer cant change the value from the "Quantity Step"?

  •  2,620
    WebWizards replied

    Hi Kjetil,

    Thanks for reaching out,

    I believe the issue here is that the multiple is being applied to the variable product (parent), not strictly to each variation.

    This is actually deliberate. If you have a multiple of 20 on a variable product, the plugin allows you to mix variations (e.g. 10 black + 5 blue + 5 red) to achieve that multiple. That is why it doesn't lock the input immediately when a single variation is selected.

    If you select individual variations in the Dynamic Rule, you should see it work differently.

     

    Alternatively, you can add this PHP code snippet to your site to force the behavior you are looking for:

    add_filter('b2bking_required_multiple_variation_use_parent','__return_true');
    add_filter('b2bking_minimum_variation_use_parent','__return_true');
    add_action('wp', function(){
    add_filter('b2bking_required_multiple_variation_use_parent','__return_true');
    add_filter('b2bking_minimum_variation_use_parent','__return_true');
    });

    This can be added to the functions.php file of your theme or via any Code Snippets plugin. This will make variations use the variable product's multiple strictly, which I believe should solve it for you.

    Let me know if that helps,

    Kind regards,
    Stefan