Shortcodes

As you build your site, it’s likely you’ll want to add products, collections, or clubs to other pages on your website (for instance, your home page, custom collections pages, and custom club pages). The Commerce7 for WordPress plugin comes with numerous shortcodes and custom page builder element settings to help you integrate your data perfectly. The following is a list of our shortcodes, their corresponding element settings, and how to use them.

Default Data

[c7wp]

The base shortcode. This is required on all pages created by this plugin (as discussed in the previous section).

If you are using a page builder, add a Commerce7 element and select default as the type. No further data is needed.

Restrictions: only one content shortcode per page will be populated by Commerce7.

Collections

[c7wp type='collection' data='slug']

This will place a product grid for the specified collection from Commerce7. Replace the word slug in the shortcode with the actual slug of the collection, found here in your control panel:

In our page builder elements, set the type to collection, and the data to the name of the slug.

Restrictions: only one content shortcode per page will be populated by Commerce7.

Add to Cart Button

[c7wp type='buy' data='sku']

This allows you to place an Add to Cart section, perfect for making custom landing pages.

Place the correct SKU from Commerce7 into the data attribute.

By default, Commerce7 will place the price, a quantity field, and a button. You can customize these with CSS.

Example:

Restrictions: none

Personalization Blocks

[c7wp type='personalization' data='code']

This will place a personalization block  from Commerce7. Replace the word code in the shortcode with the actual slug of the personalization block, found here in your control panel:

In our page builder elements, set the type to “personalization”, and the data to the code above.

Content for these blocks is created inside your Commerce7 control panel.

Restrictions: not to be used on default C7 pages. This is best used on landing pages and your homepage.

Newsletter Subscribe Form

[c7wp type='subscribe' data='true']

This shortcode will add a handy newsletter subscribe form for your Commerce7 email marketing list.

If you are using a page builder, add a Commerce7 element and set the type to “subscribe”.

Set Data to ‘true’ to enable First and Last Name Fields. Set Data to ‘false’ to disable First and Last Name Fields.

Restrictions: only one per page will be populated

Login/Logout Link

[c7wp type='login']

This shortcode will add a handy login or logout link to your page. This is best used in your header alongside your primary navigation.

If you are using a page builder, add a Commerce7 element and set the type to “login”.

Restrictions: only one per page will be populated

Cart Total and Flyout

[c7wp type='cart']

This shortcode will add the cart total and link to trigger the flyout cart to your page. This is best suited for your header.

If you are using a page builder, add a Commerce7 element and set the type to “cart”.

Restrictions: only one per page will be populated

Reservation Widget

[c7wp type='reservation' data='slug']

This shortcode will add a reservation widget to your page.

If you are using a page builder, add a Commerce7 element and set the type to “Reservation”. Edit the word slug to match the slug of your reservation type in the Commerce7 admin panel.

Join Now/Edit membership Magic Button

[c7wp type='joinnow' data='slug']

This shortcode will add a magic club button to your page. If your customer is logged in, and a member of the club, the button will change from “join now” to “edit membership”. This is very useful if you have created landing pages for your clubs.

If you are using a page builder, add a Commerce7 element and set the type to “Join/Edit”. Edit the word slug to match the slug of your club in the Commerce7 admin panel.