You are here:  » External.php - Is there a way to display only 5 products on an individual page?

Support Forum



External.php - Is there a way to display only 5 products on an individual page?

Submitted by Stew on Tue, 2010-09-28 14:59 in

Hi there, Im using PT external on a wordpress installation, I'd like to display only a set number of products on the homepage and more on search pages for example.

Is there a line of code I can add to the calling code for an individual page?

Many Thanks,

Stew

Submitted by support on Tue, 2010-09-28 15:41

Hi Stew,

I take it you want override $config_resultsPerPage under certain circumstances - no problem; if you decide on a new $external_ variable to use for this, which you can add to your calling code as follows:

  $external_resultsPerPage = "5";

...then in your external.php, look for the following code beginning at around line 107:

  if ($external_baseHREF)
  {
    $config_baseHREF = $external_baseHREF;
  }

...and REPLACE with (continuing the theme!):

  if ($external_baseHREF)
  {
    $config_baseHREF = $external_baseHREF;
  }
  if ($external_resultsPerPage)
  {
    $config_resultsPerPage = $external_resultsPerPage;
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Stew on Tue, 2010-09-28 17:15

Hi David,

Many thanks for that, will give it a go,

Cheers