i want to use a different navigation and some other individual codes for all WooCommerce pages.
For archive-product.php or content-single-product.php this is no problem. I used them in my themechild (theme-chiild/woocommerce). But for pages like cart or checkout its not working.
Is it possible to use a different page.php for all WooCommerce pages?
Cart and Checkout by default use your default page.php and just use a shortcode to generate the page content.
So you have a few options.
Modify page.php to check if it is cart/checkout
Create a custom page template for both that modifies what you need
Create a custom page template for each if you need different options on each
In Woocommerce > templates you do have cart/checkout templates as well
Depending on the level of customization. You may need to hook into those pages to add/remove what you need. https://docs.woocommerce.com/wc-apidocs/hook-docs.html
Related
Default whole woocommerce category content and replace it with custom value or replace woocoomerce category page with another just by calling in plugin.
based on this link it seems there is no action for whole shop category page content.
its important to doing this with custom plugin and not any changes on template.
i found a simple answer.
use JS to hide shop loop divs and add my plugin resluts to woocommerce_before_shop_loop.
Attention: this is not a really good solution.
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.
I am using woocommerce and would like to add a custom text to the cart page.
So I add a product to cart, go to the cart and in there I see that the cart uses the page.php template.
My theme folder is called woocommerce, then inside my theme folder I created a folder called woocommerce/templates/cart/cart.php
I added text to the new cart.php but it does not work.
How can I override the woocommerce cart page?
It is my first time using woocommerce so I really hope you can help
Thanks in advance
Create woocommerce/woocommerce/cart/cart.php , folder templates should not be there if you are using theme to override default woocommerce php's
See the article
Template structure & Overriding templates via a theme
https://docs.woocommerce.com/document/template-structure/
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.
I need to add the custom fields to woocommerce general product tab. I know this can be achieved adding code to theme's function.php, but I need to add the fields without using function.php, So that my plugin is seperately installable