Open/Close Menu WordPress & WooCommerce Plugin & Theme Development

WooCommerce comes with several shortcodes which can be used to insert content inside posts and pages. The following shortcodes are inserted into pages upon installation and therefore shouldn’t need to be used anywhere else.

shows the cart page


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

shows the checkout page

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

shows the order tracking form

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

shows the user account page

[woocommerce_my_account order_count=”12″]Shows the ‘my account’ section where the customer can view past orders and update their information. You can specify the number or order to show, it’s set by default to 15 (use -1 to display all orders.)

Recent products

[recent_products per_page=”12″ columns=”4″]Lists recent products – useful on the homepage. The ‘per_page’ shortcode determines how many products to show on the page and the columns attribute controls how many columns wide the products should be before wrapping.

Featured Products

[featured_products per_page=”12″ columns=”4″]Works exactly the same as recent products but displays products which have been set as “featured”. In this example, the shortcode is saying show 12 featured products in 4 columns.

Single Product

[product id=”99″][product sku=”FOO”]Show a single product by ID or SKU.


[products ids=”1, 2, 3, 4, 5″][products skus=”foo, bar, baz” orderby=”date” order=”desc”]Show multiple products by ID or SKU. Make note of the plural ‘products’.

Add to cart

[add_to_cart id=”99″]Show the price and add to cart button of a single product by ID.

Add to cart URL

[add_to_cart_url id=”99″]Echo the URL on the add to cart button of a single product by ID.

Product category

[product_category category=”appliances”]Show multiple products in a category by slug.

Product page

[product_page id=”99″][product_page sku=”FOO”]Show a full single product page by ID or SKU.

Product Categories

[product_categories number=”12″ parent=”0″]Display product categories loop

Sale Products

[sale_products per_page=”12″]List all products on sale

Best Selling Products

[best_selling_products per_page=”12″]List best selling products on sale

Top Rated Products

[top_rated_products per_page=”12″]List top rated products on sale

Related Products

[related_products per_page=”12″]List related products

You can find more info about this topic on WooCommerce docs

© 2017 CodeNegar | Made with love.
Follow us: