Find Products Block - CrystalCommerce Liquid Documentation for Designers

Find Products Block

Example

{% find_products name_includes:'Lightning Bolt' in_stock do products order:sell_price reversed %}
  <table border="0" class="invisible-table" width="100%">
    {% include 'product' with products %}
  </table>
{% endfind_products %}

Search Options

Option Name Format Description Example
tagged_with /\A'?([^']+)'?\z/ products must be tagged with one of the tags specified
{% find_products tagged_with:'cats,dogs,horses' do products %}
created_at_gte,
created_at_lte,
created_at_eq
YYYY-MM-DD or variable
/\A'?(\d{4}-\d{2}-\d{2})'?\z/
products created at after, before or on a date
{% find_products created_at_gte:2013-01-31 do products %}
Will find all products created on or after January 31st, 2013.
name variable or string
/\A'?([^']+)'?\z/
products with a name matching this exactly
{% find_products name:'Lotus Cobra' do products %}
Will find the product "Lotus Cobra", but not the product "Lotus Cobra - Foil"
{% assign product_name = 'Lotus Cobra' %}
{% find_products name:product_name do products %}
Will find the product "Lotus Cobra", but not the product "Lotus Cobra - Foil"
name_like variable or string
/\A'?([^']+)'?\z/
products with a name including this
{% find_products name_like:'Cobra' do products %}
Will find the products "Lotus Cobra", and "Lotus Cobra - Foil"
category_name variable or string
/\A'?([^']+)'?\z/
products in a category named exactly this
{% find_products category_name:'Zendikar' do products %}
Will find the products in the "Zendikar" category
hive_category_id variable or integer
/\A'?([\d\.]+)'?\z/
products in the hive category with the ID of this
{% find_products hive_category_id:189 do products %}
Will find the products in the "Magic Singles" category
sell_price_gte,
sell_price_lte
variable or money
/\A'?\$?([\d\.]+)'?\z/
products with a sell price greater than, or less than to this
{% find_products sell_price_gte:$5.00 sell_price_lte:$10.00 do products %}
Will find all products with a sell price greater than $5 and less than $10
buy_price_gte,
buy_price_lte
variable or money
/\A'?\$?([\d\.]+)'?\z/
products with a buy price greater than, or less than to this
{% find_products buy_price_gte:$5.00 buy_price_lte:$10.00 do products %}
Will find all products with a buy price greater than $5 and less than $10
descriptor_[NAME] variable or string
/\A'?([^']+)'?\z/
products with a descriptor named [NAME] with value this
{% find_products descriptor_Rarity:'Mythic Rare' do products %}
Will find all products with a rarity of "Mythic Rare"
{% find_products descriptor_Card_Type:'Planeswalker' do products %}
Will find all products with a card type of "Planeswalker"
total_qty_gte,
total_qty_lte,
variable or integer
/\A'?([\d\.]+)'?\z/
products with a total qty greater than, or less than to this
{% find_products total_qty_gte:2 total_qty_lte:20 do products %}
Will find all products with at least 2 in stock, but no more than 20.
wtb_qty_gte,
wtb_qty_lte,
variable or integer
/\A'?([\d\.]+)'?\z/
products with a wtb qty greater than, or less than to this
{% find_products wtb_qty_gte:1 wtb_qty_lte:20 do products %}
Will find all products with at least 1 on the buy list, but no more than 20.
in_stock only return products which are in stock
{% find_products in_stock do products %}
order top_sellers,
name,
sell_price,
buy_price,
created_at
order the results by one of the options. Defaults to name.
{% find_products order:name do products %}
limit variable or integer
/\A'?([\d\.]+)'?\z/
Maximum number of products to return. Default is 10. Maximum is 100.
{% find_products do products limit:25 %}
reversed reverse the order of the results returned
{% find_products do products order:name reversed %}
Will order by name descending (Z-A)