View Categories

Shortcodes in PublishPress Cart

PublishPress Cart has shortcodes that put checkout forms, receipts, a store, customer accounts and order details on any page. Use them when you don’t want to use a block, or when you build with a page builder.

Most shortcodes are in PublishPress Cart Free. A few need PublishPress Cart Pro, and the list below says which.


Before you start #

You need:

  • PublishPress Cart Free or Pro installed and active. The shortcodes marked Pro in All shortcodes at a glance need PublishPress Cart Pro.
  • A place for the shortcode: a Shortcode block, the classic editor or a page builder text widget.
  • A product ID for shortcodes that use one. Find it in Cart → Products. The products list also has a button that copies the product’s checkout shortcode.

All shortcodes at a glance #

ShortcodeWhat it showsVersion
[ppcart_form]A checkout form for one productFree
[ppcart_receipt]The order details on a thank-you pageFree
[ppcart_store]A grid of your productsFree
[ppcart_account]The customer account areaFree
[ppcart_account_link]A link to the account pageFree
[ppcart_account_order_detail]One orderFree
[ppcart_account_subscription_detail]One subscriptionFree
[ppcart_order_downloads]The files for an orderFree
[ppcart_order_detail]One detail of an order, as textFree
[ppcart_plan]One detail of a payment plan, as textFree
[ppcart_product]A product name or limit, as textFree
[ppcart_customer_bought_product]A purchase check, for developersFree
[ppcart_customer_has_subscription]A subscription check, for developersFree
[ppcart_checkout_form] and the [ppcart_account_*] embedsCheckout and account blocks as shortcodesFree
[ppcart_order_summary_items_view]The order summary items in the Split-in checkoutPro
[ppcart_affiliate_dashboard]An affiliate’s dashboardPro
[ppcart_affiliate_signup]The affiliate application formPro
[ppcart_wpdomainchecker]A domain search that leads to checkoutPro

Checkout form #

Shows the checkout form for a product.

[ppcart_form id="42" plan="monthly" coupon="VIP20" hide_labels="hide" template="2-step"]
AttributeWhat it does
idThe product ID. If you leave it out, Cart uses the product page the shortcode is on.
planSelects a payment plan when the form loads. Use the plan’s ID or its URL slug.
couponApplies a coupon code to the form.
hide_labelsSet to hide to hide the field labels.
templateThe checkout layout: normal, 2-step, opt-in or split-in. If you leave it out, Cart uses the layout set on the product. split-in needs Pro.

Use it on any page or post. After a customer buys and lands on the page with ppcart-order in the URL, the shortcode shows the product’s confirmation message and receipt instead of the form.


Receipt #

Shows the order details on a thank-you page: items, discounts, tax, shipping and total.

[ppcart_receipt]

It has no attributes. It needs ppcart-order in the page URL, so a Perform redirect confirmation must include ppcart-order={order_id}. It only shows to an admin, the customer who placed the order, or a visitor with the order’s link token.


Store #

Shows a grid of your products with pagination.

[ppcart_store cols="4" posts_per_page="8" button_text="Buy now"]
AttributeWhat it doesDefault
button_textThe text on each product button.Purchase
purchased_textThe button text for customers who already bought a product.Already Purchased
posts_per_pageHow many products to show per page.12
colsHow many columns, usually 3 or 4.3

Customer account #

Shows the customer account area. A logged-in customer sees tabs for orders, subscriptions, installment plans and their profile, plus downloads when the files feature is in use. A logged-out visitor sees the login form.

[ppcart_account]
AttributeWhat it does
tabShows one tab only: order-history, subscriptions, plans or user-profile.
hide_loginSet to true to hide the login form from logged-out visitors.

Put this shortcode on the page you choose as the My Account Page in Cart → Settings. Cart uses that page for links in emails and in the account link.


Account link #

Shows a link to the customer account page. It doesn’t show on the account page itself, or when no account page is set.

[ppcart_account_link label="Manage your orders"]
AttributeWhat it doesDefault
labelThe link text.My Account

Order and subscription details #

Show one order or one subscription from the customer’s account. The customer must be logged in and own the order or subscription.

[ppcart_account_order_detail order="123"]
[ppcart_account_subscription_detail plan="456"]
ShortcodeAttributeWhat it does
[ppcart_account_order_detail]orderThe order ID. If the page URL has ppcart-order, the URL wins.
[ppcart_account_subscription_detail]planThe subscription ID. If the page URL has ppcart-plan, the URL wins.

Order downloads #

Shows the download links for the files in an order. Use it on a thank-you page.

[ppcart_order_downloads show-title="0"]
AttributeWhat it doesDefault
idThe order ID. By default Cart reads it from ppcart-order in the URL.From the URL
fullInclude files from upsells and related orders. Use 0 to turn it off.On
show-titleShow the “Downloads” heading. Use 0 to turn it off.On

Order details as text #

Shows one piece of information about an order, as plain text. Use it on a thank-you or upsell page.

[ppcart_order_detail field="customer_firstname"]
field valueWhat it shows
order_idThe order number
customer_firstnameThe customer’s first name
customer_lastnameThe customer’s last name
customer_nameThe customer’s full name
customer_emailThe customer’s email
customer_phoneThe customer’s phone number
order_listThe items, as a list
order_inline_listThe items, on one line
order_amountThe order total
product_amountThe product amount

Always set field. The shortcode only shows to the customer who placed the order, or an admin.


Plan details as text #

Shows one piece of information about a payment plan, as plain text.

[ppcart_plan product_id="42" plan_id="abc123" field="price"]
AttributeWhat it doesDefault
product_idThe product the plan belongs to. If you leave it out, Cart uses the current page.Current page
plan_idThe plan’s ID or URL slug. Required.None
fieldThe detail to show, such as name, price, initial_payment, interval, frequency, trial_days or installments. Recurring-only details work only on recurring plans.name

The price field is formatted with your currency.


Product details as text #

Shows a product’s name or limit, as plain text.

[ppcart_product id="42" field="name"]
AttributeWhat it doesDefault
idThe product ID. If you leave it out, Cart uses the product being checked out.Current checkout
fieldname or limit.name

Purchase and subscription checks #

These two shortcodes don’t show anything useful on a page. They return an ID, or nothing, so developers can use them in code with do_shortcode() to check whether a customer has bought something.

do_shortcode('[ppcart_customer_bought_product user_id="5" product_id="42"]');
do_shortcode('[ppcart_customer_has_subscription user_id="5" product_id="42"]');
Attribute[ppcart_customer_bought_product][ppcart_customer_has_subscription]
emailYesYes
user_idYesYes
product_idYesYes
plan_idYesYes
ip_addressYesNo

Page builder embeds #

These shortcodes show the checkout and account blocks, so you can use them where blocks are not available.

ShortcodeWhat it shows
[ppcart_checkout_form]The checkout form. It uses id, plan and coupon only.
[ppcart_account_page_builder]The login form, navigation and all account tabs together.
[ppcart_account_navigation]The account tab navigation.
[ppcart_account_tab component="account-subscriptions"]One account tab.
[ppcart_account_orders]The orders tab.
[ppcart_account_subscriptions]The subscriptions tab.
[ppcart_account_payment_plans]The installment plans tab.
[ppcart_account_profile]The profile tab.
[ppcart_account_downloads]The downloads tab. It needs the files feature.
[ppcart_account_login]The login form.

For [ppcart_account_tab], the component attribute is one of account-orders (the default), account-subscriptions, account-payment-plans, account-profile or account-downloads.

The account tabs show only to logged-in customers. Cart also has matching Elementor widgets for each of these.


Order summary items #

This section requires PublishPress Cart Pro.

Shows the order summary items inside a product’s own content. Use it with the Split-in checkout layout, for example [ppcart_form template="split-in"], and put the shortcode in the product’s description where the summary should appear.

[ppcart_order_summary_items_view]

It has no attributes. It works only on the Split-in layout, so on other layouts it shows as plain text.


Affiliate dashboard and sign-up #

This section requires PublishPress Cart Pro with the Affiliate extension turned on.

[ppcart_affiliate_dashboard]
[ppcart_affiliate_signup]
  • [ppcart_affiliate_dashboard] shows an affiliate’s earnings, products, commissions, payouts and recent visits. Put it on a page for logged-in affiliates. Visitors who are not affiliates see a message that they need to be an affiliate.
  • [ppcart_affiliate_signup] shows the application form: name, email, PayPal email, website and bio. Put it on a public page.

Neither shortcode has attributes.


Domain checker #

This section requires PublishPress Cart Pro and the WPDomainChecker plugin.

Shows a domain search that sends the customer to your product’s checkout with the chosen domain filled in.

[ppcart_wpdomainchecker ppcart_item_id="42"]
AttributeWhat it does
ppcart_item_idThe product ID the customer is sent to. Required.

Tips for using shortcodes #

  • Put quotation marks around every attribute value.
  • Check that the product ID is correct. A wrong ID shows nothing.
  • Test pages that use ppcart-order by completing a test order, because the shortcode needs a real order in the URL.
  • If a shortcode shows as plain text on the page, check that it is spelled exactly as shown, and that the feature it needs, such as Pro or the Affiliate extension, is active.