Woocommerce integration into your WordPress template

Consider integrating woocommerce store into your template. In this example, the integration will be done using the woocommerce file.php in the template directory. This method has its advantages and disadvantages, which in the end, and yet the very example of the compatibility of the theme with the store.

As written in the introduction-create in folder themes file woocommerce.php, next, open the template file of the theme (any desired structure can be post.php or page.php). And copy its contents to woocommerce.php. Next, you need to replace the content of the page in the created file (cap, footer, sidebars – common elements of the site template – you need to leave).

Step.One

Example of minimal woocommerce.php, which I use as a base template:

woocommerce.php

WAS:

BECOME:

As a result the shop page is integrated in our theme. All store pages (product page, Vetrina, category page) will use this template file.

Step.Two

Next, in the theme file function.php needs to be added:

Here the integration is over. It should work.

 

From additional features, for lovers of minimalism, you can still remove all the styles of the store to register them manually from scratch. This can be done with a command in the same function file.php

Just be careful – removed all the styles of woocommerce and will have to impose prilichno. The function is not critical – if you do not like the result, you can delete this line and all styles will be returned.

 

And as promised – the advantages and disadvantages of integrating woocommerce into your theme with a woocommerce file.php.

The main advantage of this method is simplicity and flexibility. By simply editing the template, you can customize the store display theme almost any way you like.

The disadvantage is the integration of the store into the WordPress theme by creating a woocommerce template file.php will become the point that stops working straight editing the template store categories

woocommerce/archive-product.php

– all internal changes will have to do with the help of hooks.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *