The [purchase_link] short code is used to display a purchase button for any download anywhere your site. The button / link that is outputted will add the specified digital product to the shopping cart.
The short code accepts a few optional parameters:
- id – the ID number of the download for the button
- sku – the assigned SKU value for the download (if enabled)
- price – whether to show the product price or not. 1 to show it, 0 to hide it.
- text – the text displayed on the button
- style – the style of the purchase link, either “button” or “text”
- color- the color of the button (when using the “button” style”:
- dark gray
- class – one or more custom CSS classes you want applied to the button
- price_id - the variable price ID to create a purchase button for
- direct – whether the purchase button should send the customer straight to PayPal or to the checkout screen.
[purchase_link id="94" text="Add to Cart" style="button"]
A purchase button for a specific price option:
[purchase_link id="94" text="Add to Cart" style="button" price_id="2"]
Direct Purchase Example
[purchase_link id="94" text="Buy Now" style="button" direct="true"]