Answer the question
In order to leave comments, you need to log in
How to customize the output of Woocommerce products?
I'm trying to use woocommerce in my theme to create a store.
Everything was going well, until it came to the moment with the withdrawal of goods. I use this construction: <?php woocommerce_content(); ?>
but this function uses its own templates to display products. How can I display product information in my layout?
For example, I made this design:
<div class="item">
<img src="img/item1.jpg">
<h3 class="item_item">Гидравлическая тележка Lema LM 20-800x550</h3>
<div class="item_content">
Длинна вил, мм; 800
Грузоподьемность, кг; 2000
Производитель; Lema
Вариант исполнения; Коротковильные
Ширина вил, мм; 550
</div>
</div>
Answer the question
In order to leave comments, you need to log in
woocommerce_content - looks like this
https://docs.woothemes.com/wc-apidocs/source-funct...
so it returns a loop with connected output templates.
To change the output, you need to change the templates.
You can change it through the filter when connecting the template, checking what is connected
Example of replacing the template of the field for selecting the quantity of goods
/**
* Замена спиннера
* @param $located
* @param $template_name
* @param $args
* @param $template_path
* @param $default_path
* @return string
*/
function filter_сr_woo_quantity_inputs( $located, $template_name, $args, $template_path, $default_path ){
if('global/quantity-input.php' === $template_name ) {
return __DIR__ .'/cr-quantity-input.php';
} else {
return $located;
}
};
add_filter( 'wc_get_template', 'filter_сr_woo_quantity_inputs', 10, 5 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question