There isn't enough detail about how your app data is modeled to answer your specific question. However, here is a general way to solve this problem.
In you product inventory table add fields for discount quantity and discount price (hoodie: 2 and 50).
Bring in those values into your transaction table as lookups. If the quantity sold = the discount pricing, using the discount pricing otherwise use the full price.
IF({Quantity Sold}={discount quantity (from Product)},
{Discount Quantity Price (from Product)}, {Normal Price})