Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Customer Testimonials and Pics?


Recommended Posts

Does anyone if it is possible for Customer Testimonials to display a small thumnail pic in its infobox?


I have too many boxes with just text and would like to break it up a little. ;)

Link to comment
Share on other sites

I have modified the testimonials_manager.php file and the customer_testimonials.php file to support the use of images in testimonials. Here is an example of the testimonial_html_text at Jewels By Mala:


<p><img src="/catalog/images/Pearls/PB180366.jpg" alt="Emerald necklace with 18k gold and white baroque pearl drop" width="125" align="left"><i>Just wanted to let you know that the necklace arrived today and is
lovely. Will leave you a rave review at ebay!! Thank you so much for all
your help, Waverly

This item was purchased by a customer in New Iberia, Louisana through one of our <a href = "http://members.ebay.com/aboutme/premmala/">eBay</a> auctions. New Iberia is a smaill town made famous in  the novels of James Lee Burke.


The modification was necessary in both places in order to get the right directory for the testimonials. You will note that the <img src= tag starts with /catalog/images. The code take into account the location of the image directory.


1. Catalog side


Open catalog/includes/modules/customer_testimonials.php. Replace lines 44 to 55 with


  $text = str_replace('/catalog/images/', DIR_WS_IMAGES, $testimonial_array[$i]['testimonial']);

   if (empty($testimonial_array[$i]['url'])) {
   $info_box_contents[][] = array('align' => 'left',
                                  'params' => 'class="smallText" width="100%" valign="top"',
                                  'text' => $text. $testimonials_list);
   } elseif (substr($testimonial_array[$i]['url'], 0, 7) == 'mailto:') {
   $info_box_contents[][] = array('align' => 'left',
                                  'params' => 'class="smallText" width="100%" valign="top"',
                                  'text' => $text.'<br><br><a target="_blank" href="'. $testimonial_array[$i]['url'] . '"><b>'. substr($testimonial_array[$i]['url'], 7). '</b></a>'. $testimonials_list);
   } else {
   $info_box_contents[][] = array('align' => 'left',
                                  'params' => 'class="smallText" width="100%" valign="top"',
                                  'text' => $text.'<br><br><a target="_blank" href="'. $testimonial_array[$i]['url'] . '"><b>'. $testimonial_array[$i]['url_title']. '</b></a>'. $testimonials_list);


2. Admin side


Now for the admin changes. In admin/testimonials_manager.php, lines 247-250 become


    $text = str_replace('/catalog/images/', DIR_WS_CATALOG_IMAGES, $tInfo->testimonials_html_text);

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TESTIMONIALS_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->testimonials_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_TESTIMONIALS_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->testimonials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
       $contents[] = array('text' => '<br>' . TEXT_TESTIMONIALS_DATE_ADDED . ' ' . tep_date_short($tInfo->date_added));
       $contents[] = array('text' => '<br><b>Full Testimonial Text</b>:<br>' . $text . '<br>');


This effects the same correction for the location of the images as on the catalog side. To allow for possible images at the beginning of testimonials_html_text, change line 205 to read:


                <td class="dataTableContent" align="right"><?php echo substr(strip_tags($testimonials['testimonials_html_text']), 0, 25); ?> [more]</b></td>


This code strips out any html tags which would interfere with the listing on the "Testimonials Manager" admin page.


Let me know if this helps or adds confusiont!





Jerome Freedman, Ph. D.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...