Could my code be edited so that only the product on the page is checked out and not the entire cart?
Buy Now
A user is seeking help to modify their “Buy Now” button code. Currently, the button adds the selected product to the cart and then redirects to checkout with all cart items included.
Desired Behavior:
Technical Context:
The provided code shows a JavaScript event listener that:
/cart/add.js endpoint/checkoutThe issue is that the current implementation adds the product to the existing cart before checkout, rather than creating an isolated checkout session for just that product. No solutions or responses have been posted yet.
Could my code be edited so that only the product on the page is checked out and not the entire cart?
Buy Now