Редактируем шаблон, меняем на это
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <table> <? if (IntVal($arResult["NUM_PRODUCTS"])>0) { if (CModule::IncludeModule("sale")) { $arBasketItems = array(); $dbBasketItems = CSaleBasket::GetList( array( "NAME" => "ASC", "ID" => "ASC" ), array( "FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL" ), false, false, array("ID", "QUANTITY", "PRICE") ); while ($arItems = $dbBasketItems->Fetch()) { if (strlen($arItems["CALLBACK_FUNC"]) > 0) { CSaleBasket::UpdatePrice($arItems["ID"], $arItems["QUANTITY"]); $arItems = CSaleBasket::GetByID($arItems["ID"]); } $arBasketItems[] = $arItems; } $summ = 0; for ($i=0;$i<=$arResult["NUM_PRODUCTS"];$i++){ $summ = $summ + $arBasketItems[$i]["PRICE"]*$arBasketItems[$i]["QUANTITY"]; } } ?> <tr> <td><a href="<?=$arParams["PATH_TO_BASKET"]?>"></a></td> <td style="font-size:80%"><a href="<?=$arParams["PATH_TO_BASKET"]?>"><?=$arResult["PRODUCTS"];?> на сумму <?=$summ?> руб.</a></td> </tr> <? } else { ?><tr> <td><div></div></td> <td><?=$arResult["ERROR_MESSAGE"]?></td> </tr><? } if($arParams["SHOW_PERSONAL_LINK"] == "Y") { ?> <tr> <td><a href="<?=$arParams["PATH_TO_PERSONAL"]?>"></a></td> <td><a href="<?=$arParams["PATH_TO_PERSONAL"]?>"><?= GetMessage("TSB1_PERSONAL") ?></a></td> </tr> <? } ?> </table>
как вывести сумму заказа в «краткой» корзине? (в формате «В Вашей корзине 3 товара на 3000 руб»)
Insightful read! Your analysis is spot-on. For more detailed information, visit: READ MORE. Eager to see what others have to say!