Repository Forums Support WooCommerce Extended Coupon Features PRO Discount Type & Price prpoduct discount

Topic Resolution: Resolved
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #3822
    pere
    Participant

    Good Morning all,

    I’ve already purchased this plugin but I have 2 quick questions:

    1- Is it possible to manage discount types to get percentage discount per product? I can only make price discount per product

    2- When I make a coupon based on specific products, if it applies, I see the discount at the bottom of the cart. Is it possible to see the discount applied in each product with another colour label?

    Thank’s a lot!!!

    #3823
    Soft79
    Keymaster

    1. Sure, use discount type Percent. That will only apply discount to the matching products.

    2. Use this snippet:

    
    add_filter( 'woocommerce_cart_item_subtotal', function( $subtotal, $cart_item, $cart_item_key ){
        if ( $cart_item['line_total'] < $cart_item['line_subtotal'] ) {
            if ( WC()->cart->display_prices_including_tax() ) {
                $subtotal = sprintf( '<s>%s</s> %s', wc_price( $cart_item['line_subtotal'] + $cart_item['line_subtotal_tax'] ), wc_price( $cart_item['line_total'] + $cart_item['line_tax'] ) ); 
            } else {
                $subtotal = sprintf( '<s>%s</s> %s', wc_price( $cart_item['line_subtotal'] ), wc_price( $cart_item['line_total'] ) ); 
            }
        }
        return $subtotal;
    }, 20, 3 ); 
    #3839
    pere
    Participant

    Awesome!!!

    Can I add also a text at the right of the discount (point 2) 🙂

    #3842
    Soft79
    Keymaster

    See answer point 2. Or isn’t that what you mean?

    #3847
    pere
    Participant

    With response 2 I have also the discounted price, but I need to add also some text like “discount” or “sale”

    #3849
    Soft79
    Keymaster

    Replace both instances of '<s>%s</s> %s' with '<s>%s</s> %s sale!' .

    #3850
    pere
    Participant

    Thank you!!

    Final point 🙂

    When I get this discount, supose I setup a cart discount, with that adjustment you gave me, all the products appear discounted. Is there any way to see only discounted those items in the coupon?

    #3861
    Soft79
    Keymaster

    Can you send me a screenshot explaining tbis issue?

    #3863
    pere
    Participant

    Here you are,

    https://imgur.com/a/viuGRh1

    As you can see, when coupon is added, the discount is shared with all the product in the cart, not only eh one’s I marked with the discount.

    Bests,,

    #3864
    Soft79
    Keymaster

    In WooCommerce a cart discount is always divided between all the products in the cart. You can see the difference when you change the discount type to a percent discount.

    This is how WC works.

    #3865
    pere
    Participant

    Ok! There’s nothing to do then..

    #3866
    Soft79
    Keymaster

    Maybe by overriding this logic, but it will be hours of work. You dicide if it’s worth it.

    #3867
    pere
    Participant

    Do you do this type of services? 🙂

    #3870
    Soft79
    Keymaster

    Yes, please contact us using the contact form.

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