How to show weight of the order in shopping cart

How to show weight of the order in shopping cart

To add a "Total weight" line to the shopping cart page, change lines 442-454 of order.php from:


$smarty->assign(array(
    'token_cart' => $token,
    'productNumber' => $cart->nbProducts(),
    'voucherAllowed' => Configuration::get('PS_VOUCHERS'),
    'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary),
    'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary),
    'shippingCost' => $cart->getOrderTotal(true, 5),
    'shippingCostTaxExc' => $cart->getOrderTotal(false, 5),
    'customizedDatas' => $customizedDatas,
    'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
    'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
    'lastProductAdded' => $cart->getLastProduct()
    ));

to:

$smarty->assign(array(
    'token_cart' => $token,
    'productNumber' => $cart->nbProducts(),
    'voucherAllowed' => Configuration::get('PS_VOUCHERS'),
    'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary),
    'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary),
    'shippingCost' => $cart->getOrderTotal(true, 5),
    'shippingCostTaxExc' => $cart->getOrderTotal(false, 5),
    'customizedDatas' => $customizedDatas,
    'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
    'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
    'lastProductAdded' => $cart->getLastProduct(),
    'weightUnit' => Configuration::get('PS_WEIGHT_UNIT')      
    ));

and then add the following at line 100 of shopping-cart.tpl in your theme's directory (after the {if $shippingCost > 0}):


    {l s='Total weight:'}
    {$cart->getTotalWeight()} {$weightUnit}