Hi,
You said:
if the customer adds both product B and product C to the cart, I want a discount (or coupon) to be applied only to product C
I think this is possible with the coupon conditions plugin and clever use of existing coupon restrictions:
www.hikashop.com/marketplace/product/292-coupon-conditions.html
First, you want to create a coupon restricted to product C. With its "Coupon percentage applies to product only" setting activated, the value / percentage of the coupon will apply only to product C and product C will have to be in the cart for the coupon to apply.
www.hikashop.com/support/documentation/i...p-discount-form.html
And in the settings of the coupon conditions plugin, you can then select that coupon, and add the condition:
{product.product_id} == XX
where XX is the id of product B, and with the "OR" logic selected.
This means that the condition applied by the plugin will allow the use of the coupon only if product B is in the cart.
You can even configure several conditions for the same coupon in the plugin to create more complex rules.