You are here:  » product.php page error

Support Forum



product.php page error

Submitted by amplidyne on Sun, 2008-01-27 22:07 in

David,
I am getting following error on product.php page when I add a product to featured products.
Price search results for 08K9865 8X CD RWDVD Combo Price: $ from
Warning: Invalid argument supplied for foreach() in c:\websites\comparepoint174\comparepoint.com\html\product.php on line 26

Here is the code from product.php

{code saved}

for some reason, line

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

is taking this error. It works fine if I remove all products from featured window.

Can you help?

Thanks,
MK

Submitted by support on Mon, 2008-01-28 09:51

Hello MK,

This looks like the $product variable has become overwritten somehow in a previous module; and so no longer contains the product information for display by html/product.php.

Have you made any other changes to the way featured products are displayed, or in any other module where you might have inadvertantly used the variable $product; as this would almost certainly cause this error. If not; have you made any mods at all - and if so describe what you have changed and in which files; and also whether or not his happens for every product or just some...

Cheers,
David.

Submitted by amplidyne on Mon, 2008-01-28 16:30

You're right David, $product was overwritten due to the way I have used header code. I figured it out.
Thanks,