Add a second Price/m2 working with multicurrency
I need to display for my products(tiles) 2 prices.
One is the price for the complete box(the one which is used in the cart)
And the second one is just a display, which outputs price per m2 according to my field "surface per box" ex: 1.52m2 / box.
I have used the module computed field to compute my second price :
$surface = $entity->field_surface_in_one_box['und']['value'];
$price = $entity->commerce_price['und']['amount'];
$entity_field['value'] = $price / 100 / $surface;
$display_output = $entity->commerce_price['und']['currency_code'] . " " . number_format($entity_field_item['value'], 2, '.', '') . "/m2";
It's working great, but now I have to make it work with multicurrency module.
The symbol is switching correctly, but I have no clue howto convert the value itself according to the currency chosen in the block currency.