You are here:  » Filter model

Support Forum



Filter model

Submitted by henk on Sat, 2007-03-03 11:25 in

Hi,

When you follow this link you see there is a long list of Model: 9500 Communicator.

Is it possible to filter it to one product.

Thx Henk :)

Submitted by support on Sat, 2007-03-03 13:41

Hi Henk,

Just had a look at the page, and there is (of course) difference in all the product names which accounts for the long list.

Seeing as the phone network is shown in the description ("Contractduur:") would it be possible to register your model field as the product name instead of the actual combined product name?

Cheers,
David.

Submitted by henk on Sat, 2007-03-03 14:27

Hi David,

I tried that but then when i import 4500 products there will be 45 over.
Double names problem.

Thx
Henk

Submitted by support on Sun, 2007-03-04 09:05

Hi Henk,

Perhaps you can combine 2 fields with the Text After filter to get more products but less than the original results. Model Number + Network is often used on mobile phone sites, so by registering Model Number as the product name you could setup a Text After filter something like:

 %NETWORK%

^--- note the leading SPACE

Cheers,
David.

Submitted by henk on Sun, 2007-03-04 11:37

Yes i could do that but then the compare is gone by product model and i want that also.
Its now comparing by name and or model.

So is it possible to filter by model also :)

Thx HEnk

Submitted by support on Sun, 2007-03-04 12:06

Hi Henk,

I'm afraid I'm not quite sure what you're wanting to do here. Do you mean to add the "model" field as an option in the drop-down box on the filters page, so that you can use Drop Record against it?

Cheers,
David.

Submitted by henk on Sun, 2007-03-04 12:15

Hi David,

No when you look at the link there are a lot of model: 9500 Communicator

Is it possible to filter it to one result.

Thx Henk

Submitted by support on Sun, 2007-03-04 20:07

Hi Henk,

Is "model" a field in your database (I know you have made changes to your field)? It might be possible to add a DISTINCT clause to the search SQL...

Cheers,
David.

Submitted by henk on Sun, 2007-03-04 20:19

Hi David,

Yes its a field in the database.

Thx
Henk

Submitted by support on Sun, 2007-03-04 21:19

Hi Henk,

The SQL to perform the product selection for a category: query is on line 45 of search.php in the distribution:

        $sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE ".$where." GROUP BY name";

To enforce a distinct model number, try changing this as follows:

        $sql = "SELECT * , DISTINCT(model), MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE ".$where." GROUP BY name";

Alternatively, this may provide better results:

        $sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE ".$where." GROUP BY name,model";

Cheers,
David.

Submitted by henk on Sun, 2007-03-04 21:52

i got two errors,
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/linkik.com/subdomains/telecomvergelijk/httpdocs/includes/database.php on line 21

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/linkik.com/subdomains/telecomvergelijk/httpdocs/includes/database.php on line 26

Henk

Submitted by support on Sun, 2007-03-04 21:54

Hi Henk,

Is it the same with both variations?

Submitted by henk on Sun, 2007-03-04 21:57

Hi Davis

no the last one there is no change.

Henk

Submitted by support on Sun, 2007-03-04 22:00

Thanks Henk, i'll have more of a think on this one...

Submitted by Henk3001 on Tue, 2007-03-06 13:48

Ok

Henk