Hiya,
This is at the bottom of products.php:
if (isset($product)) require("html/product.php");
if (isset($prices)) require("html/prices.php");
I want to swap them round, so the price comparison table appears before the info, but I get this:
(Prices are shown and then...)
Price: £ from
Warning: Invalid argument supplied for foreach() in /home/gadgetre/public_html/html/product.php on line 49
- Any idea how to get this to work?
Thanks!
Hi,
This happens because the prices HTML module creates a variable called $product which overwrites the data created for the product HTML module. Whilst this could be solved by editing html/prices.php and changing each instance of $product to $priceproduct (for example), an easier way to solve the problem is to copy $product into a temporary variable before calling the price HTML module, and then restoring it before calling the product HTML module.
This would make your modified code to swap the order of these sections as follows:
$temp = $product;
if (isset($prices)) require("html/prices.php");
$product = $temp;
if (isset($product)) require("html/product.php");
Either way should do the trick!
Cheers,
David.