Top sellers

  • Delete Orders
    Delete Orders

    Enable the option to delete orders in admin page -> orders Also you...

    $0.00
  • CoolShare
    CoolShare

    Add a social bookmarks with mouse over animation.

    $0.00
  • Categories image
    Categories image

    This module allows you to display the block in the category, but with...

    $0.00
  • Mass price update
    Mass price update

    This module allows you to update quantity or percentage, the prices of...

    $0.00

Recent orders (+)

PrestaShop site speed optimization

Received: 07/25/2017 21:43:20
Customer: kumar
Send to: Meaux, France
Order value:$88.25
View all ->
Massive Custom Fields Evolution

Received: 07/19/2017 22:45:35
Customer: Stefano
Send to: Voghera, Italy
Order value:$42.00
View all ->
Mass Price Update Plus

Received: 07/13/2017 16:42:04
Customer: Andrada Mihaela
Send to: Dragasani, Romania
Order value:$50.00
View all ->
Countdown Specials - Flash sales

Received: 06/25/2017 11:16:48
Customer: Joel
Send to: valencia, Spain
Order value:$63.00
View all ->
PrestaSpeed

Received: 06/22/2017 12:05:20
Customer: Fabio
Send to: Milano, Italy
Order value:$55.00
View all ->

In this little tutorial, we'll show you how to create a cart rule that only applies if cart products do NOT belong to a certain category. For example, we wish to have a discount of 10% for the entire catalog, but we do not want that discount applied if the products purchased belong to the category HOT SALE (ID 10).

First we create the discount rule as we normally do, and then modify the CartRule.php file.

The file that is responsible for validating the coupons is the classes / CartRule.php, inside it, there is a function called "checkValidity".

What we will do is add our code to the beginning of this function, but for this we can create a file called CartRule.php inside the folder overrides / classes / and create the override, or directly modify the original file in classes / CartRule.php ( If we update PrestaShop the change is lost and we must do it again). There are hundreds of tutorials to do overrides, so we will focus on the function itself.

The only thing we need to change is the category code that prevents the rule from being applied to apply the Voucher. In this case it is 10