marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

A fog from the sea brings corn to the mills.

- ENGLISH PROVERB


YOU ARE HERE:
using cpshop filters

HOME

CPSHOP

why cpshop?

features

demos

faq

installation guide

using cpshop as your site's homepage

using cpshop filters

using cpshop hooks

support

license

pricing

download area (password required)

CPFAQ

MESSAGE BOARD

EMAIL MARTY
cpshop

Please note: As of Friday, May 3, 2013, cpshop is officially retired, and is no longer for sale. details

using cpshop filters

The most powerful (and the most complicated) addition to cpshop is filters. Filters allow you to limit the products displayed in a store based on certain criteria, and are inserted as if they were store IDs.

Let's say you have 3 designs, each with its own store ID:

  • catid
  • dogid
  • fishid
Instead of displaying your products divided by design, you might want to mix your designs together, and divide the products up by type instead:
  • shirts and sweatshirts
  • mugs
  • everything else
To accomplish that layout, here's what you would enter in the store ID fields on the admin screen:
  • Shirts & Sweatshirts
    catid.all,dogid.all,fishid.all,cpfilter_name:shirt, cpfilter_name:tank+top
  • Mugs
    catid.all,dogid.all,fishid.all,cpfilter_name:mug
  • Everything Else
    catid.all,dogid.all,fishid.all,cpfilter_name:-shirt, cpfilter_name:-mug,cpfilter_name:-tank+top
This, of course, assumes that you actually have terms like "shirt" and "mug" in the names of your products.

There are several types of filters you can use:

  • cpfilter_name:[term to match]
    cpfilter_name:large+mug
    • shows products that include the matched term
    • case-insensitive
    • terms can be combined
    • use + to represent spaces
    • use ~word~ to match a whole term (cpfilter_name:~mug~ will match "large mug" but not "muggy" or "smug")
    • place a - before the term to limit to products that don't match that term (cpfilter_name:-shirt)

  • cpfilter_cost:[price to match]
    cpfilter_cost:14.99 (products that cost 14.99)
    cpfilter_cost:~14.99 (products that cost up to 14.99)
    cpfilter_cost:14.99~ (products that cost 14.99 and up)
    • cost filters can be combined with non-cost filters
    • cost filters cannot be combined with other cost filters

  • cpfilter_type:[producttypenumber]
    cpfilter_type:7 (only ash grey t-shirts)
    cpfilter_type:15, cpfilter_type:80 (only boxer shorts and thongs)
    • available type numbers can be found here
    • type filters can be combined with non-type filters
    • type filters can be combined with other type filters

  • cpfilter_newest:[number of most recent products to show]
    cpfilter_newest:15 (shows the 15 most recently added products)
    • newest filters can be combined with non-newest filters
    • newest filters cannot be combined with other newest filters

  • cpfilter_sort:[sort criteria]
    cpfilter_sort:productname (sort by name)
    cpfilter_sort:productcostup (cheapest at top)
    cpfilter_sort:productcostdown (most expensive at top)
    cpfilter_sort:storeid (by store ID, for multiple-store-ID stores)
    cpfilter_sort:old2new (oldest first)
    cpfilter_sort:new2old (newest first)
    • sort filters override default product thumbnail sort method
    • sort filters can be combined with non-sort filters
    • sort filters cannot be combined with other sort filters

  • cpfilter_template:[filename]
    cpfilter_template:catstore.html
    cpfilter_template:templates/catstore.html
    • sets a customized template for a specific store and all of its products
    • file must end in one of the following extensions: .htm, .html, .txt, .tmpl, .tpl, .template
    • filename root is the cpshop directory
    • filename can include sub-directories (i.e. templates/template1.txt)
    • filename cannot include multiple dots in succession (i.e. ../filename.html)
    • template filters can be combined with non-template filters
    • template filters cannot be combined with other template filters

  • cpfilter_template:[columns]
    cpfilter_columns:4
    • forces display to specified number of columns
    • overrides admin setting
    • columns filters can be combined with non-columns filters
    • columns filters cannot be combined with other columns filters

  • cpfilter_rowsperpage:[rows]
    cpfilter_rowsperpage:5
    • forces page numbers if more than specified number of rows are necessary
    • overrides admin setting
    • rowsperpage filters can be combined with non-rowsperpage filters
    • rowsperpage filters cannot be combined with other rowsperpage filters

  • cpfilter_literal
    cpfilter_literal (displayed as is, with no parameters)
    example: if you entered store1/123,store2/456,store3/678,cpfilter_literal as an entry, the store would display three thumbnails, linking to each of those three entries individually, instead of combining their contents into one large section
    • forces display of entered sections instead of processing
    • can only be used in conjunction with premium shop sections
    • can not be combined with basic shops and premium shop main pages

  • cpfilter_inherit
    cpfilter_inherit (displayed as is, with no parameters)
    • causes filters to persist throughout subsections
    • common usage: use mystoreid,cpfilter_inherit,cpfilter_columns:2 to display every thumbnail page in a store with 2 columns (not just the first page)

  • cpfilter_killsection:[section number to kill]
    cpfilter_killsection:347285
    • prevents a particular subsection from being displayed
    • if the subsection to be killed is below the top level, then must be used with cpfilter_inherit
    • can be entered multiple times to block multiple subsections

Using the three fake example store IDs above, here are some more examples:
  • Newest 5 Small Mugs, Newest Mugs First
    catid.all,dogid.all,fishid.all, cpfilter_name:mug, cpfilter_name:-large, cpfilter_newest:5, cpfilter_sort:new2old
  • Headwear Under $17
    catid.all,dogid.all,fishid.all, cpfilter_name:~cap~, cpfilter_name:~hat~, cpfilter_name:~visor~, cpfilter_cost:~16.99
  • Only Products With "Cat" In The Name
    catid.all,dogid.all,fishid.all, cpfilter_name:~cat~
  • 15 Newest Items In Alphabetical Order
    catid.all,dogid.all,fishid.all, cpfilter_newest:15, cpfilter_sort:productname