Create shopping cart button
Create shopping cart buttons and add them to your website.
Last updated: June 3, 2026
Estimated time: 5 minutes
You can add Add to Cart and View Cart buttons to your website without building a custom integration. Use the PayPal Business Dashboard to define product details, pricing, and checkout behavior, then copy the generated code snippets into your site. You can also customize the layout and styling of your buttons to match the look and feel of your website and brand.
- 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.
- Log in to your PayPal business account.
- In the navigation menu, 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 both the View Cart and Add to Cart buttons after you create your shopping cart buttons so the cart works correctly.
- 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>.
- 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.
- Save your changes.
- 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 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.
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.