I have an expresso store that we've set up with a "Buy x get y discount". But it's not working as expected as it only works if you buy multiples of the same product. This is not really useful, it needs to apply to all the products selected for that promo code.
This is the intended behavior of how that discount type works. If you go to the Discount Settings you will see a field called Matched On with the options of either Entry ID or SKU. This is what Store uses to match the particular product to apply the discounts on. Think of it as buy 2 shovels get 50% off a 3rd shovel. This assumes you have set the Step Quantity at 2, Discount Quantity at 1 and Percent Discount at 50. If a user adds 6 of that item to the cart they will receive a discount on the 3rd and 6th of that item since the Discount Quantity is set to 1.
You will need to develop your own discount type or extend the current discount type for your use case. You can browse through the current discount logic in
/store/src/Adjuster/DiscountAdjuster.php to get a starting point. Developing your own extension would probably be the best option as it gives you the most control and prevents Store updates from overwriting your changes. The adjustments hook would probably be the best option for you.