Coupon visibility in the cart


  • Default avatar
    marcin    
     8 years ago
    0

    How to hide the coupon code in the cart. Each coupon I create is visible in the cart, if I've got several active coupons they all are listed below the coupon checkbox in the cart.
    I'm workinkg on prestashop 1.6
    In the base presta coupon module there's a position named highlight which makes the coupon visible or not in the cart.
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Coupon is visible in the cart if you select a specific customer or shopper group. If you do not make these selections then coupon is not visible in the cart. There is no feature to disable this when creating the coupon, but you can disable the feature completely removing the override. Do you want to do that?
  • Default avatar
    marcin    
     8 years ago
    0

    Explain please what do you mean by "completely removing the override".
    I don't want the coupons to be visible in the cart.
  • Your avatar
    seyi    
     8 years ago
    0

    in www/override/classes/Cart.php, there is the function getCustomerCartRules. If you update the first line in the function to
            return parent::getCustomerCartRules($id_lang,$id_customer,$active,$includeGeneric,$inStock,$cart,$free_shipping_only,$highlight_only);


    Then no coupons from AwoCoupon should be displayed for logged in customers any more.
  • Default avatar
    christophe2    
     8 years ago
    0

    Hi,

    I'm facing exactly the opposite issues.

    My codes are never displayed below the cart details. (even if i select all groups of customer)

    How can I display a code below the cart details to "promote" the code ?

    Thanks.
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    As long as you have selected either a customer or a group, which the customer belongs to, the coupon should show in the cart.
  • Default avatar
    james01    
     8 years ago
    0

    I'm trying to do this as well, but there isn't a function getCustomerCartRules in my Cart.php file. I do see it in the CartRule.php but can't get it to work. What is the procedure with the CartRule.php file?

    I'm running prestashop 1.6.1.2

    Thanks
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    You are correct it is in CartRule.php not Cart.php.

    It should work. Ok revert back to the original override. do you see the line:
    <?php
    $available_cart_rules 
    parent::getCustomerCartRules($id_lang,$id_customer,$active,$includeGeneric,$inStock,$cart,$free_shipping_only,$highlight_only);
    ?>


    Right after that add this:
    <?php
            
    return $available_cart_rules;
    ?>


    That will stop any AwoCoupon coupons showing in the cart.
  • Default avatar
    james01    
     8 years ago
    0

    Hi, You're solution worked! Thanks!