You are here

function theme_basic_cart_cart_total_price in Basic cart 7.2

Same name and namespace in other branches
  1. 7.3 basic_cart.theme.inc \theme_basic_cart_cart_total_price()

Theme implementation for rendering the total price.

@todo find a way to pass $price through the variables array.

1 theme call to theme_basic_cart_cart_total_price()
basic_cart_cart_form in ./basic_cart.cart.inc
Shopping cart form.

File

./basic_cart.theme.inc, line 52

Code

function theme_basic_cart_cart_total_price($variables) {
  $price = basic_cart_get_total_price();
  $total = basic_cart_price_format($price->total);

  // Building the HTML.
  $html = '<div class="basic-cart-cart-total-price-contents row">';
  $html .= '  <div class="basic-cart-total-price cell">' . t('Total price') . ': <strong>' . $total . '</strong></div>';
  $html .= '</div>';
  $vat_is_enabled = (int) variable_get('basic_cart_vat_state');
  if (!empty($vat_is_enabled) && $vat_is_enabled) {
    $vat_value = basic_cart_price_format($price->vat);
    $html .= '<div class="basic-cart-cart-total-vat-contents row">';
    $html .= '  <div class="basic-cart-total-vat cell">' . t('Total VAT') . ': <strong>' . $vat_value . '</strong></div>';
    $html .= '</div>';
  }
  return $html;
}