I am developing one upsell app which is going to install in many shopify stores. I am adding Discount Code inside Upsell bundle create form.
1. Bundle created with below detail.
On A target product, we will give Free B upsell product(if user by B product also) with discount code FREEBUY.
So if user purchase B upsell product with A product then i want to apply code FREEBUY in hidden field and show discount on cart page.
2. Free Shipping without entering Discount code (using in hidden field).
Is it possible in cart page to apply Discount code? Can we do it With API or ajax on cart page?