You are here:  » merchant as rows and columns

Support Forum



merchant as rows and columns

Submitted by Syed on Sat, 2009-10-10 10:06 in

Hi David,

Could you please show me how to display merchants in rows and columns in merchants.php like in the demo site(http://www.webpricecheck.co.uk/merchant/).

Note:I have already implemented to display the logos of the merchants in the merchants.php as in http://www.pricetapestry.com/node/1323

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 11:09

Hi Syed,

It's the $columns variable on line 3 of html/atoz.php:

  $columns = 1;

Simply change that to the number of columns you want. Note that this will affect the merchant, category and brand index pages as they all use the same file. If you only wanted the merchant index to use columns, you could REPLACE the above line with the following code;

  if (strpos($_SERVER["PHP_SELF"],"merchants.php")!==FALSE)
  {
    $columns = 3;
  }
  else
  {
    $columns = 1;
  }

Cheers,
David.

Submitted by Syed on Sat, 2009-10-10 11:57

Hi David,

I replaced the code and cleared the cache and cookies still there is only one column. Could you please check what i did wrong?

{code saved}

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 12:18

Hello Syed,

It is possible that $_SERVER["PHP_SELF" is not set in your configuration. As an alternative, try:

if (strpos($sql,"feeds")!==FALSE)
{
$columns = 2;
}
else
{
$columns = 1;
}

Cheers,
David.

Submitted by Syed on Sat, 2009-10-10 12:37

Hi David,

Unfortunately, it didn't work...

{code saved}

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 13:06

Hi Syed,

Could you double-check that merchants.php is using html/atoz.php; have a look in the file for the following code around line 39:

  require("html/atoz.php");

If that looks OK, as a second test could you try just setting $columns = 2; without the IF statement and confirm that it has affected all index pages...

Cheers,
David.

Submitted by Syed on Sat, 2009-10-10 13:19

Hi David,

The merchants.php does not have atoz.php. Where do i need to add in the code?

{code saved}

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 13:25

Hello Syed,

Ah, that would explain it. I've modified your custom version of merchants.php to include the table / column code from atoz.php; have a go with this;

{code saved}

Cheers,
David.

Submitted by Syed on Sat, 2009-10-10 14:58

Hi David,

The alphabetical merchant logos are all displayed in a single row i.e A B C D E F...

Can we able to make it as

A B C

D E F

and so on?

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 15:27

Hi Syed,

The new table cell code can be moved out of the per-letter loop so that they appear as you described. Try this;

{code saved}

Note that I also commented out the letter display so that all logos line-up...

Cheers,
David.

Submitted by Syed on Sat, 2009-10-10 16:21

Hi David,

Unfortunately this too didn't work. All the logos are displayed in a single line. I have sent you an email with screen shot.

Thanks,
Syed

Submitted by support on Sat, 2009-10-10 17:49

Thanks, Syed - I'll follow up by email...

Cheers,
David.