You are here:  » Custom Descriptions for Mapped Products


Custom Descriptions for Mapped Products

Submitted by MattSweet on Wed, 2010-04-21 09:05 in

Hi,

New here after purchasing the script this week - so firstly, hello to all.

I'm messing around with the script and have setup several mapped products to enable a full price comparison. The compare prices page displays an image and description then the table underneath - however it only show the description from the cheapest merchant. Is there a way to create a custom description for mapped products only?

Thanks
Matt

Submitted by support on Wed, 2010-04-21 09:34

Hi Matt,

Welcome to the forum!

There is an easy way to create custom descriptions / HTML for any product that does not involve any database modifications. To do this, simply create a folder called "descriptions" in your Price Tapestry installation folder. Inside that folder, create HTML files containing your custom descriptions (plus any additional HTML you wish to display of course) named as

Product-Name.html

(replacing spaces with - in the Product Name)

Then, in html/product.php, look for the following code beginning at line 12:

        <?php if ($mainProduct["description"]): ?>
          <p><?php print $mainProduct["description"]; ?></p>
        <?php endif; ?>

...and REPLACE with:

        <?php
          $descriptionFilename = "descriptions/".tapestry_hyphenate($mainProduct["name"]).".html";
          if (file_exists($descriptionFilename))
          {
            require($descriptionFilename);
          }
          elseif ($mainProduct["description"])
          {
            print "<p>".$mainProduct["description"]."</p>";
          }
        ?>

Hope this helps!

Cheers,
David.

Submitted by MattSweet on Wed, 2010-04-21 11:21

Thanks David, that works a treat!