There are two methods for overriding the built in templates in our wp ecommerce plugin.
1. via creating special directory structure
2. via plugin hooks.
Using the special directory structure
Lets take for example that we want to make custom modifications to the grid template for our shop.
The built in template file is:
If we do our modifications in that file directly, they will be lost after updating, so we need a better way to do that. The easiest solution is to create /com_shop_front/product_list folder in your theme or directly in wp-content directory and copy there the grid.tpl.php file. At the end you will have the following structure:
You can modify that file safely as it will not be replaced on the next update of the plugin.
You can override every template of the plugin using that technique, the only difference for admin templates is that the path has to be: /wp-content/com_shop_admin
Using plugin hooks
You have access to the view_display action that is executed right before the inclusion of the requested template. The first argument is the view class and the second argument is the name of the template.
You can use that action to attach a filter handler, that will add additional template override paths.
The filter is override_com_shop_front for the frontend and override_com_shop_admin
for the backend. The filter accepts one argument, that is array of all the paths, where template files will be searched for.
There is one additional filter available edit_template_paths_com_shop_front the filter is executed
every time a template is requested in contrast of override_com_shop_front that is executed only once.