On my product page I want to have a single button that combines 'add to cart' and 'checkout'. I'm finding the documentation a bit hard to follow. Currently my button looks like this and just adds the item to the cart:

<input type="submit" name="submit" value="Add To Cart" class="btn btn-primary" />
  • What do you want to happen when they click the button? Do you want it to go straight to your payment gateway? Dec 12 '12 at 9:50

You can add a return parameter to your product opening tag to force the user to a specific page when they add the item to the cart.

{exp:store:product entry_id="{entry_id}" return="checkout/template"}
 <input type="submit" name="submit" value="Checkout Now" class="btn btn-primary" />

Since you control the entire process you can direct them to your checkout templates. You can not however send them to the gateway automatically when they add an item to the cart. So you could not have a user add an item to the cart and direct them to PayPal automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.