How can I apply a discount in a shopping cart to non-like products

I have a few data types (over simplified for this example)

Products

  • name
  • price

User

  • order

Orders

  • list of products
  • recipient

I want to have create a discount that is like buy 3 get a 10% discount per item. BUT I want to be able to mix and match for the discount. The mix and match part is confusing for me. Any ideas here my fellow bubblers?

Happy to answer questions for additional context as needed.

Hey Jared,

DId you find the solution? I am also struggling with something similar, I am happy to exchange

I wrote a plugin to handle this stupid heavy lifting.

I have done something similar in my app.
I have created a field on my products type (yes,no) and named it for example 10%.
And all the products that qualify to this offer made it (yes).
In my cart page I did the following workflow.
Update every 1 second > if do search for cart> created by current user > 10% is yes > count >=3 … update group cart state> total
Total = group cart total × 10 ÷ 100

Or, instead of applying 10% on grand total, that might cause a problem if u want the rest of products I cart to be in full price. U might better make a field in each product ( full price) , ( discount price). And in every product u fill the full and discount price. Even if the product doesn’t qualify, u make the discount price as full price.
Then u do the same workflow but instead of the percentage calculation. U do custome state total>
Total = do search for card’s products’ discount price’sum