Created
September 28, 2016 05:10
-
-
Save hongc-cc/9da1b030a7313312f1a2f67689ecb4c3 to your computer and use it in GitHub Desktop.
[CraftCMS] Comparing the cart products to the discount coupon applied.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// collect productIds in the cart | |
{% set currentDiscount = craft.commerce.getDiscountByCode(order.couponCode) %} | |
{% if currentDiscount %} | |
{% if not cartProductIds in currentDiscount.productIds %}You have no products in the cart that meet this discount{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment