Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3638555
Deactivate normal discount coupon codes when customer used Frequently Bought Together
Open

Comments

  • Mark started the conversation

    Is there any way to deactivate normal discount coupon codes when customer used Frequently Bought Together?

  •  1,223
    Dustin replied

    Hi Mark,

    I'm so sorry for the late reply!

    Please add the custom code below. (How to add custom code? ↗):

    add_filter( 'woocommerce_coupon_is_valid_for_product', function ( $valid, $product, $coupon, $cart_item ) {
        if ( isset( $cart_item['woobt_parent_id'] ) || isset( $cart_item['woobt_ids'] ) ) {
            return false;
        }
        return $valid;
    }, 99, 4 );

    Let me know if it works.

    Best regards,
    Dustin

  • Mark replied

    Hi Dustin, 

    I applied the snippet in the functions file, however the discount codes are still working when having the bundles in cart. Can you please check? Our website is Groomzo.nl 

  •  1,223
    Dustin replied

    Are you questioning about WPC Frequently Bought Together or WPC Product Bundles?

    Please explain more about this issue with some screenshots or links.

    Best regards,
    Dustin

  • Mark replied

    I'm sorry I mean of course frequently bought together :

    4664307816.png
    https://groomzo.nl/p/groomzo-professionele-hondentondeuse-complete-set/

    The snippet seems not working, when I add the frequently bought together items in my cart and go to checkout, the normal coupons are still working 

  • Mark replied

    Any updates @Dustin?

  •  1,223
    Dustin replied

    Hi Mark,

    Please send me your website credentials (wp-admin link, username, and password) or create a dev/staging site with the same configurations so I can check and fix any issues.

    Best regards,
    Dustin