[Prestashop] Function where it is defined whether the coupon is applicable or not


  • Default avatar
    riga75    
     a year ago
    0

    I am developing a custom module that tells me if a product is discountable or not with a coupon.
    So I need to know what function tells me whether the coupon is applicable to an individual product.

    thanks a lot

    stefano
  • Your avatar
    seyi    
     a year ago
    0

    As close as:
    file modules/awocoupon/awocoupon/library/class-awocoupon-library-discount.php
    function is_coupon_valid

    That function checks all the products in the cart.  There is no function to check a specific product
  • Default avatar
    riga75    
     a year ago
    0

    OK, but how do you check whether an item in the shopping cart is discounted?
  • Your avatar
    seyi    
     a year ago
    0

    There is an object created by AwoCoupon that holds all the information.  You can call it with:
    <?php
    $coupon_session 
    AC()->storediscount->get_coupon_session();
    ?>