Display Sale Price Before Regular Price (WooCommerce)

You have to change this in functions.php if (!function_exists(‘my_commonPriceHtml’)) { function my_commonPriceHtml($price_amt, $regular_price, $sale_price) { $html_price=”<p class=”price”>”; //if product is in sale if (($price_amt == $sale_price) && ($sale_price != 0)) { $html_price .= ‘<ins>’ . wc_price($sale_price) . ‘</ins>’; $html_price .= ‘&nbsp;&nbsp;<del>’ . wc_price($regular_price) . ‘</del>’; } //in sale but free else if (($price_amt == $sale_price) … Read more

Hiding custom fields when content is empty [closed]

Got it! I needed to add this line: if ( $other_details = get_post_meta( $order->id, ‘Other Details’, true ) ) { So the full code for the block I needed to change would be: /** * Add the fields to order confirmation/thank you page. **/ add_action( ‘woocommerce_order_details_after_order_table’, “my_woocommerce_other_details_after_order_table”, 10, 1 ); function my_woocommerce_other_details_after_order_table( $order ) { … Read more

Disable WooCommerce Address State Dropdown

Add this to your functions.php Simply add this code to your functions file and your WooCommerce will now use standard drop downs. add_action( ‘wp_enqueue_scripts’, ‘agentwp_dequeue_stylesandscripts’, 100 ); function agentwp_dequeue_stylesandscripts() { if ( class_exists( ‘woocommerce’ ) ) { wp_dequeue_style( ‘select2’ ); wp_deregister_style( ‘select2’ ); wp_dequeue_script( ‘select2’); wp_deregister_script(‘select2’); } }