Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
For a selected product, we offer another product as a bundle. To do this, we are already successfully loading the corresponding product via the Metafields. With the AddToCart routine, we then insert both products into the customer's shopping cart.
But now we also want to grant a discount, for this we get the discount (in percentage points) from the Metafields and now want to apply it within Hydrogen to the two affected product lines (i.e. the product A + the corresponding bundle product) in the shopping cart.
How do we do this concretely? Unfortunately, we have not made any progress with the explanations online. Except for applying the discount, everything is solved.