You are here:  » Installed master categories


Installed master categories

Submitted by henk on Mon, 2006-11-06 22:42 in

Hi

When you followed this link choose a slave category and go to the following page there is an error.

What can i do about it.

Cheers Henk

Submitted by support on Tue, 2006-11-07 08:13

Hello Henk,

I can't get an error to occur from that page - all the brand filter pages and subsequent product pages seem to be working ok....

Can you post a direct link to a page that shows the error?

Thanks,
David.

Submitted by Henk3001 on Tue, 2006-11-07 09:04

ok here is the link: link

and pres next or page 2, it gives the whole list of products.

Cheers

HEnk

Submitted by support on Tue, 2006-11-07 09:40

Hello Henk,

I see what is happening, your brandFilter parameter is not included on the 2/3/Next etc. links. This needs to be fixed in html/navigation.php.

Line 16:

$prevHREF = "?q=".urlencode($q)."&page=".$prevPage."&sort=".$sort;

change to:
$prevHREF = "?q=".urlencode($q)."&page=".$prevPage."&sort=".$sort."&brandFilter=".urlencode($_GET["brandFilter"]);

Line 62:

$pageOneHREF = "?q=".urlencode($q)."&page=1&sort=".$sort;

change to:
$pageOneHREF = "?q=".urlencode($q)."&page=1&sort=".$sort."&brandFilter=".urlencode($_GET["brandFilter"]);

Line 75:

$pageHREF = "?q=".urlencode($q)."&page=".$i."&sort=".$sort;

change to:
$pageHREF = "?q=".urlencode($q)."&page=".$i."&sort=".$sort."&brandFilter=".urlencode($_GET["brandFilter"]);

Line 99:

$nextHREF = "?q=".urlencode($q)."&page=".$nextPage."&sort=".$sort;

change to:
$nextHREF = "?q=".urlencode($q)."&page=".$nextPage."&sort=".$sort."&brandFilter=".urlencode($_GET["brandFilter"]);

That should do the trick,
Cheers,
David.

Submitted by Henk3001 on Tue, 2006-11-07 09:53

Worked :)

Thx
Henk

Submitted by hansi on Tue, 2006-11-07 16:23

Hello,

how did you code this "Totaal aantal artikelen in onze database: 12312" in ?
Can you this explain to me?
Thanks!

Submitted by support on Tue, 2006-11-07 16:27

Hi Hani,

There is code to get the product count in this thread:

http://www.pricetapestry.com/node/367

To include it on a page and not as its own script, you can just to the following:

<?php
  $sql 
"SELECT count(*) as numProducts FROM `".$config_databaseTablePrefix."products`";
  
database_querySelect($sql,$rows);
  
$numProducts $rows[0]["numProducts"];
  print 
"<p>Total products in database: ".$numProducts."</p>";
?>

Cheers,
David.

Submitted by Henk3001 on Wed, 2006-11-08 20:41

only one thing it lost the merchant name when you click on the filter by brand NEW Link

Thx

HEnk

Submitted by support on Thu, 2006-11-09 15:24

Hi Henk,

That's the same cause - the merchant name must be added to the links generated by html/navigation.php. Based on having already made the changes above:

Line 16:

$prevHREF = "?q=".urlencode($q)."&amp;page=".$prevPage."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"]);

change to
$prevHREF = "?q=".urlencode($q)."&amp;page=".$prevPage."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"])."&amp;merchant=".urlencode($_GET["merchant"]);

Line 62:

$pageOneHREF = "?q=".urlencode($q)."&amp;page=1&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"]);

change to
$pageOneHREF = "?q=".urlencode($q)."&amp;page=1&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"])."&amp;merchant=".urlencode($_GET["merchant"]);

Line 75:

$pageHREF = "?q=".urlencode($q)."&amp;page=".$i."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"]);

change to
$pageHREF = "?q=".urlencode($q)."&amp;page=".$i."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"])."&amp;merchant=".urlencode($_GET["merchant"]);

Line 99:

$nextHREF = "?q=".urlencode($q)."&amp;page=".$nextPage."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"]);

change to
$nextHREF = "?q=".urlencode($q)."&amp;page=".$nextPage."&amp;sort=".$sort."&amp;brandFilter=".urlencode($_GET["brandFilter"])."&amp;merchant=".urlencode($_GET["merchant"]);

Cheers,
David.

Submitted by henk on Fri, 2006-11-10 20:38

works great :)

But is it possible to have it under each other left from the products ,and alphabetical

edit:

got them on the left side, the only thing now is under each other and alphabetical.

Thx HENk

Submitted by henk on Sat, 2006-11-11 09:54

Again an edit:

Only alphabetical :)

Thx Henk

Submitted by support on Sat, 2006-11-11 12:30

Hi Henk,

Do you mean that instead of using a 1..2..3 Next etc. navigation that you want an alphabetical navigation? Would you not also want the paged navigation as well; incase there were many product beginning with a certain letter?

There's some code in the following thread for creating an A-Z index of categories - the same technique can also be applied to the brand index...

http://www.pricetapestry.com/node/266

Cheers,
David.

Submitted by Henk3001 on Sat, 2006-11-11 15:26

Nope i use the brand as a category on the left see link but i want to sort them out under each other only alphabetical.

Thx
Henk

Submitted by support on Sat, 2006-11-11 19:18

Hello Henk,

I understand. What you need to is simply to add the following SQL to the SQL statement that is selecting the categories:

ORDER BY category

In other words, instead of the SQL you are using now try this:

$sql = "SELECT DISTINCT(category) as category FROM `".$config_databaseTablePrefix."products` ORDER BY category";

Cheers,
David.