Shortcodes included with WooCommerce

WooCommerce comes with several shortcodes that can be used to insert content inside posts and pages.

 

Page Shortcodes

  • [woocommerce_cart] – shows the cart page
  • [woocommerce_checkout] – shows the checkout page
  • [woocommerce_my_account] – shows the user account page
  • [woocommerce_order_tracking] – shows the order tracking form

In most cases, these shortcodes will be added to pages automatically via our onboarding wizard and do not need to be used manually.

Cart

Used on the cart page, the cart shortcode displays cart content and interface for coupon codes and other cart bits and pieces.

Args: none

[woocommerce_cart]

Checkout

Used on the checkout page, the checkout shortcode displays the checkout process.

Args: none

[woocommerce_checkout]

My Account

Shows the ‘my account’ section where the customer can view past orders and update their information. You can specify the number of orders to show. By default, it’s set to 15 (use -1 to display all orders.)

Args:

array(
     'current_user' => ''
 )
[woocommerce_my_account]
Current user argument is automatically set using get_user_by( ‘id’, get_current_user_id() ).

Order Tracking Form

Lets a user see the status of an order by entering their order details.

Args: none

[woocommerce_order_tracking]