You are here:  » Wordpress templates


Wordpress templates

Submitted by ccgale on Tue, 2013-08-13 14:39 in

Hi

Is there an easy guide to editing the wordpress templates. I have found the examples for the normal TP site and can make that look nicer but I am running my store through wordpress.

I would like to change the default search result from a long listing page with descriptions and small images to more like a normal retailer where I have no descriptions and larger images. I assume it involves editing the search results bit of the html but cannot work out how to do it.

Thanks

Submitted by support on Tue, 2013-08-13 15:11

Hi ccgale,

The HTML generated by the plugin is controlled through the templates which you can edit freely from the plugin configuration page at /wp-admin/ > Settings > PriceTapestry.org. Here you will find templates for each section of HTML generated by the plugin, and in conjuction with the style sheet:

/wp-content/plugins/pto/resources/pto.css

...you can create whatever look and feel you require. To customise your search results appearance, the templates to change are

Search Results / Before
Search Results / Each
Search Results / After

As a starting point, what a number of users do who have the same requirement is to actually render search results using the Featured Products style of layout. To do this, go to

wp-admin > Settings > PriceTapestry.org

...and edit the following templates as shown:

Search Results / Before:

<div class='pto_featured'>
<table><tr>

Search Results / Each:

<td>
<p class='pto_featured_name'><a href='%PRODUCT_URL%'>%PRODUCT_NAME%</a></p>
%IF_IMAGE%
<p class='pto_featured_image'><img src='%IMAGE_URL%' /></p>
%ENDIF_IMAGE%
<p class='pto_featured_price'>
%IF_COMPARED%
  from %PRICE%
  <br />
  <a href='%PRODUCT_URL%'>Compare Prices</a>
%ELSE_COMPARED%
  %PRICE%
  <br />
  <a href='%PRODUCT_URL%'>More Information</a>
%ENDIF_COMPARED%
</p>
</td>
%IF_EVERY4%
</tr><tr>
%ENDIF_EVERY4%

Search Results / After:

</tr></table></div>

The above will give 4 columns of search results based on the Featured Products layout. If 4 columns doesn't fit well with your WordPress theme, it's controlled by this part of the Search Results / Each template in the above...

%IF_EVERY4%
</tr><tr>
%ENDIF_EVERY4%

..simply adjust as required.

Note that when using a grid style of layout for search results it's best to make sure that the number of results per page is an exact multiple of the number of columns - so if using 4 columns, a setting of 8 or 12 works well - you can set this specifically for the plugin on the same page as the templates, under the "External" settings.

For more information; please see
http://www.pricetapestry.org/node/28

There is also a very basic grid layout described here if you wanted to keep Search Results and Featured Product styling separate:
http://www.pricetapestry.org/node/75

Hope this helps! If you're not sure at all exactly how to achieve the look you're after let me know what you'd like to change and I'll point you in the right direction...

Cheers,
David.
--
PriceTapestry.com

Submitted by ccgale on Tue, 2013-08-13 16:45

Thanks, looks much better. Can't seem to get the images to increase in size however.

I edited the size in the above code to but still showing as the original size.

Any pointers would be most welcome on that please.

Many thanks,
Carl

Submitted by support on Tue, 2013-08-13 16:57

Hi Carl,

If you're happy for Featured Products and Search Results images to be the same size, rather than change the above code edit the associated CSS:

/wp-content/plugins/pto/resources/pto.css

...and look for the existing pto_featured_image class definition around line 51:

.pto_featured_image img {
  height: 100px;
}

...and adjust as required. Don't forget to do a hard refresh (CTRL+F5) in your browser after modifying CSS to ensure that it is reloaded...

Cheers,
David.
--
PriceTapestry.com

Submitted by ccgale on Tue, 2013-08-13 18:24

Many thanks. If I could trouble you for one more, related issue. How do I increase the number of products in the search result. I have set the 'normal' store to 24 but the Wp store only has 10 showing.

Thanks again
Carl

Submitted by support on Tue, 2013-08-13 18:27

Hi Carl,

Results per page is configured independently in the plugin. The setting is on the same page as the templates - /wp-admin/ > Settings > PriceTapestry.org but towards to the top of the page, scroll down to the "External" section, where you will find the plugin version of the $config_resultsPerPage parameter and can set as required...

Cheers,
David.
--
PriceTapestry.com

Submitted by ccgale on Tue, 2013-08-13 18:32

Ooops, was right in front of me!!

Thanks