A WooCommerce plugin focused on price-based product sorting. It extends the WooCommerce products
shortcode and adds support for sorting by price (cheapest first or most expensive first), with unlimited results by default. It also supports sorting by custom meta fields.
Features
- Price-first design: sort by price using
orderby="price"
- Wrapper for WooCommerce’s
products
shortcode - Supports sorting by custom meta fields (numeric)
- Uses WooCommerce’s native product display system
Usage
Basic Shortcode
[my_products]
With Parameters
[my_products category="packets" limit="8" columns="4"]
Parameters
This shortcode supports all standard WooCommerce products
shortcode attributes, with emphasis on price sorting:
category
– Product category slug (optional)limit
– Number of products to display (default: unlimited)columns
– Number of columns for product display (default: 4)orderby
– Order products by. Useprice
for price sorting (default: rand)price
– Sort by product price (use withorderby="price"
, numeric)order
– Order direction (default: DESC)ids
– Comma-separated list of product IDsskus
– Comma-separated list of product SKUson_sale
– Show only products on sale (true/false)best_selling
– Show only best-selling products (true/false)top_rated
– Show only top-rated products (true/false)
Note: When using orderby="price"
, sorting is numeric based on the _price
meta key.
Sorting by Price (Primary Use Case)
You can sort products by their price by setting orderby="price"
. This maps to the _price
meta key and sorts numerically.
Example :
[my_products orderby="custom_field_name" order="ASC"]
Price Examples :
[my_products orderby="price" order="ASC"] (Cheapest first)
[my_products orderby="price" order="DESC"] (Most expensive first)
[my_products category="clothing" orderby="price" order="ASC" limit="12"]
Custom Meta Field Sorting (Optional)
You can sort by custom meta fields by specifying the meta field name in the orderby
parameter. Sorting is numeric.
Standard sorting options: menu_order
, title
, date
, rand
, id
Custom meta fields: Any custom field name (numeric sort)
Examples
[my_products orderby="price" order="ASC" limit="10"]
[my_products orderby="price" order="DESC" category="electronics" columns="3"]
[my_products category="clothing" orderby="price" order="ASC" limit="12"]
[my_products limit="12" columns="3"]
[my_products on_sale="true" orderby="price" order="ASC"]
[my_products orderby="custom_priority" order="ASC" limit="10"]
Reviews
There are no reviews yet.