products - Is there any way to reverse the order of "Sales price" and "Regular prcie" in woocommerce? -
usually displayed "regular price" first cross line , "sale price" second . wish reverse order . researched on google it,nothing worked . implemented ??
here 1 of solution can use
add_filter('woocommerce_sale_price_html', 'wdm_change_price_text', 10, 2); function wdm_change_price_text( $price, $this_object ) { $display_price = $this_object->get_display_price(); $display_regular_price = $this_object->get_display_price($this_object->get_regular_price()); $price='<ins>' . wc_price($display_price) . '</ins>' . $this_object->get_price_suffix() . '<del>' . wc_price($display_regular_price) . '</del> '; return $price; } addition there other filter different types of product might need add function them too.
//woocommerce_variable_sale_price_html //woocommerce_variation_sale_price_html //woocommerce_free_sale_price_html previous price

after customization using above code

have tested code works me. try code , let me know if fulfills requirements.
Comments
Post a Comment