[ic] Numeric Search
Webmaster Grandfather Clocks Plus
webmaster at grandfatherclocksplus.com
Wed Jun 15 15:32:49 EDT 2005
Thanks! It works. One more question, I have 5 different type of promotions,
one of them is labeled "Special". How do I make a search that will pick up
all the "Special" products. Can't figure it out.
From: interchange-users-bounces at icdevgroup.org
[mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of Kevin Walsh
Sent: Wednesday, June 15, 2005 11:13 AM
To: interchange-users at icdevgroup.org
Subject: RE: [ic] Numeric Search
Mark Bryant [mark at eros-shop.co.uk] wrote:
> At 16:30 14/06/2005, you wrote:
> > I can't seem to figure out how to get this numeric search to work. I
> > have products priced at 0.00 and I want to create a search that will
> > not display them. So I tried this:
> > scan/fi=products/st=db/co=1/sf=suggested_retail/se=0.00/op=>/nu=1/ml
> > =50.html
> > No luck. I was hoping someone knows a way around this.
> Assuming you have a suggested_retail field/col to search on in your
> DB, change the > to gt in the line to get that to work :)
The ">" operator is correct for numeric searches. The "gt" operator would
be for string searches. "0.00" isn't really necessary; "0" will suffice in
a numeric search, but that doesn't really matter. :-)
> Failing that try setting sf=price if your pricing info is stored there.
> Worked for me when I tried it a few mins ago although it doesn't seem
> to take into account TAX settings/values.
It worked for me too, with sf=price, so perhaps there's a problem with the
"suggested_retail" column. Perhaps that column hasn't been defined in the
appropriate dbconf file, or whatever. The search won't take tax into
account; It'll only match the values in the specified column.
A more flexible solution would be to mark products as "inactive". In that
case, they won't appear in search results regardless of any other
parameters. This might be better than setting the price to zero for that
purpose. In your dbconf file, for the products table, you'd add the
following - if not present already:
Database products COLUMN_DEF "inactive=CHAR(1) DEFAULT ''"
Database products HIDE_FIELD inactive
If the "inactive" column is true (not zero and not blank) then the row will
not appear in search results, otherwise it will - depending upon the other
search criteria, of course.
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
interchange-users mailing list
interchange-users at icdevgroup.org
More information about the interchange-users