Shortcode reference

Six shortcodes. Every one of them can be copied from the admin rather than typed, and all but the newest have a permanent older name that still works, so nothing you pasted into a page years ago has to be touched.

Old names keep working forever. Every shortcode below except [bangcart_checkout], which arrived in 3.7.0, has a legacy alias from before the plugin was renamed. Both spellings do exactly the same thing, so there is never a reason to go back through your pages editing them.

[bangcart_button]

The Add to basket button for one product. Copy it from the Products page: each product's Copy shortcode menu hands it over as Add to basket button. Legacy name: [ssc_button].

[bangcart_button id="apple-pear-chutney"]
AttributeDefaultWhat it does
idemptyThe product id, exactly as it appears on the Products page. Required.
labelemptyOverrides the button text for this one placement. Left blank, it uses your shop-wide Add-to-basket label from the Design tab.

If the id is missing, or does not match a product, the page shows a small amber note explaining why. Only logged-in administrators see it. A customer sees nothing at all, because a broken shortcode is your problem to fix, not theirs to read about.

[bangcart_cart]

The basket trigger, placed wherever you want it: a header, a builder layout, a widget area. It opens the same one basket the floating corner button opens, and wears the same icon and count bubble. Copy it from the Design tab. Legacy name: [ssc_cart].

[bangcart_cart size="28"] [bangcart_cart size="24" color="inherit"]
AttributeDefaultWhat it does
size28Icon height in pixels. Clamped between 16 and 80. 28 suits most headers.
colorbrandbrand wears your Button colour from the Design tab. inherit takes the colour of the surrounding text instead, which usually reads better in a header.

You can use this alongside the floating corner button, which is the sensible way to try it: place it in your header, see how it looks, and only then switch the corner button off. Every count bubble on the page shows the same number.

When your shop is closed this renders nothing at all. Not hidden, gone.

One honest limit. Classic WordPress navigation menus do not run shortcodes inside menu items, so pasting this into a menu label will not work. Headers built in a page builder, widget areas and block themes all run it perfectly well.

[bangcart_price]

Prints a product's current price, read live from the Products page. Use it instead of typing a figure into your page, so changing a price in one place changes it everywhere. Copy it from the product's Copy shortcode menu on the Products page. Legacy name: [ssc_price].

[bangcart_price id="apple-pear-chutney"] [bangcart_price id="apple-pear-chutney" tag="h3" size="24" weight="700" colour="accent"]
AttributeDefaultWhat it does
idemptyThe product id. Required.
wasyesDuring a shop-wide sale, shows the old price struck through beside the new one. Set to no to hide it.
tagspanThe HTML element to use. Allowed: span, p, div, h1 to h6. Anything else falls back to span.
classemptyExtra CSS classes, on top of bangcart-price.
fontemptyheading or text use your shop's font zones. inherit sets nothing. Any other value is treated as a font family name, which your page must already be loading.
sizeemptyA bare number is read as pixels. Otherwise px, rem, em, pt and % are accepted.
weightempty100 to 900 in hundreds, or normal, bold, lighter, bolder.
colour / coloremptyaccent, button, or a hex value such as #2a80c2. Both spellings work; colour wins if you somehow set both.

A value that is not understood is ignored rather than guessed at, so a typo in size leaves the price at its inherited size instead of shrinking it to nothing.

The price it prints reflects your shop-wide sale, and only the sale. Quantity tiers and order-value rules from Pro depend on what else ends up in the basket, so the shortcode cannot know them in advance - during one of those promotions the page can understate the final discount, but it never promises one that does not happen. For a Pro customer-set-price product it prints nothing at all, because there is no fixed price to print.

[bangcart_description]

Prints a product's description, read live from the Products page, with the formatting you gave it there - bold, italic, links, lists and line breaks. A product synced from Stripe shows Stripe's plain text, with its line breaks. It has no styling of its own, so it takes your page's font and colour. Copy it from the product's Copy shortcode menu (Description on its own). Like the price, change the words on the Products page and every page using it follows.

