M
M
Muvka2018-12-07 19:22:03
WooCommerce
Muvka, 2018-12-07 19:22:03

How to correctly display product data with a non-standard layout?

Hello. In the product card, information is displayed with the hook . So. In fact, it displays all the blocks that are indicated in it in a column, without wrappers and everything else. But I need to place individual elements 2 in one line. My question is, is it possible to do this somehow through hooks, or is it easier to write everything myself through wp_query and get_post_meta? And if the second option - can there be performance problems? Another problem is that I have to work with dt the-7, and there I try to swap and display, for example, a rating by deleting the line
do_action( 'woocommerce_single_product_summary' );

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );

but the rating still doesn't appear...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pychev Anatoly, 2018-12-07
@pton

Maybe after getting acquainted with this, it will be easier for you to figure out which hooks you should operate with.
As far as I know Woocommerce asks for a custom add_filter before each output. You just need to find the filters you need and wrap the blocks with your tags.
I suggest using the usual search in php files to look for where these hooks are processed in Woocommerce itself and see what filters are called there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question