Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #675
    Rick
    Participant

    Is there a way to create an auto coupon that offers; Buy 12 of Product Variation 8oz and receive 12 of Product B Variation 1oz Free?

    I see how to create the coupon for Buy 12 and get 1 Free. How do I get more than 1 free?

    #683
    Soft79
    Keymaster

    Enable multiplication of free products and use this snippet:


    add_filter( ‘wjecf_free_product_amount_for_coupon’, ‘wjecf_free_product_amount_for_coupon’, 10, 2 );
    function wjecf_free_product_amount_for_coupon( $amount, $coupon ) {
    if ( $coupon->code == ‘COUPON_CODE‘ && $amount >= 1 ) {
    $amount = 12 * $amount;
    }
    return $amount;
    }

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