How do buttons work
- Add to Cart button helps customers select and store products in their shopping cart so they can continue browsing or shopping before completing the purchase.
- View Cart button helps customers review the items they add, modify quantities, and proceed to checkout.
Prerequisites
- PayPal business account
- Website HTML access
Create shopping cart buttons
- Log in to your PayPal Business Account.
- In the left navigation, select Pay & Get Paid > Create Shopping Cart Buttons.
- Enter the details in the Product, Checkout, and Confirmation tabs.
- Select Build it.
- Copy the generated code snippets to place the buttons on your website. A downloadable PDF with detailed instructions is available on this page.
- Select More Actions > Settings > Cart buttons to customize button appearance and preview the customization.
Note: If you select Settings while you are still building a button, the editor is replaced by the Settings page, and any unsaved changes are lost.For more information on customization, see Customize checkout.
Add shopping cart buttons
Add both the View Cart and Add to Cart buttons after you create your shopping cart buttons so the cart works correctly.Add the View Cart button
- Open your website editor.
- Copy the Part 1 View Cart code from the UI:
- Paste it once into your site’s
<head>on each page. - If you can’t edit the
<head>, paste it at the top of the<body>.
- Paste it once into your site’s
- Copy the Part 2 View Cart code:
- Paste it into a visible location in the
<body>that appears on every page, such as the site navigation. - You can paste Part 2 in more than one location if needed.
- Paste it into a visible location in the
- Save your changes.
Add the Add to Cart button
- Open your website editor.
- In the page’s
<body>, paste the Add to Cart button code where you want it to appear, ideally near the product. - Save changes.
- Repeat steps for each product on the page.
Test buttons
Test the workflow to ensure the buttons function correctly.- Refresh your website to confirm all buttons appear correctly.
- Make a test purchase on your site.
- Verify the transaction in your PayPal account.
- Refund the test transaction when finished.
Common issues
Site builder doesn’t expose the HTML<head>
- If your site builder doesn’t allow access to the
<head>, paste the Part 1 code at the top of your page’s<body>, above the Part 2 code.