Right now i am displaying the tax for all hte prices like total and shipping, now i have the requirement to add the same tax values for the subtotals as well as shown in the following image
I have found nothing related to this but for the cart page to add new field with the others, SO actually i want to add this tax information with the subtotal field.
Show subtotal excl. tax, add subtotal tax as separate row on Woocommerce checkout
To display in cart subtotal (orders and notifications) like "71,540.20€ (includes 11400,00€ VAT)", you can try to use the following:
// Cart and checkout (for display including taxes - not compound)
add_filter('woocommerce_cart_subtotal', 'wc_cart_subtotal_incl_tax_amount_filter', 10, 3 );
function wc_cart_subtotal_incl_tax_amount_filter( $cart_subtotal, $compound, $cart ) {
if ( wc_tax_enabled() && $cart->get_subtotal_tax() > 0 && ! $compound ) {
$subtotal_tax = wc_price( $cart->get_subtotal_tax() );
$cart_subtotal = wc_price( $cart->get_subtotal() + $cart->get_subtotal_tax() );
$tax_label = in_array( WC()->countries->get_base_country(), array_merge( WC()->countries->get_european_union_countries( 'eu_vat' ), array( 'NO' ) ), true ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' );
$cart_subtotal .= sprintf( ' <small>' . esc_html__( '(includes %s %s)', 'woocommerce' ) . '</small>', $subtotal_tax, $tax_label );
}
return $cart_subtotal;
}
// Orders and emails (for display including taxes - not compound)
add_filter('woocommerce_order_subtotal_to_display', 'wc_order_subtotal_incl_tax_amount_filter', 10, 3 );
function wc_order_subtotal_incl_tax_amount_filter( $subtotal, $compound, $order ) {
if ( wc_tax_enabled() && $order->get_total_tax() > 0 && ! $compound ) {
$subtotal_tax = $subtotal = 0; // Initializing
// Loop through order items
foreach ( $order->get_items() as $item ) {
$subtotal += $item->get_subtotal() + $item->get_subtotal_tax();
$subtotal_tax += $item->get_subtotal_tax();
}
$subtotal = wc_price( $subtotal, array( 'currency' => $order->get_currency() ) );
$subtotal_tax = wc_price( $subtotal_tax, array( 'currency' => $order->get_currency() ) );
$tax_label = in_array( WC()->countries->get_base_country(), array_merge( WC()->countries->get_european_union_countries( 'eu_vat' ), array( 'NO' ) ), true ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' );
$subtotal .= sprintf( ' <small>' . esc_html__( '(includes %s %s)', 'woocommerce' ) . '</small>', $subtotal_tax, $tax_label );
}
return $subtotal;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.
Related
I have a WordPress woo-commerce site I'm working on which has variable products of 1pack, 5pack, 10pack & 30pack. The price for 1pack if you choose the 30pack variant is the cheapest, and this is the price I wish to show to people who visit the site. I'm trying to have a place in the back end of the site where this price can be specified and displayed, as the calculation varies for each product.
I modified this code here Display prefixed price and additional unit price in Woocommerce simple products.
add_filter( 'woocommerce_get_price_html', 'unit_product_price_on_archives', 10, 2 );
function unit_product_price_on_archives( $price, $product ) {
if ( is_product() || is_product_category() || is_product_tag() ) {
$unit_divider = 6;
$group_suffix = ' '. __('pack', 'woocommerce');
$unit_suffix = ' '. __('(per pack)', 'woocommerce');
if( $product->is_on_sale() )
{
$regular_price_unit = $product->get_regular_price() / $unit_divider;
$regular_price_unit = wc_get_price_to_display( $product, array( 'price' => $regular_price_unit ) );
$regular_price_group = $product->get_regular_price();
$regular_price_group = wc_get_price_to_display( $product, array( 'price' => $regular_price_group ) );
$group_price_sale = $product->get_sale_price();
$group_price_sale = wc_get_price_to_display( $product, array( 'price' => $group_price_sale ) );
$group_price_sale = wc_format_sale_price( $regular_price_group, $group_price_sale ) . $group_suffix;
$unit_price_sale = $product->get_sale_price() / $unit_divider;
$unit_price_sale = wc_get_price_to_display( $product, array( 'price' => $unit_price_sale ) );
$unit_price_sale = wc_format_sale_price( $regular_price_unit, $unit_price_sale ) . $unit_suffix;
$price = $group_price_sale . '<br>' . $unit_price_sale;
}
else
{
$group_price = $price;
$group_price = $group_price . $group_suffix;
$unit_price = $product->get_price() / $unit_divider;
$unit_price = wc_get_price_to_display( $product, array( 'price' => $unit_price ) );
$unit_price = $price = wc_price($unit_price) . $unit_suffix;
$price = $group_price . '<br>' . $unit_price;
}
}
return $price;
}
But the code only divided the original simple product by 6.
this should achieve the result you're looking for:
/** Variable Product Price Range: "From: $$$min_price" */
add_filter( 'woocommerce_variable_price_html', '
bbloomer_variation_price_format_min', 9999, 2 );
function bbloomer_variation_price_format_min( $price, $product ) {
$prices = $product->get_variation_prices( true );
$min_price = current( $prices['price'] );
$price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
return $price;
}
I am trying to implement warranty option into woocommerce checkout. The below code works for static price values.
// Part 1 - Display Radio Buttons
add_action( 'woocommerce_review_order_before_payment', 'custom_checkout_radio_choice' );
function custom_checkout_radio_choice() {
$chosen = WC()->session->get( 'radio_chosen' );
$chosen = empty( $chosen ) ? WC()->checkout->get_value( 'radio_choice' ) : $chosen;
$chosen = empty( $chosen ) ? '0' : $chosen;
$args = array(
'type' => 'radio',
'class' => array( 'form-row-wide', 'update_totals_on_change' ),
'options' => array(
'0' => '1 Year Repair or Replace Warranty - Included',
'75' => '2 Years Extended Warranty ($75.00)',
'112.5' => '3 Years Extended Warranty ($112.50)',
),
'default' => $chosen
);
echo '<div id="checkout-radio">';
echo '<h4>Choose your Warranty</h4>';
woocommerce_form_field( 'radio_choice', $args, $chosen );
echo '</div><br>';
}
// Part 2 - Add Fee and Calculate Total
add_action( 'woocommerce_cart_calculate_fees', 'custom_checkout_radio_choice_fee', 20, 1 );
function custom_checkout_radio_choice_fee( $cart ) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
$radio = WC()->session->get( 'radio_chosen' );
if ( $radio ) {
$cart->add_fee( 'Warranty Option', $radio );
}
}
// Part 3 - Add Radio Choice to Session
add_action( 'woocommerce_checkout_update_order_review', 'custom_checkout_radio_choice_set_session' );
function custom_checkout_radio_choice_set_session( $posted_data ) {
parse_str( $posted_data, $output );
if ( isset( $output['radio_choice'] ) ){
WC()->session->set( 'radio_chosen', $output['radio_choice'] );
}
}
Is there a way to output the calculated warranty amount options based on the percentage of items Subtotal Amount? Like:
2 years warranty price is 10% of the Subtotal Price.
3 year warranty is 15%. Example:
For example if the Subtotal is $85, warranty options to display would be:
2 Years Extended Warranty ($8.50) /* 10% */
3 Years Extended Warranty ($12.75) /* 15% */
OPTIONAL: I'm also trying to use this feature to a particular product or a set of products and not to all products. If there's a way to set this.
To get a custom percentage fee based on specific cart items subtotal (for a defined set of product IDs) and on radio button (percentage warranty choice), use the following revisited code:
// Custom function to get related cart items subtotal for specific defined product Ids
function get_related_items_subtotal( $cart ) {
// HERE below define the related targeted products IDs in the array
$targeted_ids = array(29, 27, 28, 72, 84, 95);
$custom_subtotal = 0; // Initialize
// Loop through cart items
foreach ( $cart->get_cart() as $item ) {
if ( array_intersect($targeted_ids, array($item['product_id'], $item['variation_id']) ) ) {
$custom_subtotal += $item['line_subtotal'] + $item['line_subtotal_tax'];
}
}
return $custom_subtotal;
}
// 1 - Display custom checkout radio buttons fields
add_action( 'woocommerce_review_order_before_payment', 'display_custom_checkout_radio_buttons' );
function display_custom_checkout_radio_buttons() {
$custom_subtotal = get_related_items_subtotal( WC()->cart );
if ( $custom_subtotal > 0 ) {
$value = WC()->session->get( 'warranty' );
$value = empty( $value ) ? WC()->checkout->get_value( 'warranty' ) : $value;
$value = empty( $value ) ? '0' : $value;
echo '<div id="checkout-radio">
<h4>' . __("Choose your Warranty") .'</h4>';
woocommerce_form_field( 'warranty', array(
'type' => 'radio',
'class' => array( 'form-row-wide', 'update_totals_on_change' ),
'options' => array(
'0' => __( '1 Year Repair or Replace Warranty - Included', 'woocommerce' ),
'10' => __( '2 Years Extended Warranty', 'woocommerce' ) . ' (' . strip_tags( wc_price( 10 * $custom_subtotal / 100 ) ) . ')',
'15' => __( '3 Years Extended Warranty', 'woocommerce' ) . ' (' . strip_tags( wc_price( 15 * $custom_subtotal / 100 ) ) . ')',
),
), $value );
echo '</div>';
}
}
// 2 - Customizing Woocommerce checkout radio form field
add_filter( 'woocommerce_form_field_radio', 'custom_form_field_radio', 20, 4 );
function custom_form_field_radio( $field, $key, $args, $value ) {
if ( ! empty( $args['options'] ) && 'warranty' === $key && is_checkout() ) {
$field = str_replace( '</label><input ', '</label><br><input ', $field );
$field = str_replace( '<label ', '<label style="display:inline;margin-left:8px;" ', $field );
}
return $field;
}
// 3 - Add a percentage Fee based on radio buttons for specific defined product Ids
add_action( 'woocommerce_cart_calculate_fees', 'percentage_fee_based_on_radio_buttons', 20 );
function percentage_fee_based_on_radio_buttons( $cart ) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$percentage = (float) WC()->session->get( 'warranty' );
if ( $percentage ) {
$custom_subtotal = get_related_items_subtotal( $cart );
if ( $custom_subtotal > 0 ) {
$label_text = sprintf( __('Extended Warranty %d years', 'woocommerce'), $percentage == 10 ? 2 : 3 );
$cart->add_fee( $label_text, $custom_subtotal * $percentage / 100 );
}
}
}
// 4 - Set chosen radio button value to a WC Session variable
add_action( 'woocommerce_checkout_update_order_review', 'chosen_input_radio_button_value_to_wc_session' );
function chosen_input_radio_button_value_to_wc_session( $posted_data ) {
parse_str( $posted_data, $fields );
if ( isset( $fields['warranty'] ) ){
WC()->session->set( 'warranty', $fields['warranty'] );
}
}
Code goes in functions.php file of the active child theme (or active theme). Tested and works.
I have a WooCommerce webshop with different kind of beers from all over the world. If you return a empty bottle you get a deposit of 0,10 or something like that. I made an ACF (Advanced Custom Field) where I can add the deposit price for an empty bottle. I managed to add this to my cart page and display it under the single price of a bottle (0,10) and under the subtotal if there are more bottles (0,40).
This is working in cart and checkout but I want to make a sum off the total deposit money if you return the bottles to the store.
How can I create a function that calculate the sum of all bottles in the cart that has a deposit?
I managed to get the first this working with this functions:
add_filter( 'woocommerce_cart_item_price', 'add_deposit_value_to_cart_single' , 10, 3 );
add_filter( 'woocommerce_cart_item_subtotal', 'add_deposit_value_to_cart_total', 10, 3 );
/**
* Statiegeld toevoegen onder single prijs product winkelwagen
*/
function add_deposit_value_to_cart_single( $product_price, $values ) {
$statiegeld = get_field( "statiegeld", $values['product_id']);
$dep_total = $statiegeld;
if( ! empty( $dep_total ) )
return $product_price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld %s' ), wc_price( $dep_total ) ) . '</small>';
return $product_price;
}
/**
* Statiegeld toevoegen aan subtotaal in winkelwagen
*/
function add_deposit_value_to_cart_total( $product_price, $values ) {
$statiegeld = get_field( "statiegeld", $values['product_id']);
$dep_total = $statiegeld * $values['quantity'];
if( ! empty( $dep_total ) )
return $product_price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld totaal %s' ), wc_price( $dep_total ) ) . '</small>';
return $product_price;
}
If someone has an idea I am very grateful because I can't figure it out.
There are some errors with the arguments of both functions.
Try this:
/**
* Statiegeld toevoegen onder single prijs product winkelwagen
*/
add_filter( 'woocommerce_cart_item_price', 'add_deposit_value_to_cart_single' , 10, 3 );
function add_deposit_value_to_cart_single( $price, $cart_item, $cart_item_key ) {
$statiegeld = get_field( "statiegeld", $cart_item['product_id']);
$dep_total = $statiegeld;
if( ! empty( $dep_total ) )
return $price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld %s' ), wc_price( $dep_total ) ) . '</small>';
return $price;
}
/**
* Statiegeld toevoegen aan subtotaal in winkelwagen
*/
add_filter( 'woocommerce_cart_item_subtotal', 'add_deposit_value_to_cart_total', 10, 3 );
function add_deposit_value_to_cart_total( $price, $cart_item, $cart_item_key ) {
$statiegeld = get_field( "statiegeld", $cart_item['product_id']);
$dep_total = $statiegeld * $cart_item['quantity'];
if ( ! empty( $dep_total ) ) {
return $price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld totaal %s' ), wc_price( $dep_total ) ) . '</small>';
}
return $price;
}
I have tested the code and it works fine. Here is the result:
I changed my whole code to this and this is working. This wil show a deposit in the cart summary under the price and a total deposit if it are more items under the subtotal.
Also in the cart total summary it is displaying the depost total of all items and in checkout too.
add_filter( 'woocommerce_cart_item_price', 'add_deposit_value_to_cart_single' , 10, 3 );
add_filter( 'woocommerce_cart_item_subtotal', 'add_deposit_value_to_cart_total', 10, 3 );
/**
* Statiegeld toevoegen aan single product
*/
function add_deposit_value_to_cart_single( $product_price, $values, $cart_item_key ) {
// Get your custom fields data
$custom_field1 = get_post_meta( $values['product_id'], '_aantal_statiegeld', true );
//$statiegeld = get_field( "statiegeld", $values['product_id']);
$dep_total = $custom_field1;
if( ! empty( $dep_total ) )
return $product_price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld %s' ), wc_price( $dep_total ) ) . '</small>';
return $product_price;
}
/**
* Statiegeld toevoegen aan totaal
*/
function add_deposit_value_to_cart_total( $product_price, $values, $cart_item_key ) {
// Get your custom fields data
$custom_field1 = get_post_meta( $values['product_id'], '_aantal_statiegeld', true );
//$custom_field1 = get_field( "statiegeld", $values['product_id']);
$dep_total = $custom_field1 * $values['quantity'];
if( ! empty( $dep_total ) )
return $product_price . '<br /><small class="deposit_label">' . sprintf( __( 'statiegeld totaal %s' ), wc_price( $dep_total ) ) . '</small>';
return $product_price;
}
// Display Fields using WooCommerce Action Hook
add_action( 'woocommerce_product_options_general_product_data', 'woocom_general_product_data_custom_field' );
function woocom_general_product_data_custom_field() {
// Create a custom text field
// Number Field
woocommerce_wp_text_input(
array(
'id' => '_aantal_statiegeld',
'label' => __( 'Statiegeld', 'woocommerce' ),
'placeholder' => '',
'description' => __( 'Vul het statiegeld hier in', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any',
'min' => '0,10'
)
)
);
}
// Hook to save the data value from the custom fields
add_action( 'woocommerce_process_product_meta', 'woocom_save_general_proddata_custom_field' );
/** Hook callback function to save custom fields information */
function woocom_save_general_proddata_custom_field( $post_id ) {
// Save Number Field
$number_field = $_POST['_aantal_statiegeld'];
if( ! empty( $number_field ) ) {
update_post_meta( $post_id, '_aantal_statiegeld', esc_attr( $number_field ) );
}
}
add_action( 'woocommerce_product_additional_information', 'custom_data_in_product_add_info_tab', 20, 1 );
function custom_data_in_product_add_info_tab( $product ) {
//Product ID - WooCommerce compatibility
$product_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $product->id;
// Get your custom fields data
$custom_field1 = get_post_meta( $product_id, '_aantal_statiegeld', true );
// Set your custom fields labels (or names)
$label1 = __( 'Statiegeld', 'woocommerce');
// The Output
echo '<h3>'. __('Statiegeld totaal', 'woocommerce') .'</h3>
<table class="custom-fields-data">
<tbody>
<tr class="custom-field1">
<th>'. $label1 .'</th>
<td>'. $custom_field1 .'</td>
</tr>
</tbody>
</table>';
}
add_action( 'woocommerce_cart_totals_before_shipping', 'display_cart_volume_total', 20 );
add_action( 'woocommerce_review_order_before_shipping', 'display_cart_volume_total', 20 );
function display_cart_volume_total() {
$total_volume = 0;
// Loop through cart items and calculate total volume
foreach( WC()->cart->get_cart() as $cart_item ){
$product_volume = (float) get_post_meta( $cart_item['product_id'], '_aantal_statiegeld', true );
$total_volume += $product_volume * $cart_item['quantity'];
}
if( $total_volume > 0 ){
// The Output
echo ' <tr class="cart-total-volume">
<th>' . __( "Statiegeld totaal", "woocommerce" ) . '</th>
<td data-title="total-statiegeld">€' . number_format($total_volume, 2, ',', '.') . '</td>
</tr>';
}
}
I want to Alter function validate_coupon_minimum_amount() adding a condition that if a user use coupon "refresh18", check to see if subtotal in cart for a product category is greater than the coupon's minimum amount.
How could I do that?
Here is my code below that doesn't work:
function check_minimum_parts_amount_in_cart($coupon) {
$cart_parts_subtotal = 0;
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
$terms = get_the_terms( $product_id, 'product_cat' );
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) && has_term( 'ice-shaving-parts', 'product_cat', $product_id ) ) {
//echo '<pre>' . print_r($cart_item , 1) . '</pre>';
//echo $cart_item['quantity'];
$cart_parts_subtotal = $cart_parts_subtotal + ( $_product->get_price() * $cart_item['quantity'] );
}
}
$subtotal = wc_remove_number_precision( $this->get_object_subtotal() );
if( $coupon->get_name() == 'refresh2018' ){
if( $coupon->get_minimum_amount() > 0 && apply_filters( 'woocommerce_coupon_validate_minimum_amount', $coupon->get_minimum_amount() > $cart_parts_subtotal, $coupon, $cart_parts_subtotal )){
/* translators: %s: coupon minimum amount */
throw new Exception( sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $coupon->get_minimum_amount() ) ), 108 );
}else{
return true;
}
}else{
if ( $coupon->get_minimum_amount() > 0 && apply_filters( 'woocommerce_coupon_validate_minimum_amount', $coupon->get_minimum_amount() > $subtotal, $coupon, $subtotal )) {
/* translators: %s: coupon minimum amount */
throw new Exception( sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $coupon->get_minimum_amount() ) ), 108 );
}else{
return true;
}
}
}
add_filter('validate_coupon_minimum_amount', 'check_minimum_parts_amount_in_cart');
Updated:
Since Woocommerce 3.2+ use instead woocommerce_coupon_validate_minimum_amount filter hook… So you should try this revisited code (Where you will have to set your product category):
add_filter( 'woocommerce_coupon_validate_minimum_amount', 'custom_check_minimum_amount_in_cart', 10, 3 );
function custom_check_minimum_amount_in_cart( $valid, $coupon, $subtotal ) {
// HERE below your settings (Coupon code and product category)
$coupon_code = 'refresh18';
$product_category = 'clothing'; // <== To be replaced by your targeted product category
$cat_subtotal = 0;
foreach ( WC()->cart->get_cart() as $cart_item ){
if( has_term( $product_category, 'product_cat', $cart_item['product_id'] ) )
$cat_subtotal += $cart_item['line_subtotal'];
}
if( $coupon->get_code() == $coupon_code && $coupon->get_minimum_amount() > $cat_subtotal ){
throw new Exception( sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $coupon->get_minimum_amount() ) ), 108 );
}
return $valid;
}
This code goes on function.php file of your active child theme (or theme). It should work.
Note: For everybody, remember to set in this function the coupon code in lowercase.
I have a problem with this code for add a row in email & thank you page.
add_filter( 'woocommerce_get_order_item_totals', 'bbloomer_add_recurring_row_email', 10, 2 );
function bbloomer_add_recurring_row_email( $total_rows, $myorder_obj ) {
$total_rows['recurr_not'] = array(
'label' => __( 'Rec:', 'woocommerce' ),
'value' => 'blabla'
);
return $total_rows;
}
I have a function to add "Total excl. VAT" row in the cart :
<?php
global $woocommerce;
$frais = 1.01;
echo '<tr class ="totalht">
<th>'. __( 'Total HT', 'woocommerce' ) .'</th>
<td data-title=" '. __( 'Total HT', 'woocommerce' ) .' ">'
. wc_price( ( $woocommerce->cart->cart_contents_total * $frais ) + $woocommerce->cart->shipping_total ) .'<span class="ht-panier">HT</span></td>
</tr>';
?>
It's working good : https://prnt.sc/irglky
But when I modify the first function :
add_filter( 'woocommerce_get_order_item_totals', 'bbloomer_add_recurring_row_email', 5, 2 );
function bbloomer_add_recurring_row_email( $total_rows, $myorder_obj ) {
global $woocommerce;
$frais = 1.01;
$price_excl_vat = wc_price( ( $woocommerce->cart->cart_contents_total * $frais ) + $woocommerce->cart->shipping_total );
$total_rows['recurr_not'] = array(
'label' => __( 'Total HT :', 'woocommerce' ),
'value' => $price_excl_vat
);
return $total_rows;
}
It's not working on the Thank you page
But it's working on email...
Someone can explain me why it's working on email but not in the "Thank you page"?
Updated: As this hook is for Order data, but Not cart data, you should try this instead, where I set the additional row before the last one:
add_filter( 'woocommerce_get_order_item_totals', 'add_custom_order_totals_row', 30, 3 );
function add_custom_order_totals_row( $total_rows, $order, $tax_display ) {
$costs = 1.01;
// Set last total row in a variable and remove it.
$gran_total = $total_rows['order_total'];
unset( $total_rows['order_total'] );
// Insert a new row
$total_rows['recurr_not'] = array(
'label' => __( 'Total HT :', 'woocommerce' ),
'value' => wc_price( ( $order->get_total() - $order->get_total_tax() ) * $costs ),
);
// Set back last total row
$total_rows['order_total'] = $gran_total;
return $total_rows;
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.
For cart you should use this (as global $woocommerce; is no longer needed):
<?php
$costs = 1.01;
echo '<tr class ="totalht">
<th>'. __( 'Total HT', 'woocommerce' ) .'</th>
<td data-title=" '. __( 'Total HT', 'woocommerce' ) .' ">'
. wc_price( ( WC()->cart->cart_contents_total * $costs ) + WC()->cart->shipping_total ) .'<span class="ht-panier">HT</span></td>
</tr>';
?>