get_sale_price(); if ( $sale_price ) { $sale_price = wc_get_price_to_display( $product, array( 'price' => $sale_price, ) ); } $regular_price = wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price(), ) ); $price = wc_get_price_to_display( $product, array( 'price' => $product->get_price(), ) ); if ( ! function_exists( 'tptParsePlainText' ) ) { function tptParsePlainText( $text, $quantity, $discount = null, $price = null, $base_unit_name = null ) { return strtr( $text, array( '{tp_quantity}' => $quantity, '{tp_discount}' => ! is_null( $discount ) ? round( (float) $discount, \TierPricingTable\PricingTable::discountDecimals( (float) $discount ) ) : $discount, '{tp_rounded_discount}' => ! is_null( $discount ) ? round( $discount ) : 0, '{tp_price}' => $price ? wc_price( $price ) : '', '{tp_base_unit_name}' => $base_unit_name, ) ); } } ?>