Repository Forums Support WooCommerce Extended Coupon Features PRO Incremental free gift(every buy 2 get 1 free)

Topic Resolution: Resolved
Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #760
    info17
    Participant

    Is it possible?

    buy item “A” x 2, get “A” x 1 free
    buy item “A” x 4, get “A” x 2 free
    buy item “A” x 6, get “A” x 3 free
    continues….

    #762
    Soft79
    Keymaster

    Yeah, tick the boxes ‘Allow Multiplication’ and ‘BOGO’ and paste this filter in your functions.php:

    add_filter( 'wjecf_bogo_product_amount_for_coupon', 
    function ( $qty, $coupon ) {
        if ($coupon->code == 'SOME_COUPON') {
            $qty  = floor( $qty / 2 );
        }
        return $qty;
    }, 10, 2);
    

    replace SOME_COUPON by your coupon code.

    #764
    info17
    Participant

    Also can I customize display of free gift item line?
    Price, QTY and Total

    P.S. Free gift’s QTY shows sum of the items(if bogo, 3) which is not intuitive.

    #765
    Soft79
    Keymaster

    What do you mean? please send a screenshot.

    #766
    info17
    Participant

    Please see the link
    http://imgur.com/a/v28BR

    #767
    Soft79
    Keymaster

    This is not intended. Did you paste the snippet in functions.php? Did you replace the coupon code?

    #769
    info17
    Participant

    No, this is result without your snippet.
    If I set your snippet, it shows corrent qty.
    Seems to be a bug.

    #770
    Soft79
    Keymaster

    Without the snippet BOGO works like that: Buy one get another one free. Therefore: Buy 12 get 12 free.

    With the snippet it works the way you want it. It’s customized to your needs.

    So what do you mean by ‘seems to be a bug’?

    #771
    info17
    Participant

    How about Buy 5 Get 1 Free?

    Even if I set “Minimum quantity of matching products” to 5, same result.
    free gift become 5.

    #772
    info17
    Participant

    Is it that I can chose only buy one get one free without snippet code?

    #774
    Soft79
    Keymaster

    For Buy Five Get One you must uncheck ‘Allow multiplication’.

    #776
    info17
    Participant

    I see, So I need to use your snippet to apply incremental free gift other than bogo anyway?

    One more question,
    How to handle free gift number if there are free products?

    If the coupon is Buy 2 Get 1 Free with incremental free gift and customer add an item x 6,
    I expect to be able to add any three(total number) from free products.

    i.e.
    Free product selection “A” and “B”
    So customer can choose “A” x 2 and “B” x 1.
    Total three.

    #777
    Soft79
    Keymaster

    That’s not possible with this plugin.

    #780
    info17
    Participant

    I understand.
    I would like you to add it in the future release.

    BTW, Is it possible to add delete(X) icon to free gift on cart page?

    #784
    Soft79
    Keymaster

    For feature requests, please contact me through the contact page.

    About adding the X icon. Try this (untested):

    remove_filter( 'woocommerce_cart_item_remove_link', array( WJECF()->get_plugin('WJECF_Pro_Free_Products'), 'filter_woocommerce_cart_item_remove_link' ), 10, 2 );

    The product will probably be placed in the cart again after every page load.

Viewing 15 posts - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.