• Resolved chester12

    (@chester12)


    Hello,

    Hope you’re fine.

    Is it possible to keep the price of the upsell product unchanged once a woocommerce coupon is applied (and of the amount of the coupon applied & cart amount) ?

    Thanks a lot,
    Chester

    • This topic was modified 2 years, 9 months ago by chester12.
Viewing 15 replies - 1 through 15 (of 25 total)
  • Plugin Author Giacomo

    (@jakjako)

    Hello chester12,
    try to past this snippet in the functions.php file of your child theme

    add_filter(‘woocommerce_coupon_is_valid_for_product’, function($valid, $product, $coupon, $values ){

    return !isset($values[‘upsell’] );

    }, 12, 4);

    Thread Starter chester12

    (@chester12)

    Hi,

    I just passed the snippet into the functions.php (at the end of the file) and my website crashed. Please check the code :

    // Plugins support
    $jacqueline_required_plugins = jacqueline_storage_get( 'required_plugins' );
    if ( is_array( $jacqueline_required_plugins ) ) {
    	foreach ( $jacqueline_required_plugins as $jacqueline_plugin_slug => $jacqueline_plugin_data ) {
    		$jacqueline_plugin_slug = jacqueline_esc( $jacqueline_plugin_slug );
    		$jacqueline_plugin_path = jacqueline_get_file_dir( sprintf( 'plugins/%1$s/%1$s.php', $jacqueline_plugin_slug ) );
    		if ( ! empty( $jacqueline_plugin_path ) ) {
    			require_once $jacqueline_plugin_path;
    		}
    	}
    }
    
    add_filter(‘woocommerce_coupon_is_valid_for_product’, function($valid, $product, $coupon, $values ){
    
    return !isset($values[‘upsell’] );
    
    }, 12, 4);
    Plugin Author Giacomo

    (@jakjako)

    Probably because wordpress forum changes the single quote symbol. Let’s try with double quotes.

    add_filter(“woocommerce_coupon_is_valid_for_product”, function($valid, $product, $coupon, $values ){

    return !isset($values[“upsell”] );

    }, 12, 4);

    After copy/paste replace every ” symbol ( like in woocommerce_coupon ecc and values upsell ) with ” or ‘ digited by you.

    Thread Starter chester12

    (@chester12)

    Is there another way to make it work ? Or, would you please first test your recommendation before ? Every time I touch the functions.php according to what you’re saying, it crashed my website.

    thanks a lot,

    Chester

    Plugin Author Giacomo

    (@jakjako)

    I can add that as a plugin option ( it seems a resoneable feature to add ). Give us 2 days ??

    Thread Starter chester12

    (@chester12)

    OMG ! That would be SUPER GREAT ??
    Please, notice me ! Thanks a lot !!!!!!!!

    Pst, @jakjako
    For next time, if you select your code and then hit the “code” format button here, then the code section will get “back-ticks” front and end, and there’s a slightly better chance that the forum software won’t mess with your code.

    Thread Starter chester12

    (@chester12)

    Hi Giacomo,

    By the way, is that possible for you also to put an option to place the “upsell card” into the payment section ? ?? (just inside at the top of the option : paypal, cash on delivery etc)

    Plugin Author Giacomo

    (@jakjako)

    @tobifjellner really thanks, I’m a noob about this forum ??
    @chester12 yes, definetely. Next relase will have these 2 features ??

    Thread Starter chester12

    (@chester12)

    THANK YOU SO MUCH Giacomo !!! Can’t wait ! ??????????

    Thread Starter chester12

    (@chester12)

    Hi Giacomo,
    hope you’re fine !
    Do you have any update about the new version ? ??
    Thanks a lot

    Plugin Author Giacomo

    (@jakjako)

    Hello chester12,
    discount feature added. Checkout upsell position on test ??
    I hope to push the new version today/tomorrow!

    Plugin Author Giacomo

    (@jakjako)

    Hello, features as out in the beta version.
    Go to J Cart Upsell and cross-sell, check the “join beta program” and you should see a plugin update. Let me know if it works ??

    Thread Starter chester12

    (@chester12)

    Hi Giacomo,

    Hope you’re fine !

    Just joined ! What’s next now ? ??

    Thanks

    • This reply was modified 2 years, 8 months ago by chester12.
    Plugin Author Giacomo

    (@jakjako)

    Does it works properly?
    Next – make it compatible with wpml/polylang!
    Or, if you have suggestions, just ask ??

    • This reply was modified 2 years, 8 months ago by Giacomo.
Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Woocommerce coupons applied on the upsell product’ is closed to new replies.