override woocommerce.php with custom content for only store homepage - wordpress

I currently use FoundationPress (Foundation6) as framework and starter theme. It uses woocommerce.php template files to hook into woocommerce functionality but for the life of me I can't figure something out.
I need to add custom content to the stores homepage only, non of the other store pages. Whatever I add to woocommerce.php will appear on all store pages, but I can't figure out what template controls the stores homepage.
The first set of templates I can see are used are the ones that are inthe loop folder and content-product.php. Normally I would just edit archive-product.php but woocommerce.php takes over from this template: see bottom of https://docs.woocommerce.com/document/template-structure/.

The shop is archive-product. However I did not try FundationPress but it seems that WooCommerce needs in the last version to declare WooCommerce support in themes. https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes
So first try https://en-gb.wordpress.org/plugins/query-monitor/ and check which template is loading. And if its loading page.php instead of Woocommerce template implement the line in functions.php.

Related

archive.php looks different from template

I'm wondering how Wordpress Templates work.
I have WooCommerce installed, and would like to have a page where its loading the product listing, but it seem to be defaulting to using the template file : archive.php. archive.php looks fine, all except the fact that the company logo and navigation bar on the top is missing. I've checked archive.php template file and it seem that the code for the logo is still there. I'm wondering which page the template is defaulting to other than archive.php.
WooCommerce does not use the normal WP archive.php template. In order to customize the WooCommerce archive template you need to:
Make a new folder inside your theme directory called woocommerce.
Add this file to the woocommerce folder: https://raw.githubusercontent.com/woocommerce/woocommerce/master/templates/archive-product.php
You can then customize that new archive-products.php file to meet your needs.
Hope that helps!

WooCommerce pages showing as blank

The cart, my-account and checkout pages are all blank when I try view them. All I get is the header and footer. All I have done so far is download WooCommerce, go through the settings and add theme support. My shop page wasn't working until I added theme support but now thats the only page that does. Also I've noticed that if I use WooCommerce shortcode in my php files I can get the pages. But the shortcode doesn't seem to be working in the backend. BTW I'm using my own custom theme incase thats relevant.
What can I do to fix this?
update:
This must be an issue with my theme as if I set one of the default ones to active all the WooCommerce pages show. But I don't know what my themes issue is yet.
update: I have noticed that the WooCommerce pages are allowing me to add templates to them, apart from the shop page which is working. Why is this happening?
There are few steps to do.
First turn on debug, by switching WP_DEBUG to true.
View source of page, and check if everything is being rendered, and also check console for JS error.
At last, for theme, if after switching to default theme, content shows up, there is a theme related issue.
Check for missing templates or template parts or structure within related with page from which content is missing and compare it with default themes templates and template parts.
See if there is some template part missing, or modified, like content.php or content-page.php, the_content() , etc.

WooCommerce plugin integration with custom theme

I have my own html to display all products inserted in WooCommerce. But I am unable to show it in my styling. I have searched it but unable to find any good solution.
Please help.
You have to learn about wordpress templates hierarchy that all files how it works?
https://developer.wordpress.org/themes/basics/template-hierarchy/
Suppose You want to create single page of product then create a new file into your theme with name single-product.php then single product url automatically render this file.
As same you want to create shop page (Where all products should shown) then create a file into your theme with name archive-product.php then shop page automatically render this File
For add to Cart functionality there are lots of plugin that can be used.

Edit Product Template on Shop template of Woocommerce

I have a wordpress website with woocommerce deployed. I want to override some of the layout and the way each product is displayed on the shop page. I am doing this by creating a child template. I am able to override some functions, but am unable to find which file I need to edit, in order to modify how the thumbnails are displayed. In other words, the thumbnails shown in the following file...
woocommerce\templates\content-product.php
You can just copy templates\content-product.php files to your theme folder; it will override the default template and do whatever changes you need. Visit WooCommerce official documentation for further details.

WooCommerce custom checkout page in theme

Is it possible to create custom checkout page in my theme? I mean to create custom checkout.php document I do not want to edit WooCommerce default theme.
Yes, this is achieved by overriding the WooCommerce checkout.php file in the plugin itself by placing it in your theme's WooCommerce directory. You are right not to want to edit the plugin because any updates will render such changes obsolete. You can see the following files you would want to override here: https://github.com/woothemes/woocommerce/tree/master/templates/checkout
Your directory should look something as follows:
themeroot/
single.php
page.php
etc..
woocommerce/
templates/
checkout/
form-checkout.php
form-billing.php
etc
You can learn more about creating Custom WordPress themes by viewing the document. You will want to duplicate and work of these files to create your custom checkout page.

Resources