Does not exclude special items


  • Your avatar
    seyi    
     5 years ago
    0

    Hi, i have installed the coupon pro component and i have stated "Exclude products on special" and when i add in my cart a product and a product on special it is calculating the coupon discount on both items, not excluding the one on special.

    I have chosen
    function type: coupon,
    function type2: vendor
    Percent
    Discount type: overall
    Value 10.00000

    Exclude product on special

    and selected the vendor as include.

    Thank you
  • Your avatar
    seyi    
     5 years ago
    0

    Hi, I am not able to reproduce this with the coupon specifics you created. You should probably change the4 discount type to specific, so it only discounts items from that specific vendor. Even without that, the products on special should be excluded. So if you look in virtuemart under 'special products' is the product listed there? And what version of AwoCoupon are you using? I tested using 1.3.2 and it works.
  • Default avatar
    chariklia    
     5 years ago
    0

    i have tried changing the settings, from vendor to manufacturer, from overall to specific, doesn't work, i even have downloaded the latest upgrade and added it...

    can i pm you with the site info to check it out?
  • Your avatar
    seyi    
     5 years ago
    0

    certainly
  • Your avatar
    seyi    
     5 years ago
    0

    Ok, AwoCoupon's definition of a product on special is a product that is discounted from its normal price. You can also make an item featured that is not discounted. If you would like these to also be marked as special then the update below should do it.

    in www/administrator/components/com_awocoupon/assets/virtuemart/ps_coupon_process.php, assuming you are using version 1.3.2, find line 97
    <?php
    $discount 
    $ps_product->get_discount($session_cart[$i]['product_id']);
    ?>


    and add the following code after that line
    <?php
    if(empty($discount['amount'])) {
        
    $sql 'SELECT product_id,product_parent_id,product_special FROM #__vm_product WHERE product_id='.$session_cart[$i]['product_id'];
        
    $db->setQuery$sql );
        
    $rtn $db->loadObject();
        if(
    $rtn->product_special=='Y'$discount['amount'] = 1;
        else {
            
    $sql 'SELECT product_id FROM #__vm_product WHERE product_id='.$rtn->product_parent_id.' AND product_special="Y"';;
            
    $db->setQuery$sql );
            
    $discount['amount'] = $db->loadResult();
        }
    }
    ?>

  • Default avatar
    denis26    
     3 years ago
    0

    Hi seyi,

    please, how to have the same function with the pro version 1.5.2
    in "administrator/components/com_awocoupon/helpersvm_coupon.old.php" I found the line with the code
    $discount = $ps_product->get_discount($session_cart[$i]['product_id']);


    this would be a great feature to keep as simple to use.

    thank you very much
  • Default avatar
    denis26    
     3 years ago
    0

    Hi, it's OK for me !

    I found the post here:
    http://awodev.com/forum/awocoupon/help-section/coupon-product-no-promo#comment-2481

    replace this code in : administrator/components/com_awocoupon/helpers/vm_coupon.php
    $discount = $ps_product->get_discount($session_cart[$i]['product_id']);


    changed by this
    $discount = 0;
    if($ps_product->get_field($session_cart[$i]['product_id'],'product_special')=='Y') $discount = array('amount'=>0.01);


    the system works with version 1.5.2 :)

    an idea :
    that will deserve to be in a future version with a function "exclude products Special Offer" in the management of coupons


    for french user :

    une modification pour ne pas remiser les articles en Offre spéciale afin de mieux gérer les promos ponctuelles.
    s'applique sur la version de awocoupon pro 1.5.2

    explication :
    Les articles qui ont la case "Offre spéciale" de coché dans "statut du produit" ne seront pas concernés par les coupons !

    J'ai trouvé le post ici:
    http://awodev.com/forum/awocoupon/help-section/coupon-product-no-promo#comment-2481

    remplacer ce code dans: administrator / components / com_awocoupon / helpers / vm_coupon.php
    $discount = $ps_product->get_discount($session_cart[$i]['product_id']);


    changé par celui-ci
    $discount = 0;
    if($ps_product->get_field($session_cart[$i]['product_id'],'product_special')=='Y') $discount = array('amount'=>0.01);


    le système fonctionne avec la version 1.5.2 :)

    une idée:
    qui méritera d'être dans une future version d'une fonction "exclure les produits en Offre spéciale" dans la gestion des coupons.