[bangcart_description id="apple-pear-chutney"]
AttributeDefaultWhat it does
idemptyThe product id. Required.
classemptyExtra CSS classes, on top of bangcart-description.

A product with no description shows customers nothing. You, logged in, see a short note saying why, as you do for a mistyped id.

[bangcart_thank_you]

The order confirmation customers land on after paying. Takes no attributes. Legacy name: [ssc_thank_you].

[bangcart_thank_you]

Put it on a page of its own, then nominate that page on the General tab under Settings, in Thank-you page. There is a Create the page for me button there if you would rather not do it by hand.

Nominating the page is what matters. Without it, Stripe sends customers back to your home page and they never reach the shortcode at all.

It shows the customer their order reference, what they bought, the total, how they paid, and either their delivery address or your collection details. It does this only for a real completed payment, and only for 24 hours afterwards. After that the same address shows a plain thank-you with nothing personal on it. The page is never cached and never indexed while it is carrying an order.

[bangcart_checkout]

The page that carries Stripe's payment form when checkout happens on your own site. Takes no attributes, and has no legacy name - it arrived in 3.7.0.

[bangcart_checkout]

You will rarely place this one by hand. On the General tab under Settings, under Where customers pay, a button creates the page and puts the shortcode on it in one press. Pressing it twice does not make a second page.

This shortcode ships in the free plugin, but only Bang! Cart Pro fills it. The free plugin has no embedded payment form to put on the page - customers pay on Stripe's own site, and the page renders a note saying so to you and nobody else. With Pro, the same page carries Stripe's form inside your header and footer, and your address bar never changes. See Checkout on your own site.

[bangcart_products]

A grid or list of your products on any page, each with an Add to basket button - or, with one product named in ids, a single product card that fills its column. Set the grid's look on the Design tab under Product grid, and the single card's under Single product card; the attributes below override those settings for one page only. Legacy name: [ssc_products].

[bangcart_products] [bangcart_products layout="list" columns="2"] [bangcart_products ids="gift-box,hamper"] [bangcart_products ids="plum-chutney" card="right"]
AttributeDefaultWhat it does
layoutDesign tabgrid or list.
columnsDesign tabOne to four columns, in grid layout.
imageDesign tabno hides the image here even if it is on in the settings.
idsemptyA comma-separated list of product ids. Shows exactly those, in that order, and overrides the per-product hide switch. One id on its own makes a single product card.
cardDesign tabA single card's layout: left (picture left), right or stacked. Ignored on a grid of several.
textDesign tabA single card's text: left or center.

This shortcode ships in the free plugin, but only Bang! Cart Pro draws the grid and the cards. Without Pro it shows customers nothing and tells you it needs Pro. The easiest way to get a card is the product's Copy shortcode menu, which writes the shortcode for you. See The product grid and single product cards.

[bangcart_sale_banner]

A banner announcing your shop-wide sale. Takes no attributes; everything about it comes from the Discounts tab. Legacy name: [sale_banner], which is the spelling the admin's copy button still hands out.

[bangcart_sale_banner]

It renders nothing at all unless a shop-wide sale is switched on with a percentage above zero, so you can leave it permanently in your template and it will appear and disappear on its own. Its message and text colour are set beside the sale itself; leave the message blank and it reads "20% off everything".

Copying rather than typing

Every shortcode the admin shows you can be clicked to copy, including ones woven into a line of help text. Each product's Copy shortcode menu on the Products page gives you its button, price and description (and, with Pro, a product card), with the product's id already filled in. The button turns green with a tick when the copy has worked, so you never have to select a shortcode by hand.

Still stuck?

Write to me and it is me who answers, not a ticket queue. Tell me what you expected and what happened instead.

Ask a question

Bang! Creative Family

Bang! Plugins is part of a small UK creative group, so the plugins are made and backed by people who do this for a living.