Home Forums WoodMart support forum Questions around dynamic discount

Questions around dynamic discount

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #494587

    metuza
    Participant

    Hello,

    A few questions around Dynamic Discount functionality.

    Is it somehow possible to set discount rule working by increment of only 1 item? Then i mean that user get discount when buying 2 items, and better discount on 3 items and so on. As far as i can see it is only possible to set ie. FROM =2 and TO=3. You can not set FROM=2 and TO= 2.

    Also I miss the possibility to set rules working with all included items. Then i mean if i have included a variable product then rule should work on all variants, not only one of them. So if rule says 10% on purchase of 2 items then we should get 10% if buying ie. 1 size 39 and 1 size 40.

    Also on standard simple products. If i include 3 different products then we should have an option to mix the discount so it work no matter which one of the 3 different products purchased as long as the total quantity is reached.

    PS.. There is also some issues with bundled products. If some of the items included in the bundle has quantity enough to earn discount then it is discounted in addition to the full bundle. Using YITH bundle but i guess it will be the same with other bundle plugins.

    Brgds
    Rune

    #494658

    metuza
    Participant

    Hi again,

    I had to look into the code as the need of beeing able to set: from=2 and to=2 is important in my sites. So it was a 5 minutes fix and i hope this can be updated in a patch or next update.

    First i did a small change to validation in discounts.js file. I made it possible to set the same value in FROM and TO fields.

    Then in the file class-frontend.php i deactivated this code-snippet:

    //$data[ $id ]['quantity'] = sprintf(
    				//'%s%s%s',
    				//$rules['_woodmart_discount_rules_from'],
    				//array_key_last( $discount['discount_rules'] ) !== $id ? '-' : '',
    				//! empty( $rules['_woodmart_discount_rules_to'] ) ? $rules['_woodmart_discount_rules_to'] : '+'
    //);

    and added in this modified code-snippet:

    $data[ $id ]['quantity'] = sprintf(
    				'%s%s%s',
    				$rules['_woodmart_discount_rules_from'] !== $rules['_woodmart_discount_rules_to'] ? $rules['_woodmart_discount_rules_from'] : '',
    				array_key_last( $discount['discount_rules'] ) !== $id && $rules['_woodmart_discount_rules_from'] !== $rules['_woodmart_discount_rules_to'] ? '-' : '',
    				! empty( $rules['_woodmart_discount_rules_to'] ) ? $rules['_woodmart_discount_rules_to'] : '+'
    );

    So now it is possible to create rules like this:
    Buy 2 get 5%, buy 3 get 10%, buy 4 get 20% and so on.

    You can see how it looks in the discount table her:
    https://www.villmarksbua.no/produkt/fritidsutstyr/turklaer-og-skotoy/sko-og-stovler/igloo-termo-vinterstovler-30c/

    I really hope this can be added to the next update or an patcher.

    Brgds
    Rune

    #495138

    Hello,

    Thank you for your message, our developers will consider this option as a future request.

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 3 posts - 1 through 3 (of 3 total)