Answer the question
In order to leave comments, you need to log in
How to swap the price of a variable product only in the product card?
Good day, everyone!
Please help me figure out how to swap the product variation and price only in the product card without affecting the changes in the product catalog.
There is a function in function.php :
remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10);
add_action( 'woocommerce_before_variations_form', 'woocommerce_single_variation', 20);
After which the price rises above the product variation, but the same change occurs in the product category, because of which it does not look very nice
After making the change :
and in the catalog :
Is it possible to change the function so that the change concerns only the product card?
Answer the question
In order to leave comments, you need to log in
Good.
So?
if( is_product() ) {
remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10);
add_action( 'woocommerce_before_variations_form', 'woocommerce_single_variation', 20);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question