I have made a function that displays on checkout the total savings based on product discounts but I would like it to show the percentage saved above the order total, and if possible show it inside of a box.
Code:
function wc_discount_total() {
global $woocommerce;
$discount_total = 0;
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values) {
$_product = $values['data'];
if ( $_product->is_on_sale() ) {
$regular_price = $_product->get_regular_price();
$sale_price = $_product->get_sale_price();
$discount = ($regular_price - $sale_price) * $values['quantity'];
$discount_total += $discount;
}
}
if ( $discount_total > 0 ) {
echo '<tr class="cart-discount">
<th>'. __( 'Your Savings', 'woocommerce' ) .'</th>
<td data-title=" '. __( 'You Saved', 'woocommerce' ) .' ">'
. wc_price( $discount_total + $woocommerce->cart->discount_cart ) .'</td>
</tr>';
}
}
add_action( 'woocommerce_cart_totals_after_order_total', 'wc_discount_total', 99);
add_action( 'woocommerce_review_order_after_order_total', 'wc_discount_total', 99);
How my current checkout looks like:
Zoomed:
How I would like it to look:
If there is a discount on that order, then you could add another table row tag and calculate the percentage. So it'd be something like this:
add_action('woocommerce_cart_totals_after_order_total', 'wc_discount_total', 99);
add_action('woocommerce_review_order_after_order_total', 'wc_discount_total', 99);
function wc_discount_total()
{
global $woocommerce;
$discount_total = 0;
foreach ($woocommerce->cart->get_cart() as $cart_item_key => $values) {
$_product = $values['data'];
if ($_product->is_on_sale()) {
$regular_price = $_product->get_regular_price();
$sale_price = $_product->get_sale_price();
$discount = ($regular_price - $sale_price) * $values['quantity'];
$discount_total += $discount;
}
}
if ($discount_total > 0) {
echo '<tr class="cart-discount">
<th>' . __('Your Savings', 'woocommerce') . '</th>
<td data-title=" ' . __('You Saved', 'woocommerce') . ' ">'
. wc_price($discount_total + $woocommerce->cart->discount_cart) . '</td>
</tr>';
$total = WC()->cart->cart_contents_total;
$total_saved = wc_price($discount_total + $woocommerce->cart->discount_cart);
$percentage_saved = round(($total_saved * 100) / $total);
echo '<tr class="cart-percentage-discount">
<th>' . __('Percentage Saved', 'woocommerce') . '</th>
<td data-title=" ' . __('You Saved', 'woocommerce') . ' ">' . esc_html($percentage_saved . "%") . '</td>
</tr>';
}
}
Related
I have created a custom function to display 3 custom fields (ACF) and the product price in the WooCommerce Archive/Shop page.
My Custom fields are showing correctly, but the WooCommerce price does not. How can I output the product price within this function?
add_action( 'woocommerce_after_shop_loop_item', 'acf_template_loop_product_meta', 20 );
function acf_template_loop_product_meta() {
global $product;
if ( $brand = get_field('brand', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $brand . '</p>';
}
if ( $designer = get_field('designer', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $designer . '</p>';
}
if ( $model = get_field('model', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $model . '</p>';
}
if ( $price = $product->get_price(); ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $price . '</p>';
}
}
Here is the solution if anyone is interested:
add_action( 'woocommerce_after_shop_loop_item', 'acf_template_loop_product_meta', 20 );
function acf_template_loop_product_meta() {
global $product;
if ( $brand = get_field('brand', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $brand . '</p>';
}
if ( $designer = get_field('designer', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $designer . '</p>';
}
if ( $model = get_field('model', $product->get_id()) ) {
echo '<p><strong>'. __("  ") . '</strong> ' . $model . '</p>';
}
if ( $price = $product->get_price() ) {
echo '<p><strong>'. __("  ") . '</strong> ' . ฿ $price . '</p>';
}
}
I use the following code to add a small badge topleft of every product with -%off.
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'filter_woocommerce_single_product_image_thumbnail_html', 10, 2 );
function filter_woocommerce_single_product_image_thumbnail_html( $thumbnail, $thumbnail_id ) {
global $post, $woocommerce;
$product = wc_get_product( $post->ID );
$is_on_sale = $product->is_on_sale();
if ( $is_on_sale ) {
$rrp_price = $product->get_regular_price();
$sale_price = $product->get_price();
$discount_amount = $rrp_price - $sale_price;
$discount_percent = '-' . round( ( $discount_amount / $rrp_price ) * 100, 0 ) . '%';
$thumbnail = '<span class="wpd-sale-thumbnail"><span class="wpd-sale-badge">' . $discount_percent . '</span>' . $thumbnail . '</span>';
}
return $thumbnail;
}
On my product page and it works. However when i try to do it on category page to all product listings with the following code:
add_filter( 'post_thumbnail_html', 'filter_woocommerce_archive_product_image_thumbnail_html', 30, 5 );
function filter_woocommerce_archive_product_image_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
$product = wc_get_product( $post_id );
if ( ! is_a( $product, 'WC_Product' ) ) {
return $html;
}
$is_on_sale = $product->is_on_sale();
if ( $is_on_sale && is_product_category() ) {
$rrp_price = $product->get_regular_price();
$sale_price = $product->get_price();
$discount_amount = $rrp_price - $sale_price;
$discount_percent = '-' . round( ( $discount_amount / $rrp_price ) * 100, 0 ) . '%';
$html = '<span class="wpd-sale-thumbnail"><span class="wpd-sale-badge">' . $discount_percent . '</span>' . $html . '</span>';
}
return $html;
}
It does not work, there doesn't seem to be any adjustment. Can I get some guidance into it?
To add the badge to the product images on the archive pages, either you use
/**
* Get the product thumbnail for the loop.
*/
function woocommerce_template_loop_product_thumbnail() {
$w_g_p_t = woocommerce_get_product_thumbnail();
global $product;
// Is a WC product
if ( is_a( $product, 'WC_Product' ) ) {
// On sale
$is_on_sale = $product->is_on_sale();
// True
if ( $is_on_sale ) {
$rrp_price = (int) $product->get_regular_price();
$sale_price = (int) $product->get_price();
// Greater than
if ( $rrp_price > $sale_price ) {
$discount_amount = $rrp_price - $sale_price;
$discount_percent = '-' . round( ( $discount_amount / $rrp_price ) * 100, 0 ) . '%';
$w_g_p_t = '<span class="wpd-sale-thumbnail"><span class="wpd-sale-badge">' . $discount_percent . '</span>' . $w_g_p_t . '</span>';
}
}
}
echo $w_g_p_t;
}
OR
function action_woocommerce_before_shop_loop_item_title() {
// Removes a function from a specified action hook.
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
global $product;
// Is a WC product
if ( is_a( $product, 'WC_Product' ) ) {
$size = 'woocommerce_thumbnail';
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
$get_image = $product->get_image( $image_size );
// On sale
$is_on_sale = $product->is_on_sale();
// True
if ( $is_on_sale ) {
$rrp_price = (int) $product->get_regular_price();
$sale_price = (int) $product->get_price();
// Greater than
if ( $rrp_price > $sale_price ) {
$discount_amount = $rrp_price - $sale_price;
$discount_percent = '-' . round( ( $discount_amount / $rrp_price ) * 100, 0 ) . '%';
$get_image = '<span class="wpd-sale-thumbnail"><span class="wpd-sale-badge">' . $discount_percent . '</span>' . $get_image . '</span>';
}
}
}
echo $product ? $get_image : '';
}
add_action( 'woocommerce_before_shop_loop_item_title', 'action_woocommerce_before_shop_loop_item_title', 9 );
I have also rewritten your existing code (for the single product page)
function filter_woocommerce_single_product_image_thumbnail_html( $html, $post_thumbnail_id ) {
// Get the global product object
global $product;
// Is a WC product
if ( is_a( $product, 'WC_Product' ) ) {
// On sale
$is_on_sale = $product->is_on_sale();
// True
if ( $is_on_sale ) {
$rrp_price = (int) $product->get_regular_price();
$sale_price = (int) $product->get_price();
// Greater than
if ( $rrp_price > $sale_price ) {
$discount_amount = $rrp_price - $sale_price;
$discount_percent = '-' . round( ( $discount_amount / $rrp_price ) * 100, 0 ) . '%';
$html = '<span class="wpd-sale-thumbnail"><span class="wpd-sale-badge">' . $discount_percent . '</span>' . $html . '</span>';
}
}
}
return $html;
}
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'filter_woocommerce_single_product_image_thumbnail_html', 10, 2 );
I'm trying to solve issue about displaying price in wordpress woocomerce. The preview site (loop) works fine also the single product page prices shows well. Only the variable price doesn't change with selection field. The main problem why I create filter for prices is displaying price with tax and without. My code look like :
add_filter('woocommerce_get_price_html', 'edit_price_display', 10, 2);
function edit_price_display() {
global $product;
$price = $product->get_price();
$tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
if (!empty($tax_rates)) {
$tax_rate = reset($tax_rates);
}
if($product->is_type( 'simple' ) && is_numeric($price)) {
$price_incl_tax = $price + round($price * ( $tax_rate['rate'] / 100 ), 2);
$price_incl_tax = wc_price($price_incl_tax);
$price = wc_price($price);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' . $price_incl_tax .' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price .' bez DPH </span>';
$display_price .= '</span>';
return $display_price;
}
if($product->is_type( 'variable' ) && is_numeric($price) && !is_single()) {
$minmax = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
if($minmax[0] == $minmax[1]){
$price_incl_tax = $minmax[0] + round($minmax[0] * ( $tax_rate['rate'] / 100 ), 2);
$price_incl_tax = wc_price($price_incl_tax);
$price = wc_price($minmax[0]);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' . $price_incl_tax .' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price .' bez DPH </span>';
$display_price .= '</span>';
}
if($minmax[0] != $minmax[1]){
$price_incl_tax_min = $minmax[0] + round($minmax[0] * ( $tax_rate['rate'] / 100 ), 2);
$price_incl_tax_min = wc_price($price_incl_tax_min);
$price_incl_tax_max = $minmax[1] + round($minmax[1] * ( $tax_rate['rate'] / 100 ), 2);
$price_incl_tax_max = wc_price($price_incl_tax_max);
$price_excl_tax_min = wc_price($minmax[0]);
$price_excl_tax_max = wc_price($minmax[1]);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' .$price_incl_tax_min. ' - ' .$price_incl_tax_max. ' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price_excl_tax_min .' - '.$price_excl_tax_max.' bez DPH </span>';
$display_price .= '</span>';
}
return $display_price;
}
if($product->is_type( 'variable' ) && is_numeric($price) && is_single()) {
return $product->price; // Issue is right her !
}
if( $price == '' || $price == '-' ) {
$display_price = '<span class="amount">Cena na dopyt</span>';
return $display_price;
}
}
I think the problem is in (multidimensional) array filling. Because the variation.php file handling the price show up for variable product. In the variation we can see something like :
<script type="text/template" id="tmpl-variation-template">
<div class="woocommerce-variation-description">{{{ data.variation.variation_description }}}</div>
<div class="woocommerce-variation-price">{{{ data.variation.price_html }}}</div>
<div class="woocommerce-variation-availability">{{{ data.variation.availability_html }}}</div>
</script>
But I have no idea how that mentioned array looks like ?
It is not the best solution to modify riginal loop/price.php file but it is quick. The final code looks like:
global $product;
if ( $price_html = $product->get_price_html() ) {
$price = $product->get_price();
$tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
if (!empty($tax_rates)) {
$tax_rate = reset($tax_rates);
}
if ( '' === $price || 0 == $price ) {
$display_price = $price_html;
}
if($product->is_type( 'simple' ) && is_numeric($price)) {
$price_incl_tax = round($price * (1 + ($tax_rate['rate'] / 100) ), 2);
$price_incl_tax = wc_price($price_incl_tax);
$price = wc_price($price);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' . $price_incl_tax .' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price .' bez DPH </span>';
$display_price .= '</span>';
}
if($product->is_type( 'variable' ) && is_numeric($price) && $price > 0) {
$minmax = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
if($minmax[0] == $minmax[1]){
$price_excl_tax = round($minmax[0] / (1 + ($tax_rate['rate'] / 100) ), 2);
$price_excl_tax = wc_price($price_excl_tax);
$price = wc_price($minmax[0]);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' . $price .' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price_excl_tax .' bez DPH </span>';
$display_price .= '</span>';
}
if($minmax[0] != $minmax[1]){
$price_excl_tax_min = round($minmax[0] / (1 + ($tax_rate['rate'] / 100) ), 2);
$price_excl_tax_min = wc_price($price_excl_tax_min);
$price_excl_tax_max = round($minmax[1] / (1 + ($tax_rate['rate'] / 100) ), 2);
$price_excl_tax_max = wc_price($price_excl_tax_max);
$price_incl_tax_min = wc_price($minmax[0]);
$price_incl_tax_max = wc_price($minmax[1]);
$display_price = '<span class="price">';
$display_price .= '<span class="amount">' .$price_incl_tax_min. ' - ' .$price_incl_tax_max. ' s DPH </span>';
$display_price .= '<br>';
$display_price .= '<span class="amount">' . $price_excl_tax_min .' - '.$price_excl_tax_max.' bez DPH </span>';
$display_price .= '</span>';
}
}
echo $display_price;
}
And for single product page use shortcode {price_excluding_tax} as price suffix located in woocommerce tax.
I'd like to display the sale price of a product before the regular (discounted) price. I know this has something to do with get_price_html. By default, this outputs something like:
<del>regular price</del>
<ins>sale price</ins>
I want to change the output so it looks like this (basically, the two prices are shown in a different order):
<ins>sale price</ins>
<del>regular price</del>
How can I do this?
Yes you have to alter get_price_html method which can be done by
using following hook's:
For Simple Product: woocommerce_get_price_html hook.
For Variable Product: woocommerce_variation_sale_price_html & woocommerce_variation_price_html
For Variable Product Min Max Price: woocommerce_variable_sale_price_html &
woocommerce_variable_price_html
UPDATED 16th Feb 2018
Here is the code:
For WooCommerce version 2.6.x or below
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>' . woocommerce_price($sale_price) . '</ins>';
$html_price .= '<del>' . woocommerce_price($regular_price) . '</del>';
}
//in sale but free
else if (($price_amt == $sale_price) && ($sale_price == 0)) {
$html_price .= '<ins>Free!</ins>';
$html_price .= '<del>' . woocommerce_price($regular_price) . '</del>';
}
//not is sale
else if (($price_amt == $regular_price) && ($regular_price != 0)) {
$html_price .= '<ins>' . woocommerce_price($regular_price) . '</ins>';
}
//for free product
else if (($price_amt == $regular_price) && ($regular_price == 0)) {
$html_price .= '<ins>Free!</ins>';
}
$html_price .= '</p>';
return $html_price;
}
}
add_filter('woocommerce_get_price_html', 'my_simple_product_price_html', 100, 2);
function my_simple_product_price_html($price, $product) {
if ($product->is_type('simple')) {
$regular_price = $product->regular_price;
$sale_price = $product->sale_price;
$price_amt = $product->price;
return my_commonPriceHtml($price_amt, $regular_price, $sale_price);
} else {
return $price;
}
}
add_filter('woocommerce_variation_sale_price_html', 'my_variable_product_price_html', 10, 2);
add_filter('woocommerce_variation_price_html', 'my_variable_product_price_html', 10, 2);
function my_variable_product_price_html($price, $variation) {
$variation_id = $variation->variation_id;
//creating the product object
$variable_product = new WC_Product($variation_id);
$regular_price = $variable_product->regular_price;
$sale_price = $variable_product->sale_price;
$price_amt = $variable_product->price;
return my_commonPriceHtml($price_amt, $regular_price, $sale_price);
}
add_filter('woocommerce_variable_sale_price_html', 'my_variable_product_minmax_price_html', 10, 2);
add_filter('woocommerce_variable_price_html', 'my_variable_product_minmax_price_html', 10, 2);
function my_variable_product_minmax_price_html($price, $product) {
$variation_min_price = $product->get_variation_price('min', true);
$variation_max_price = $product->get_variation_price('max', true);
$variation_min_regular_price = $product->get_variation_regular_price('min', true);
$variation_max_regular_price = $product->get_variation_regular_price('max', true);
if (($variation_min_price == $variation_min_regular_price) && ($variation_max_price == $variation_max_regular_price)) {
$html_min_max_price = $price;
} else {
$html_price = '<p class="price">';
$html_price .= '<ins>' . woocommerce_price($variation_min_price) . '-' . woocommerce_price($variation_max_price) . '</ins>';
$html_price .= '<del>' . woocommerce_price($variation_min_regular_price) . '-' . woocommerce_price($variation_max_regular_price) . '</del>';
$html_min_max_price = $html_price;
}
return $html_min_max_price;
}
For WooCommerce version 3.0 or above
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 .= '<del>' . wc_price($regular_price) . '</del>';
}
//in sale but free
else if (($price_amt == $sale_price) && ($sale_price == 0)) {
$html_price .= '<ins>Free!</ins>';
$html_price .= '<del>' . wc_price($regular_price) . '</del>';
}
//not is sale
else if (($price_amt == $regular_price) && ($regular_price != 0)) {
$html_price .= '<ins>' . wc_price($regular_price) . '</ins>';
}
//for free product
else if (($price_amt == $regular_price) && ($regular_price == 0)) {
$html_price .= '<ins>Free!</ins>';
}
$html_price .= '</p>';
return $html_price;
}
}
add_filter('woocommerce_get_price_html', 'my_simple_product_price_html', 100, 2);
function my_simple_product_price_html($price, $product) {
if ($product->is_type('simple')) {
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
$price_amt = $product->get_price();
return my_commonPriceHtml($price_amt, $regular_price, $sale_price);
} else {
return $price;
}
}
add_filter('woocommerce_variation_sale_price_html', 'my_variable_product_price_html', 10, 2);
add_filter('woocommerce_variation_price_html', 'my_variable_product_price_html', 10, 2);
function my_variable_product_price_html($price, $variation) {
$variation_id = $variation->variation_id;
//creating the product object
$variable_product = new WC_Product($variation_id);
$regular_price = $variable_product->get_regular_price();
$sale_price = $variable_product->get_sale_price();
$price_amt = $variable_product->get_price();
return my_commonPriceHtml($price_amt, $regular_price, $sale_price);
}
add_filter('woocommerce_variable_sale_price_html', 'my_variable_product_minmax_price_html', 10, 2);
add_filter('woocommerce_variable_price_html', 'my_variable_product_minmax_price_html', 10, 2);
function my_variable_product_minmax_price_html($price, $product) {
$variation_min_price = $product->get_variation_price('min', true);
$variation_max_price = $product->get_variation_price('max', true);
$variation_min_regular_price = $product->get_variation_regular_price('min', true);
$variation_max_regular_price = $product->get_variation_regular_price('max', true);
if (($variation_min_price == $variation_min_regular_price) && ($variation_max_price == $variation_max_regular_price)) {
$html_min_max_price = $price;
} else {
$html_price = '<p class="price">';
$html_price .= '<ins>' . wc_price($variation_min_price) . '-' . wc_price($variation_max_price) . '</ins>';
$html_price .= '<del>' . wc_price($variation_min_regular_price) . '-' . wc_price($variation_max_regular_price) . '</del>';
$html_min_max_price = $html_price;
}
return $html_min_max_price;
}
Code goes in functions.php file of your active child theme (or theme). Or also in any plugin php files.
Code is tested and works.
Hope this helps!
When i put the following into to my functions.php it crashes my entire site.
the purpose of this function is to change
elseif ( $method->id !== 'free_shipping' ) {
$label .= ' (' . __( '**Free**', 'woocommerce' ) . ')';
to this...
elseif ( $method->id !== 'free_shipping' ) {
$label .= ' (' . __( '**To Be Calculated**', 'woocommerce' ) . ')';
When i change the one word in the original woocommerce/includes/wc-cart-functions.php it works perfectly. I don't want it to be overwritten with an update.
/**
* Get a shipping methods full label including price
* #param object $method
* #return string
*/
function wc_cart_totals_shipping_method_label( $method ) {
$label = $method->label;
if ( $method->cost > 0 ) {
if ( WC()->cart->tax_display_cart == 'excl' ) {
$label .= ': ' . wc_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
$label .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
$label .= ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}
} elseif ( $method->id !== 'free_shipping' ) {
$label .= ' (' . __( 'To Be Calculated', 'woocommerce' ) . ')';
}
return apply_filters( 'woocommerce_cart_shipping_method_full_label', $label, $method );
}
if you are using latest woo commerce then following filter will be helpful to you.
add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_local_pickup_free_label', 10, 2 );
function remove_local_pickup_free_label($full_label, $method){
$full_label = str_replace("(Free)","(TBD)",$full_label);
return $full_label;
}
You should rebuild the function through the filter. Using str_replace will not work on translated installs, unless each language is checked in the replacement.
function ua_woocommerce_cart_shipping_method_full_label( $label, $method ) {
$label = $method->label;
if ( $method->cost > 0 ) {
if ( WC()->cart->tax_display_cart == 'excl' ) {
$label .= ': ' . wc_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
$label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
$label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}
}
return $label;
}
add_filter( 'woocommerce_cart_shipping_method_full_label', 'ua_woocommerce_cart_shipping_method_full_label', 10, 2 );