In Total version 5.2 we added a new shortcode named
[cart_link] which can be used to display a cart link with the number of items currently in the cart and the subtotal. This shortcode can be used in various areas of the theme such as the Top Bar or Header Builder as well as added inside menu items.
Basic example of using the shortcode:
[cart_link items="icon,count,total" link="true"]
The shortcode accepts a few attributes for customization.
|Comma separated list of items to display||icon,count,total|
|Whether to add a link to the cart or not||true|
|Extra classnames to be added to the element||null|
|Custom size for the icon||null|
|Custom side margin for the icon||null|
|Custom font size to apply to the element||null|
|Custom font family to apply to the element||null|
It’s also possible to access this element in the WPBakery for use in Dynamic Templates, Header Builder, etc.
Using the Shortcode in Menus
It’s also possible to use the shortcode in your WordPress menus via a “Custom Link” (you can use it and disable the default theme shop icon if you prefer). The only important thing is that you must disable the link because WordPress menus already have links, sample usage:
Developer Hooks (Filters)
The following filters are available for developer usage:
|Allows you to override the icon html||$icon|
|Allows you to override the Item text||$text|
|Allows you to override the Items text||$text|