You are here:  » merchant information like payment options etc


merchant information like payment options etc

Submitted by Gamemonkeyz on Sun, 2013-12-15 20:54 in

Hello David,

First of all; many thanks for this great script!

I've got 2 questions:

1. I would like to have some extra info added (like paymentoptions, way of delivery etc.)below the title of the product next to the merchant logo or merchant name. I've made a image so you can see what I mean: {link saved}

Is this possible?If so, what do I need to change?

second question:

Is it possible to make a review option for customers to make a review about the merchants?

Many thanks!

Kind regards,
Ralf

Submitted by support on Mon, 2013-12-16 09:58

Hello Ralf,

Thank you for your comments and welcome to the forum!

This could be done in a very similar way to the merchant info mod, but pulling in the .html files at a different point in the code.

Create a folder /merchantinfo/ on your site, and in that folder create Merchant Name.html files containing the HTML you wish to display for each merchant. If you're using rewrite URLs don't forget to make sure that links to any images in your .html files are absolute e.g. begin with "/" so that they can be found by the browser.

The Merchant Name part of the filename must match the merchant name as it is registered on your site exactly, including spaces e.g. for the merchant Widget Co the filename would be

/merchantinfo/Widget Co.html

Then to include the files as indicated in your mock-up, edit html/prices.php look for the following code at line 12:

  <td><?php print $product["original_name"]; ?></td>

...and REPLACE with:

  <td>
  <?php print $product["original_name"]; ?>
  <br />
  <?php
    $filename = "merchantinfo/".$product["merchant"].".html";
    @require($filename);
  ?>
  </td>

(the @ prefix infront of the require() statement will suppress any error message if the file does not exist - far more efficient that having to make a file_exists() call for every merchant if ultimately you are planning to have .html files for all!)

A number of users have asked about a merchant review module so I'll certainly look into this and make it available as an optional extra - I'll let you know of course when something is available to try...

Cheers,
David.
--
PriceTapestry.com

Submitted by Gamemonkeyz on Mon, 2013-12-16 18:12

Hello David,

Thank you for the fast reply.

I've tried to do what you mentioned. I've created the merchantinfo map and a merchantpage, for testing, like you described. I'm using a template that has altered the /html/prices.php. The mentioned code I asume to be changed is this:

<div class="row compare-block">
<div class="two columns"><a href='<?php print $product["merchantHREF"]; ?>'><?php print (file_exists("logos/".$product["merchant"])?"<img alt='".$product["merchant"]."' src='".$config_baseHREF."logos/".str_replace(" ","%20",$product["merchant"])."' />":$product["merchant"]); ?></a></div>
<div class="seven columns"><?php print $product["original_name"]; ?>
<?php if ($product["voucher_code"]): ?>
<div class="voucher_code transition"><i class="icon-tag"></i><p><?php if ($product["voucher_code"]) print "<br /><small><nobr>".translate("using voucher code")." <strong>".$product["voucher_code"]."</strong></nobr></small>"?></p></div>
<?php endif; ?>
</div>
<div class="three columns relative center">
<div class="price_list_price_main"><?php print $config_currencyHTML.$product["price"]; ?></div>
<div class="medium btn visit-store-btn"><a class="med_link" href='<?php print tapestry_buyURL($product); ?>'><?php print translate("Visit Store"); ?></a></div>
      </div>
    </div>
    <?php endforeach; ?>
</div>
</div>

I've tried some variations so far without the result I want. All changes result in the cheapest merchant showing the merchant image and the title of the product. The price is invisible and the other merchants aren't showing.

Any suggestions how to get it working?

Kind regards,
Ralf

Submitted by support on Mon, 2013-12-16 18:55

Hello Ralf,

In your template file, locate the following (it's within another line, not standalone) :

<?php print $product["original_name"]; ?>

...and REPLACE with:

<?php print $product["original_name"]; ?>
<br />
<?php
  $filename = "merchantinfo/".$product["merchant"].".html";
  @require($filename);
?>

Cheers,
David.
--
PriceTapestry.com

Submitted by Gamemonkeyz on Mon, 2013-12-16 21:30

Hello David,

Again thanks for the reply.

I have mentioned to get things working! I searched the post called 'Mod for merchants.php' and changed the code in:

<?php print $product["original_name"]; ?>

to

<?php print $product["original_name"]; $merchantinfoFilename = "merchantinfo/".$product["merchant"].".html";
  if (file_exists($merchantinfoFilename))
  {
    require($merchantinfoFilename);
  } ?>

This way the text etc. comes beneath the title of the articles.

Many thanks for your help!

Kind regards,
Ralf