1

How to print price without decimals in drupal commerce cart block? I found this code:

<?php
global $user;
$order = commerce_cart_order_load($user->uid);
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$order_total = $wrapper->commerce_order_total->value();
$quantity = 0;
foreach ($wrapper->commerce_line_items as $delta => $line_item_wrapper) {
  $quantity += $line_item_wrapper->quantity->value();
}
?>

items. .

Code working correctly but price render with decimals.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.