Market lets you sell products online using the Wordpress platform.

You must be logged in to post Login

Search Forums:


 






How To: Add Customer Testimonials to your product pages!

UserPost

4:49 pm
March 8, 2010


mhackney

Groton, MA USA

Member

posts 35

Post edited 6:21 am - March 9, 2010 by mhackney


Here is an example: http://eclecticangler.com/?p=363

The Customer Testimonial section appears below the product photographs to fill in some of that white space! You need to modify 3 MarketTheme files in /wp-content/themes/mk3 Here is how it's done:

1) Edit single.php 

a) add the line:

$customer_testimonial = get_post_meta($post->ID, 'customer_testimonial', $single = true); // check for customer testimonial;

at the top of the file under the other "get_post_meta" assignments.


b) search for "<div class="product_image"> then scroll down to the comment "// if there' a third thumbnail". Immediately after the 3rd thumbnail code is a "?>" and two "</div>" tags. Right after those two "</div>" tags add:

<?php if (!empty($customer_testimonial)) { ?>
  <div class="customer_testimonial">
    <div class="customer_testimonial_header"><?php echo mkt_THEME_CUSTOMER_TESTIMONIAL_HEADER; ?></div>
    <div class="customer_testimonial_body"><?php echo $customer_testimonial; ?></div>
  </div>
<?php } ?>       

There should be a third "</div>" below this inserted code. Save the file.

2) Edit style.css

a) add the markup:

.customer_testimonial {
  padding-top: 20px;
  width: 350px;
  float: left;
}

.customer_testimonial_header {
  margin-bottom: 10px;
  font-weight: bold;
  text-align: center; 
}

.customer_testimonial_body {
  text-align: left;
  font-size: .9em;
  font-style: italic;
  padding-bottom: 5px;
  padding-top: 5px;

Save the file.

3) Edit mkt_language.php to add:

define('mkt_THEME_CUSTOMER_TESTIMONIAL_HEADER', 'Customer Testimonials');

Save the file.


That's it for the edits! Now. here is how to use it:

1) On your product post (either a new Add Product or Edit an existing product), scroll down to the "Add new custom field:" panel. Click "Enter New" and type the field name "customer_testimonial (without the " "s) and enter your customer testimonial in the Value field. Click the "Add Custom Field" button to save the field. 

You only need to add the custom field once. After that, you can select "customer_testimonial" from the drop down menu.

That's all there is to it! You can add multiple customer testimonials in a single custom field, simply add html markup like "<br><br>" to separate the customers.

cheers,

Michael 


7:19 pm
March 8, 2010


Market Admin

Admin

posts 2765

That's really slick Michael!

Thanks for posting the code.

8:14 pm
March 8, 2010


mhackney

Groton, MA USA

Member

posts 35

I hope I didn't forget anything or mess anything up! If so, let me know and I'll edit the post. It is pretty cool being able to add the testimonials to my product pages.


cheers,

Michael

11:18 pm
March 16, 2010


DominiqueSabine

Member

posts 13

Very cool code...I created a 'Product Review' using the same steps.


Very nice...thank you

5:17 am
March 17, 2010


mhackney

Groton, MA USA

Member

posts 35

Great, glad it could help you! I've changed the css on mine a little to decrease the font size and line spacing.


cheers,

Michael