I am using woocommerce to develop an ecommerce store. Everything is fine with woocommerce. But I have one problem. As because I want to show some custom images with some texts in the product page(shop based page). So for that I thought wordpress advanced custom fields will be good. I made it install. And now I need to extract the image in the template file. But by going through woocommerce plugin I got that it doesn’t use the wordpress template. Woocommerce is generating the total page (producr page) by itself. And Iwant to show some custom fields from wordpress advanced custom fields plugin. So can someone kindly tell me how to do this? Any help and suggestions will be really appreciable. Thanks…
I want that woocommerce shop page where all the products are shown should use my own custom template. So that I can use wordpress advanced custom fields code there
In order to override a Woocommerce template from
wp-content/plugins/woocommerce/templates
, create a file with the same name inwp-content/themes/<your theme>/woocommerce
. It will be used instead of the original one.If you look at one of the original template files, you will actually find this instruction in a comment at the top:
WooCommerce doesn’t use normal template files from your theme (it uses the header and footer etc but the bulk of the actual interior content is split into a lot of Woo template files).
You can copy the templates out of the
plugins/woocommerce/templates
directory and move them to thethemes/yourtheme/woocommerce
directory to override (just pick the ones you need).A list of all the templates can be found here. A list of useful php hooks/filters to use for more advanced customization can be found here. Other useful resources are the CSS structure doc and this list of conditional template tags for WC.
There is kind of lackluster documentation for nitty-gritty theme development for WC so you will probably need to take some time to experiment with the templates in order to accomplish what you want, but it’s decently commented and pretty easy to work with once you learn your way around.
For products page and any part of your site that shows products like home page or category page the code responsible for it exists in woocommerce-template.php
line 29
you can use hooks and filters to change some part or you can override the function itself in themes/yourtheme/woocommerce/functions.php
also you can edited directly but this is not advisable as you will lose changes after any upgrade.
Notice that in line 71 this function use template file content-product.php that is The template for displaying product content within loops and can be override by copying it to yourtheme/woocommerce/content-product.php
I found a great list of free woocommerce plugins, and some customization tips. Maybe it will be of some help.
http://fivera.net/woocommerce-customization-free-wp-plugins/