Hello,
Thanks for all your help so far. How would it be possible to put the prices on each product page before the product image and before the description but after the title?
Yeah, that's what I tried before and I got the following error (the USER_NAME I replaced):
Price: $ from
Warning: Invalid argument supplied for foreach() in /home/USER_NAME/public_html/shop/html/product.php on line 26
Any other suggestions.
Thanks.
Michael
Ah, yes - the prices HTML module generates a variable called $product which overwrites the $product variable that was created for the product HTML module.
It's an easy fix - just need to use a different variable name for the foreach product in the foreach loop in includes/prices.php:
Here's a complete replacement that shouldn't result in any problems in the product module if used afterwards...
<div class='prices'>
<table width='100%' cellpadding='4'>
<tr bgcolor='#eeeeee'>
<th width='200' align='left'><?php print translate("Stockist"); ?></th>
<th align='left'><?php print translate("Catalogue Product Name"); ?></th>
<th align='left'><?php print translate("Price"); ?></th>
<th align='left'> </th>
</tr>
<?php foreach($prices["products"] as $prices_product): ?>
<tr bgcolor='#ffffcc'>
<td><a href='<?php print $prices_product["merchantHREF"]; ?>'><?php print $prices_product["merchant"]; ?></a></td>
<td><?php print $prices_product["name"]; ?></td>
<td><strong><?php print $config_currencyHTML.$prices_product["price"]; ?></strong></td>
<td align='center'><a href='<?php print tapestry_buyURL($prices_product); ?>' <?php print javascript_statusBar("go to ".$prices_product["merchant"]); ?>><?php print translate("Visit Store"); ?></a></td>
</tr>
<?php endforeach; ?>
</table>
</div>
Cheers,
David.
Not a problem... head to the bottom of products.php where you'll see the following code:
if (isset($product)) require("html/product.php");
if (isset($prices)) require("html/prices.php");
Simply swap those lines around and you're done...!
Cheers,
David.