Exclude discounted products, include other products on Special


  • Default avatar
    helena1    
     11 years ago
    0

    I was searching on forum, but I only found one older post, that doesnt apply to my Awo version (https://awodev.com/forum/awocoupon/help-section/coupon-product-no-promo)
    What I need is for my Coupons (that are auto generated when user registers by plugin -AwoCoupon Email) to exclude discounted products, that are also on Special.

    So let me clarify... I have Module on shop front page that displays Special products. Some products are discounted, some not. I want discount to apply to all products (including special), except for all discounted products.

    Is that possbile?

    Awo version: 2.2.2
  • Your avatar
    seyi    
     11 years ago
    0

    hello,

    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php around line 420 is this
    <?php
                
    if(empty($product_discount)) {
                    
    $product_table $this->getProduct($productId);
                    
    $product_discount $product_table->product_special;
                }
    ?>


    comment it out like so
    <?php
                
    /*if(empty($product_discount)) {
                    $product_table = $this->getProduct($productId);
                    $product_discount = $product_table->product_special;
                }*/
    ?>


    That should do it.
  • Default avatar
    helena1    
     11 years ago
    0

    Thank you a lot. I tested it and it seems to work. Thanx again!
  • Default avatar
    helena1    
     10 years ago
    0

    Sory, but it seems that I was a bit hasty with confirming it works. It looks like discounted products are still getting additional % off when using coupon. Do you have any other idea how to solve it?
    I just need coupon to work only on non discounted products...
  • Your avatar
    seyi    
     10 years ago
    0

    Ok,

    Maybe I do not understand what you want. By default, if you check the box 'Exclude specials', AwoCoupon will exclude:
    - all products that are marked as special
    - all products that have a lower price than their base price

    The code I posted alters it so AwoCoupon only excludes:
    - all products that have a lower price than their base price (whether it is marked as special or not)


    Another option that would be under your control is to create a special category for the products you do not want to discount, then within AwoCoupon exclude that category.
  • Default avatar
    helena1    
     10 years ago
    0

    You understand just right. I want to exclude all products with lower price than their base price... (setting to exclude special is unchecked, since I dont want to exclude them all...) But when I added discounted 2 products today and found that it doesnt work. Discount was added anyway.

    It is weard thow, since I am shore I tested it the other day and it worked with products that where discounted then (I tested randomly few) I havent changed anything with Awo settings in the mean time, so I dont get it...
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    Did you say that exclude specials is unchecked? If so it would need to be checked in order to exclude discounted products.

    Also you may want to check your code again just to make sure the edit I gave you is still there.
  • Default avatar
    helena1    
     10 years ago
    0

    It seems to be that this was the problem (exclude specials was unchecked). I will test this some more, and will get back to you, but it looks like it works now .
    It is possible however that I unchecked that later, thinking that with this overwrite it doesnt matter anymore...
    thanx.
  • Your avatar
    seyi    
     10 years ago
    0

    Ok great, glad you got it back. The change just altered the way the checkbox works, so please keep that in mind moving forward.