You are here:  » external.php

Support Forum



external.php

Submitted by Paul1107 on Thu, 2011-01-13 20:07 in

Hi David

wondered whether you can help me out?

you helped amend my external.php to with a switch statement so I could display rows of items from a specific merchant and an other parameter using the follow query

switch($content)
    {
      /* begin copy */
    case "a":
     $sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE merchant='Lipsy' AND category LIKE 'Party Dresses' GROUP BY name ORDER BY RAND() LIMIT 6";
      break;

I've got 18 cases included in the switch statement from a-r at the moment, and the results fetched using the following calling code:

<?php
 $external_baseHREF = "{code saved}";
 $external_path = "{code saved}";
 $external_hideSearch = TRUE;
 $_GET["content"] = "i";
 require($external_path."external.php");
 $_GET["content"] = "";
?>

The problem is that cases "r" "l" & "j" don't produce output, can you hazard a guess why when all the other cases work fine?

Regards

Paul

Submitted by support on Fri, 2011-01-14 09:19

Hi Paul,

It's almost certainly just that the WHERE condition is not returning any products - double check the conditions by searching manually within the associated Price Tapestry installation for the results you want using the following query style:

merchant:Lipsy:category:Party Dresses

...and once you're getting the results you want, copy the merchant and category fields exactly from your search box into the SQL - that should be all it is...

Cheers,
David.
--
PriceTapestry.com

Submitted by Paul1107 on Fri, 2011-01-14 10:31

Hi David,

Thanks for that, honestly thought I was putting correct parameters in, but after following your advise it now works...

Thanks again

Paul

Submitted by mediadream on Sat, 2011-01-15 18:36

Hi David

Could you please email me that external.php file.

I am trying to integrate pt with wordpress.

Submitted by support on Sat, 2011-01-15 19:13

Hi,

Sure - what I normally suggest is first to implement either pricesExternal.php or searchExternal.php as documented here, and then email me the calling code that you derived for your installation, and then I can use that to send you the full version and calling code required...

Cheers,
David.
--
PriceTapestry.com