Answer the question
In order to leave comments, you need to log in
How to customize catalog page in WooCommerce?
I rarely work with WooCommerce. But the task arose - on the site in the existing template to customize the product catalog page, replacing the original layout with a pre-prepared one.
Half an hour of googling took me in the direction of hooks, actions and other muddy stuff scattered in different places. I was even surprised how confusing a seemingly simple task can be.
The question is, is there a simple option in which I could create one php file, embed the layout there and display the php layout in the right places like this? (conditional code)
<?php $products = $wpdb->query( "SELECT * FROM wc_products;" );?>
<?php get_header(); ?>
<div class="products">
<?php foreach($products as $product): ?>
<div class="products__item">
<h2><?=$product['title']?></h2>
<p><?=$product['desc']?></p>
<div><?=$product['price']?></div>
</div>
<?php endforeach; ?>
<?php get_footer(); ?>
Answer the question
In order to leave comments, you need to log in
in the active template, create a woocommerce folder, drop the necessary files or folders with files there and customize what you need in them. They connect themselves when loading the catalog
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question