The shopping cart in the Web Store mode comes with four shortcodes. In the Inquiry Catalog mode the same shortcodes display the quote cart and the inquiry form.
- [cart_button] – displays the shopping cart button with the number of products in the cart. For a logged-in customer with a previous cart, it shows the Restore Previous Cart button instead.
- [shopping_cart] – displays the current cart contents, where the customer can change quantities, and the buttons to go to checkout or back to the products
- [cart_submit_form] – displays the order summary and the checkout form set up in the shopping cart settings
- [success_page] – displays the thank you page output after the order is submitted
Shortcodes on the cart pages
When you assign the shopping cart pages, the cart, checkout and thank you output is added to them automatically. You don’t have to place the shortcodes there.
Use the shortcodes when you want more control over the layout, for example to add your own content above or below the cart. You can also place them on any other page of your website.
Display Cart in website menu or header
With the Shopping Cart PRO extension, a cart icon can be added to the main menu together with the catalog sitewide icons. See Cart Icon in Main Menu and Catalog icons inside main menu.
To display the cart button in your theme header, add the following line to the PHP code of your theme header.php file (preferably in a child theme), where you want the cart to be displayed:
echo do_shortcode( '[cart_button]' );If you place it outside of an existing PHP block, wrap it in the PHP opening and closing tags. You can also show the cart in a sidebar with the Shopping Cart Widget.
