Checkout UI Extension - Buy X Get Y Discount - Read Discount Code

What you could do:

  • Create an automatic discount Buy X Get Y.
  • Create an order discount SUMMERBOGO with 0%
  • Write the UI extension so that it adds product Y to the shopping cart when X is in it and when the code SUMMERBOGO is set

The automatic discount then does the work, SUMMERBOGO is only the trigger.