<dpd-add-to-cart>
<dpd-add-to-cart> is a button that adds a product to the cart and opens
the drawer. Use it when you’ve already got your own product page and just
need the button.
Whatever you put inside it is the button’s label. Leave it empty for “Add to cart” in your store’s language.
<dpd-add-to-cart product="163005"></dpd-add-to-cart><dpd-add-to-cart product="163005">Get the ebook</dpd-add-to-cart>Attributes
Section titled “Attributes”| Attribute | |
|---|---|
product |
Required. The product’s ID. |
price-point |
The ID of one of the product’s prices. Leave it off for the default price. |
quantity |
How many to add. Defaults to 1. |
store |
The store to sell from. See More than one store. |
Upsells, license agreements and cross-sells
Section titled “Upsells, license agreements and cross-sells”If the product has an upsell, a license agreement or a cross-sell set up in the admin, the button shows it in a dialog before (or after) the product goes in the cart, the same as the hosted cart does. Try these two: the first offers an upgrade, and the second asks you to accept a license.
<dpd-add-to-cart product="119694">Weeknight Sauces</dpd-add-to-cart><dpd-add-to-cart product="3062">Weekly Meal Planner</dpd-add-to-cart>The button says Sold out, and can’t be clicked, when the product is out
of stock. Its part is button.