You are here:  » Product search result page and top 10 page

Support Forum



Product search result page and top 10 page

Submitted by cq on Fri, 2010-01-15 09:15 in

Hello David,

When I click on a merchant A at merchant page, it will brings me to product results page of merchant A.
At the product search result page i will see all the products of merchant A.

Question.

1. How can i add merchant A info in the output page. For instances Merchant A - all/any selected categories or all brand/any selected brands in product search result page of merchant A. (If i click merchant B it wll auomatically do the same).

2. Based on below, the script will show me the top 10 search. How can i add numbers instead of just show the the results. For example

1. blaa
2. computer
3. pc
4. ....
until
10. cloth

How can we use the $offset, $rownum function. If limit is 10 it will display 10. If LIMIT is 5 it will display 5. Is it possible?
Alternatively can we use .css instead ie 1.gif............... 10.gif into the script.
Also it is applicable to top 10 brand, top 10 category, top 10 stores.

<?php
  $sql 
"SELECT * FROM querylog ORDER BY id DESC LIMIT 10";
  if (
database_querySelect($sql,$rows))
  {
    foreach(
$rows as $row)
    {
      
$url $config_baseHREF."search.php?q=".urlencode($row["query"]);
      print 
"<width='280'  href='".$url."'>".$row["query"]."&nbsp | &nbsp;";
          }
  }
?>

thanks.
jack

Submitted by support on Fri, 2010-01-15 16:27

Hello Jack,

Just to answer your second part quickly (question 1 will need more detail) you can display a number simply by using HTML's ordered list tags; for example:

<?php
  $sql 
"SELECT * FROM querylog ORDER BY id DESC LIMIT 10";
  if (
database_querySelect($sql,$rows))
  {
    print 
"<ol>";
    foreach(
$rows as $row)
    {
      
$url $config_baseHREF."search.php?q=".urlencode($row["query"]);
      print 
"<li><a href='".$url."'>".$row["query"]."</a></li>";
    }
    print 
"</ol>";
  }
?>

Or to use images/1.gif etc,; try:

<?php
  $sql 
"SELECT * FROM querylog ORDER BY id DESC LIMIT 10";
  if (
database_querySelect($sql,$rows))
  {
    
$i=1;
    foreach(
$rows as $row)
    {
      
$url $config_baseHREF."search.php?q=".urlencode($row["query"]);
      print 
"<img src='".$config_baseHREF."images/".$i.".gif' /><a href='".$url."'>".$row["query"]."</a>";
      
$i++;
    }
  }
?>

Hope this helps!

Cheers,
David.

Submitted by cq on Fri, 2010-01-15 18:01

Hello David,

Question 2 done. many thanks.

For Question 1.

When i go merchant a-z page and then click merchant A. It will show me all merchant A products ( example merchant A has 500 products). This page has the title of "product search results for merchant A (showing 1 to 10 of 500)".

Apart from showing all the 500 products. I would like to display all the categories or brands of this merchant A with product counts. Alternatively I may want to pick only selected categories or brands of this merchant to be displayed. It can top 10 categories or brands of merchant A.

Example

Merchant A (merchant A logo)
Category 1 (200) Brand 1 (50)
Cateogry 2 (150) Brand 2 (100)
Category 3 (50) Brand 3 (200)
Cateogry 4 (100) Brand 4 (150)
etc.. etc...

Basically I wanted to show of each merchant how many categories and brands they have with product counts.

Hope this is clear.

thanks
jack

Submitted by cq on Fri, 2010-01-15 18:13

Hello David,

Alternative way is..

create a merchantinfopage.php.
From merchant A-Z page, when click each and any one of the merchant it will jump to merchant info page before go to "product search results page for merchant". The merchant info page has the info of the example mentioned above.

Also from the main page, we can add a merchant logo, when we click, it will also go to the merchant info page as well.

Hope this method can be explore.

thanks
jack

Submitted by lunen on Mon, 2010-01-18 17:35

Hi David,

I'm also interested in a feature like this... maybe just not as complex. I have many users telling me they click on a merchant and then they find 4000 products listed for the merchant and stop searching. I would just like to list the categories along side of merchant results page so it would be easier to shop. In the sidebar I'd have a Heading that said "Shop By Category" then have the code list the categories below for that selected merchant.

I'm sure everyone would love this feature. Thanks in advance.

JT

Submitted by support on Mon, 2010-01-18 17:38

Thanks, JT and Jack - i'll take a look at this for you...

Cheers,
David.

Submitted by Keeop on Tue, 2010-01-19 11:48

Hi,

Are you guys after something like this - a store profile?

Store profile for Kiddicare

You can then pretty much add anything to the profile for that particular merchant. I have done this by removing the option to search for products by a particular merchant and instead checked for the presence of 'merchant' in the search string within serch.php and then added some custom code.

i.e.

 if ($parts[0] == "merchant")
    {
        $sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` WHERE merchant='".$parts[1]."'";
        if (database_querySelect($sql,$rows))
        {
          foreach($rows as $feed)
          {
           BLAH, BLAH, BLAH...........
          }
        }
     }

You can then of course put anything there for that particular merchant, such as category, brand, product counts etc.

Cheers.
Keeop