You are here:  » Error when including

Support Forum



Error when including

Submitted by Harvey on Sat, 2008-10-25 18:27 in

Hi David,

I've included a product page onto wordpress using the same principles as before - the following code on the post:

"

<?php
  
// now preload $_GET["q"] to be the query you want to display search results for
  
$_GET["q"] = "In the Night Garden Talking Plush Upsy Daisy";
  
// now bring in the search code
  
require(ABSPATH'/shop/products.php');
  
// now use Price Tapestry's product HTML module to display the results
  
require(ABSPATH'/shop/html/product.php');
?>
"

- and listing the globals at the top of products.php.

It's all working except for the following error:

"Price:
Warning: Invalid argument supplied for foreach() in /home/gift/public_html/shop/html/product.php on line 24"

That line is:

<?php
 
foreach($product["products"] as $priceProduct): 
?>

Thanks!

Submitted by support on Mon, 2008-10-27 09:11

Hello Harvey,

I have made lots of improvements to the way this worked and posted some new code - have a look at the following thread and if you move your code to use those versions it should work much better:

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

Cheers,
David.

Submitted by Harvey on Wed, 2008-10-29 20:10

Cheers David, makes it much easier to stick it on Wordpres etc :)