Price Compare Syntax
Datafeed Studio offers a quick search syntax that can be used in the following places :
- Wordpress plugin
- Edit Product screen - 'Price Compare this Product' option
- 'Shortcode Search' on main admin Search screen
- PHP API get_products() call (advanced usage)
With the quick search syntax you can combine multiple search options in just one line of text, e.g.
+xbox +360 -elite | min_price=50 max_price=100 exclude_merchants=1,2,3
Would search your product database for products that contain the words "xbox" and "360" but would omit entries that contain the word "elite".
The separator bar (pipe character '|') after the search term indicates that extra options follow. You can omit the bar and extra options if you don't need them for the search you want to perform.
Extra options have the syntax name=value (note that spaces aren't allowed). Separate multiple extra options with a space.
Glossary of Available Extra Options
- cf
- Indicates a custom field, e.g. if you have created a custom field in your database named "colour", the option cf=colour:red would include products that have this custom field with the value of 'red'. Note the special custom field syntax of "cf=field name:field value". Multiple "cf" options can be included in one search, e.g. "+notebook | cf=colour:black cf=hdsize:60GB". If your custom field has a space in it, then substitute the spaces with plus signs, e.g. cf=colour:dark+blue
- description
- Only return products that contain the value (anywhere) in their description field, e.g. description=guitar. If you want to search for a phrase then plus signs between each word, e.g. description=bass+guitar
- exclude_merchants
- Comma separated list of datafeed IDs to exclude from the search results, e.g. exclude_merchants=1,2,3. Handy for excluding Argos :-p
- include_custom
- If set to 'on', custom products will also be included in the search results, e.g. include_custom=on
- in_stock_only
- If set to 'on', only products marked as 'In Stock' will be included in the search restuls, e.g. in_stock_only=on
- max_price
- Maximum price of products to include, e.g. max_price=100
- max_results
- Maximum number of results to return, e.g. max_results=25
- min_price
- Minimum price of products to include, e.g. min_price=50
- model_number
- Only return products that contain this value (anywhere) in their model_number field, e.g. model_number=S900
- mykey_query
- Only return the product with this key, e.g. "mykey_query=123_12345678"
- one_per_merchant
- Only return one product per merchant, e.g. "one_per_merchant=on"
- only_merchants
- Comma separated list of datafeed IDs to restrict the search to, e.g. only_merchants=59,92
- order_direction
- Direction of sorted results, one of "asc" or "desc" depending on preferred order, e.g. order_direction=desc.
- order_field
- Field which to sort results by, e.g. order_field=p.display_price to sort by price, or order_field=d.merchant_name to sort by the name of the merchant.
- category_id
- Only return products that are in this (AUTO) category (ID can be found from the Category tab at the admin site)
- sub_category_id
- Only return products that are in this (AUTO) subbcategory (ID can be found from the Category tab at the admin site)