Hello,

do you know how to display the amount of the basket next to the number of elements?
As this page http://demo.commerceguys.com/cart

/**
 * Returns the title of the shopping cart menu item with an item count.
 */
function commerce_cart_menu_item_title() {
  global $user;

  // Default to a static title.
  $title = t('Shopping cart');

  // If the user actually has a cart order...
  if ($order = commerce_cart_order_load($user->uid)) {
    // Count the number of product line items on the order.
    $wrapper = entity_metadata_wrapper('commerce_order', $order);
    $quantity = commerce_line_items_quantity($wrapper->commerce_line_items, commerce_product_line_item_types());

    // If there are more than 0 product line items on the order...
    if ($quantity > 0) {
      // Use the dynamic menu item title.
      $title = format_plural($quantity, 'Shopping cart (1 item)', 'Shopping cart (@count items)');
    }
  }

  return $title;
}

thank you in advance

Comments

domaine created an issue. See original summary.

zenimagine’s picture

Title: Display the amount of the order on the block » Display the amount of the order on the block cart
rszrama’s picture

Category: Task » Support request
Status: Active » Closed (won't fix)

Per the issue submission guidelines, we don't really handle support requests in this queue. Additionally, what you're asking about is the default behavior of the shopping cart block that ships with Drupal Commerce. I'm not sure why you aren't seeing that in your site, but if you have further issues enabling it, please post your question with more information at https://drupal.stackexchange.com.

zenimagine’s picture

thank you I will see it