A
A
Alien932019-04-20 14:27:41
WordPress
Alien93, 2019-04-20 14:27:41

Why doesn't wc_product_class() work after updating WooCommerce?

I understand that this is not such a catastrophe, but still, the function that used to display classes for each product, it was convenient to cling to them and style everything, suddenly stops working. Do you also?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Gromel, 2019-04-25
@gromel

Yes, everything works as before.
The reason is not updated templates used themes.
You need to update the theme, or if the theme developer doesn't have an update yet, then manually fix the theme template files that use wc_product_class( ) .
For example, in the file, along the path:
\wp-content\themes \imya-temy\ woocommerce\content-product.php
replace

wc_product_class( );
на
wc_product_class( '', $product );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question