We are working with a client that wants the shopper to click on a Free Gift which takes them directly to the information checkout page (Done). We did this by using the following code on the product page
<input type="hidden" name="return_to" value="/checkout/" />
Problem: if the shopper clicks on the logo and returns to home page they can select a second gift and checkout with 2 gifts. Looking for a code that will force the cart to never exceed qty of 1.
Since we are skipping the cart we can not use an app. Open to suggestions. The theme we are using is Debut.
You may iterate over the cart line items to check if it contains more than 1 gift items, you can display alert and prevent checkout