Woocommerce checkout process dual price display
-
On my cart and checkout process, I want to show the price in 2 currencies (USD and CFP)
The USD $ is calculated based on a price in CFP (which is my setup currency in woocommerce)
With the following code, I managed to make the dual display work but could make the calculation conversion work.
add_filter( ‘woocommerce_cart_item_price’, ‘cart_dollars_custom_price_message’ );
add_filter( ‘woocommerce_cart_item_subtotal’, ‘cart_dollars_custom_price_message’ );
add_filter( ‘woocommerce_cart_subtotal’, ‘cart_dollars_custom_price_message’ );
add_filter( ‘woocommerce_cart_total’, ‘cart_dollars_custom_price_message’ );function cart_dollars_custom_price_message( $price ) {
$dollars_conversion = $price * 0.01044;
$dollars_conversion = number_format($dollars_conversion, 2);
$price = ‘USD $ ‘ . $dollars_conversion . ‘ . ‘ . $price;
return $price;
}The page I need help with: [log in to see the link]
- The topic ‘Woocommerce checkout process dual price display’ is closed to new replies.