try creating another column in the cart object, eg product category.if that particular category is in the cart, then apply the discount code

If I do that the discount will be applied to the cart sub-total and we only want the discount to affect products which are marked for discount.


