Theme Templates Integration: Basics

GD Products Center plugin has own rendering, but it requires a little help from the theme: it needs few templates added so that theme can make a call to the plugin rendering engine. Plugin makes a job of integration really easy, not only for our xScape based themes, but for any other theme.

Templates needed by the plugin

For each product type you need 2 templates: one for single product and the other for the archive. So, if you have product type named ‘phone’, for this one custom post type is ‘gdpccpt_phone’, and you need templates:

  • archive-gdpccpt_phone.php
  • single-gdpccpt_phone.php

If you have more product types, each product type needs 2 template like this, but only with different name based on product type name.

And for each company (only Brands and Sellers are available at the moment, with only Brands having front end), you need 2 templates each (archive and single):

  • archive-gdpccmp_brand.php
  • single-gdpccmp_brand.php

Beside that, plugin needs two more templates used for compare pages and main product types page, and these 2 are not dependent on product types, they will be used with all product types:

  • gdpc-compare.php
  • gdpc-products.php
Adding product type templates
Adding product type templates

Directly supported themes

For some themes plugin has already pre-built templates and you can automatically integrate if you use any of these themes. You can also use templates from any of directly supported themes as a basics to do integration.

Creating templates automatically

To create templates automatically, once you create the product type, in the product types list you will see Templates column. This column display status of templates needed for the product type. Click on the ‘add templates’ button in this column, and new panel will open where you can create templates. If you use theme that is directly supported, you will see information about that, and you need just to click ‘Create Templates’ button, and plugin will add templates needed. If you use child themes of the directly supported themes, same thing will happen.

Adding company type templates
Adding company type templates

But, if you use theme that is not directly supported, plugin will offer you to select which supported theme you want to use and copy templates made for that theme. After you do this, you will need to adjust copied templates to match your theme.

Finally, you need to add templates for company types (Brand only) from the Company Type panel. Same method is used a for product types.

Comments

Leave a Reply