Skip to content

Shortcode for cart toggle button

You can use the shortcode below to add cart toggle button any sections of your webpage:

php
[gocart_cart_toggle_button label="Hello World!" class="gocart__woo-hello-world" id="gocart__woo-hello-world" icon="icon-2" icon_position="right" display_badge="yes" badge_position="top-right"]
[gocart_cart_toggle_button label="Hello World!" class="gocart__woo-hello-world" id="gocart__woo-hello-world" icon="icon-2" icon_position="right" display_badge="yes" badge_position="top-right"]

Following are the parameters of the above shortcode:

  • label: Sets the button label.
  • class: Sets CSS classes of the button.
  • id: Sets id property of the button.
  • icon: Displays icon in the button. Values are none, icon-1, icon-2, ..., and icon-12. When none is set, hides the icon.
  • icon_position: Position for the icon in the button. Set either left or right.
  • display_badge: Displays cart items count badge in the button. Set yes to display the badge, else set no.
  • badge_position: Sets the position of cart items count badge in the button. Set either, top-right, top-left, bottom-right, or bottom-left.

Go Cart.