You are here:  » Price Tapestry Layout


Price Tapestry Layout

Submitted by multiz on Fri, 2006-07-07 16:22 in

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?

Michael
Software Price Comparison - Shop.MultiZ.com

Submitted by support on Fri, 2006-07-07 16:40

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.

Submitted by multiz on Fri, 2006-07-07 16:59

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

Submitted by support on Fri, 2006-07-07 18:15

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'>&nbsp;</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.

Submitted by multiz on Fri, 2006-07-07 19:52

Perfect! Thanks a bundle!