How to create a Ruby script for discounts and free shipping?

HI Matt, Thanks for the reply.

We will identify the products using their product id’s. Customer will get 30% off on the product bundle.

Lets say there is product A in cart. but there is not product D → In such scenario there will be no discount

But if there is product A and Product D in cart then customer will get 30% off on cost of product A and D together.

Product A is $100 and product D is $50 then customer will get 30% off on $150.

If there Product A and D are found in customers cart then they will get FREESHIPPING as well.

The country zone for the same will be only USA and Canada.

in short → product A + product D in customers cart = 30% off + freeshipping (only for USA and Canada)