Products shortcode

The Prodigy Products shortcode allows you to display a list of specific products in either a slider or grid view.  This shortcode is demonstrated on our demo home page in the featured products section.

sc-products-slider.png

Example Usage

Show specific products by ID in three columns with ordering

[prodigy_products product_ids="1,2,3" columns="3" orderby="id" order="ASC"]

Show all products with a specific Tag in slider view

[prodigy_products tags="featured" display="slider"]

Show all products in specific Categories that are on sale in grid view

[prodigy_products category_ids="1,2" display="grid" on_sale="true"]

Available Attributes

product_ids

Accepts a list of comma separated Product IDs to display.  You can find the Product IDs in the WordPress Admin by navigating to Prodigy -> Products and looking for the ID column.

[prodigy_products product_ids="1,2,3"]

category_ids

Accepts a list of comma separated Category IDs and displays all products in those categories.  You can find the Category IDs in the WordPress Admin by navigating to Prodigy -> Categories and looking for the ID column.

[prodigy_products category_ids="1,2"]

product_names

Accepts a list of comma separated Product Name slugs to display.

[prodigy_products product_names="atomic-endurance-running-tee, layla-tee"]

columns

Determines the number of product columns per row that will be displayed.  The default value is 4 columns per row if not specified.

[prodigy_products columns="3"]

limit

Limits the number of products returned.  For example, if the other attributes specified in the shortcode match 8 products and the limit attribute is set to 4, then only the first 4 matching products will be displayed.

[prodigy_products limit="4"]

tags

Accepts a comma separated list of product tags and displays all products associated with those tags.

[prodigy_products tags="featured,sale"]

orderby

Allows you specify the order in which the products will be displayed.  Acceptable values are: id, title, price, date, rating

[prodigy_products orderby="price"]

order

Determines if the sort order will be ascending or descending.  Acceptable values are: ASC, DESC

[prodigy_products orderby="price" order="ASC"

on_sale

Allows you to restrict the returned products to only those that are on sale.  Acceptable values are:  true, false.  If set to true, only matching products that are currently on sale will be displayed.  If set to false, all matching products will be displayed regardless of sale status.  Default if false.

[prodigy_products on_sale="true"]

display

Determines if products will be displayed in slider or grid view.  Acceptable values are:  slider, grid.  Default it slider.

[prodigy_products display="grid"]

Template Override

The template used by this shortcode can be overridden by copying the template into your theme or child theme and then editing.

Copy from:

prodigy-commerce/templates/partials/shortcode/feature_products.php
prodigy-commerce/templates/partials/shortcode/feature_products_grid.php

Copy to:

<your-theme>/prodigy/shortcode/feature_products.php
<your-theme>/prodigy/shortcode/feature_products_grid.php