Add the following shortcode to a page or post to give it an order form:
Without any attributes, it will create an order form based on the settings you saved in the WooCommerce admin. You can refine your order form by adding any of the following attributes (see the example pages).
Show only products from the selected product category. You can use either the product category ID (numeric) or its category name or slug. e.g. for a product category “Books on Toys”, the category slug might be “books-on-toys”.
Separate multiple categories with commas, e.g. “wine,beer,cider”
Changes how category titles are collated and displayed on the order-form-by-category template, when a product has multiple categories including parents and children; default = “leaves”, accepted values are:
- leaves — only show the children, not their parents
- roots — only show the parents, not their children
- all — show all listed categories
Add CSS classes to order form table, e.g. classes=”my-custom-class another-class”
Change the button title for the Clear Order button.
Exclude products from the order form by product ID.
Separate multiple product IDs with commas, e.g. exclude=”51,52,53″
Include only selected products on the order form by product ID.
Separate multiple product IDs with commas, e.g. include=”51,52,53″
Show a checkbox for Sold Indidually products by setting individual=”checkbox”.
Change the column title for the item name, e.g. itemtitle=”Book Title”.
Show products ordered either ascending (ASC) or descending (DESC) using the orderby method.
Show products ordered in a specific way. By default, products are sorted by their WooCommerce custom order and then by name. This attribute accepts the values specified in the WordPress codex for post queries.
To sort by SKU, use
orderby="sku"for alphabetic order,
orderby="sku_numeric"for numeric order
Change the column title for the price.
Change the column title for the quantity.
Change link text for the “Reset selection” link on variation selections.
responsivecss=1 will make the form utilise responsive design on small screens, responsivecss=0 won’t. Omit this attribute to use the general settings.
Change the column title for the row total, if shown.
Show product images in the order form. showimages=1 will display images, showimages=0 won’t.
Show product short description under the product title. showshortdesc=1 will display the short description, showshortdesc=0 won’t.
Show out-of-stock products in the order form. showoutofstock=1 will show out-of-stock products, showoutofstock=0 won’t.
Link to the product’s page from the product title. showproductlink=1 will show a link, showproductlink=0 won’t.
Show a row total for each product in the order form. showrowtotal=1 will show the row total, showrowtotal=0 won’t.
Show the stock level on products with inventory management. showstock=1 will show the stock level, showstock=0 won’t.
Show the subtotal row at the bottom of the form. showsubtotal=1 will show the subtotal row, showsubtotal=0 won’t.
Where to redirect on submit; default = “checkout”, accepted values are:
- cart — show the shopping cart
- checkout — go straight to the checkout
- form — return to the order form
Change the button title for the Place Order button.
Change the row title for the subtotal row, if shown.
Show only products with the selected product tag. You can use either the product tag ID (numeric) or its slug.
Separate multiple tags with commas, e.g. “birds,reptiles”
The default template is “order-form”, but you can create custom templates in your theme and select them with this attribute.
Separating product rows into one row per variation by setting variations=”separate”.
NB: does not currently show separate rows for attributes that don’t affect the price, e.g. colour. That feature is coming soon!