Repository Forums Support WooCommerce Extended Coupon Features PRO % Discount + Free Product By Brand

Topic Resolution: Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1679
    matts
    Participant

    hi guys – our scenario is this:

    * coupon applies 10% discount on products within 2 of our 10 or so brands – using Woocommerce Brands plugin
    * coupon also adds a free add-on to the order

    I can get the coupon to work fine with a Fixed Product Discount but if I change to Percentage Discount, the free product appears but the discount isn’t applied to the lead product.

    I can get the discount to appear OR the free product but not both at the same time.

    Any idea what I might be missing?

    #1684
    Soft79
    Keymaster

    Hi, if you temporarily disable our plugin, and you set the discount to Percentage Discount. Is the discount applied then?

    If so, please send me a screenshot of your coupon settings and an url to your store with instructions to reproduce the issue.

    #1691
    matts
    Participant

    Hi, If I disable the plugin the 10% discount applies.

    If I enable the plugin with the following settings:

    *percentage discount
    *amount 10
    *product brands: brand 1, brand 2
    *minimum quantity of products: no minimum
    *allow discount on cart with excluded: check
    *limit discount to: default
    *free product: product 1

    Free Product is added but discount not applied.

    *percentage discount
    *amount 10
    *product brands: brand 1, brand 2
    *minimum quantity of products: no minimum
    *allow discount on cart with excluded: check
    *limit discount to: default
    *free product: product 1
    *allow multiplication: check

    Discount shows but no free product

    #1693
    Soft79
    Keymaster

    Hi, what version of our plugin are you using? Can you please send me the brands plugin (to admin at soft79.nl) so we can try to reproduce the issue?

    #1750
    Soft79
    Keymaster

    I think the issue is caused by the Brands plugin. They seemed to have missed a change in WC2 -> WC3 causing percent-discounts to fail. Please try this:

    Open the file woocommerce-brands/includes/class-wc-brands.php, replace the following lines:

    Line #202:
    if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
    replace with:
    if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product', 'percent' ) ) ) {

    Line #318:
    if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {
    replace with:
    if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {

    Line #367:
    if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_excluded > 0 ) {
    replace with:
    if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_excluded > 0 ) {

    Also, in your coupon disable ‘allow multiplication’. Now all should work as expected. If so, please inform the WooCommerce guys of the issue in the Brands plugin.

    #1753
    matts
    Participant

    OK that worked – thanks for the help guys – I’ll give the chaps at Woo the heads-up.

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