IN – Will display products with the chosen attribute.AND – Will display products from all of the chosen attributes.terms_operator – Operator to compare attribute terms.terms – Comma-separated list of attribute terms to be used with attribute.attribute – Retrieves products using the specified attribute slug.Not to be used in conjunction with on_saleor best_selling. top_rated – Retrieve top-rated products.Not to be used in conjunction with on_sale or top_rated. best_selling – Retrieve the best selling products.Not to be used in conjunction with best_sellingor top_rated. class – Adds an HTML wrapper class so you can modify the specific output with custom CSS.order – States whether the product order is ascending ( ASC) or descending ( DESC), using the method set in orderby.tag – Comma-separated list of tag slugs.category – Comma-separated list of category slugs.skus – Comma-separated list of product SKUs.rand – Randomly order the products on page load (may not work with sites that use caching, as it could save a specific order).menu_order – The Menu Order, if set (lower numbers display first).date – The date the product was published.One or more options can be passed by adding both slugs with a space between them. orderby – Sorts the products displayed by the entered option.Defaults to false set to true to paginate. columns – The number of columns to display.Defaults to and -1 (display all) when listing products, and -1 (display all) for categories. limit – The number of products to display.They have been split into sections for primary function for ease of navigation, with examples below. The following attributes are available to use in conjunction with the shortcode. Available Product Attributes ↑ Back to top The shortcode allows you to display products by post ID, SKU, categories, attributes, with support for pagination, random sorting, and product tags, replacing the need for multiples shortcodes such as, ,, ,, and, which are needed in versions of WooCommerce below 3.2. The shortcode is one of our most robust shortcodes, which can replace various other strings used in earlier versions of WooCommerce. These are easier to configure than shortcodes, so if you are using the WordPress block editor, you may want to read more about WooCommerce Blocks first. Note: Since version 3.6, WooCommerce Core includes several product blocks. By default, it’s set to 15 (use -1 to display all orders.) You can specify the number of orders to show. Shows the ‘my account’ section where the customer can view past orders and update their information. Used on the checkout page, the checkout shortcode displays the checkout process.Īrgs: none My Account ↑ Back to top Used on the cart page, the cart shortcode displays cart content and interface for coupon codes and other cart bits and pieces.Īrgs: none Checkout ↑ Back to top In most cases, these shortcodes will be added to pages automatically via our onboarding wizard and do not need to be used manually. Woocommerce_order_tracking – shows the order tracking form Woocommerce_my_account – shows the user account page Woocommerce_checkout – shows the checkout page Note: You can now test the new cart and checkout blocks that are available in the WooCommerce Blocks plugin! WooCommerce cannot function properly without the first three shortcodes being somewhere on your site. For example, by adding id="99" to the shortcode, it will create an add-to-cart button for the product with ID 99. These are ways to make the shortcode more specific. Several of the shortcodes below will mention “Args”. If you are using the classic editor, you can paste the shortcode on the page or post. If you are using the block editor, there is a shortcode block you can use to paste the shortcode in. Shortcodes can be used on pages and posts in WordPress. How to use shortcodes ↑ Back to top Where to use ↑ Back to top To make sure that our products are the best they can be, we regularly conduct research studies with our customers – and we’d love to add your voice to the conversation. Help us shape the Future at WooCommerce! Our team is always working to build tools that will help your business to succeed and feedback plays a vital role in that process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |