I'm trying to customise the shop page in WooCommerce completely, but cannot see a way to do so without the use of plugins.
I imagine that if I do not set a shop page in WooCommerce (and it's just a page with a template for example), then I would need to set up redirects from the shop page to my new store page?
What I was expecting was that I could simply override the template by copying the file into my theme (i.e. woocommerce/store.php) as I've done with other templates. However, looking into the WooCommerce plugin codebase, it looks like the entire loop folder creates the shop page (woocommerce/templates/loop).
I can simply go down the route of create a custom template (i.e. archive-shop.php) and set up the redirect if needed. But, wondering if there's a more optimal way to do this, without plugins?
In response to @hhh:
I have added "archive-product.php" to my theme (woocommerce/archive-product.php), and pasted over the original file from the woocommerce plugin.
In my copied version, I changed the header to "this is a test":
<h1 class="woocommerce-products-header__title page-title">THIS IS A TEST</h1>
I even further dismanted the file to only showcase the h1, but it does't override the default template from the plugin:
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 3.4.0
*/
defined( 'ABSPATH' ) || exit;
get_header( 'shop' );
do_action( 'woocommerce_before_main_content' );
?>
<header class="woocommerce-products-header">
<h1 class="woocommerce-products-header__title page-title">THIS IS A TEST</h1>
</header>
<?php
get_footer( 'shop' );


所有评论(0)