Support » Plugin: WooCommerce Extended Coupon Features FREE » You Only Need $ to Get Discount

  • Hello is it possible to make that for customer in cart page show text something like this: You need spend more 5$ to get 10% discount?

    The discount already created for minimum cart amount and checked: “automatically add discount when reach” But I really need show text about this discount in their cart page.

Viewing 1 replies (of 1 total)
  • Plugin Author Soft79

    (@josk79)

    You need to apply a snippet similar like this:

    
    add_action( 'woocommerce_after_cart_table', function() {
        if ( ! WC()->cart->has_discount( 'YOUR_DISCOUNT_CODE' ) ) {
            $show_notice = __( 'Spend more 5$ to get 10% discount!', 'your-text-domain' ) );
        }
        
        if ( ! isset( $show_notice ) ) return;
        ?>
        <div class="a-class-you-can-use-to-apply-formatting">
            <span><?= $show_notice ?></span>
        </div>
        <?php
    }, 5 );
    

    Disclaimer: This is an edited, untested version of a similar use case we use on one of our sites.

    • This reply was modified 3 months, 4 weeks ago by Soft79.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.