Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/components/skyweb24/sharebasket.show/templates/.default/
Upload File :
Current File : /var/www/homesaver/www/bitrix/components/skyweb24/sharebasket.show/templates/.default/template.php

<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
$this->setFrameMode(true);
?>
<?
$arProducts = array();
$totalPrice = 0;

?>
<div class="skyweb24_share_basket">
    <div class="who_made_selection">
        <p>
            <?= GetMessage("skyweb24_sharebasketshow_MADE_SELECTION") ?>
        </p>
    </div>

    <div class="col-md-12 col-sm-12 col-xs-12 item_group">
        <div class="group_name"></div>
        <? foreach ($arResult['PRODUCTS'] as $arItem) { ?>
            <?
            $i++;
            $groupId = $arItem["PRICES"]["PRICE_TYPE_ID"] ?>
            <div class="item flex-container">
                <div class="image flex-item">
                    <?
                    if ($arItem["PICTURE"]) { ?>
                        <img src="<?= $arItem["PICTURE"] ?>"/>
                        <?
                    } ?>
                </div>
                <div class="compatibility_status flex-item"><i class="fa fa-check-circle" aria-hidden="true"></i>
                </div>
                <div class="info flex-item">
                    <div class="category_name"><?= $arItem["IBLOCK_SECTION_NAME"] ?></div>
                    <div class="product_name">
                        <a href="<?= $arItem['DETAIL_PAGE_URL'] ?>" target="_blank"><?= $arItem["NAME"] ?></a>
                        <span class="group_price"><?= $arItem["PRICES"]["CATALOG_GROUP_NAME"] ?></span>
                        <span class="product_code"></span>
                    </div>
                </div>
                <div class="product_price flex-item">
                <span class="price">
                    <? if ($arParams['PRICE_FIXED'] == "Y"): ?>
                        <?= \CurrencyFormat((int)$arItem['PRICE'] * (int)$arItem['QUANTITY_BUY'], $arItem['CURRENCY']) ?>
                    <? else: ?>
                        <?= $arItem["PRICES"]["~DISCOUNT_PRICE"] ?>
                    <? endif; ?>
                </span>
                <span class="count <?= ($arItem["AVAILABLE"] != "Y") ? 'hidden' : '' ?>">
                    (<?= round($arItem["QUANTITY_BUY"], 2) ?><?= !empty($arItem["MEASURE_SYMBOL_RUS"]) ? '. ' . $arItem["MEASURE_SYMBOL_RUS"] : '' ?>)
                </span>
                <? if ($arItem["AVAILABLE"] != "Y" || $arItem["ACTIVE"] != "Y") { ?>
                    <div class="not_available">
                        <span><?= GetMessage("skyweb24_sharebasketshow_NOT_AVAILABLE") ?></span>
                        <span> <?= $arItem["MEASURE_SYMBOL_RUS"] ?></span>
                    </div>
                <? } elseif ($arItem["QUANTITY_BUY"] > $arItem["QUANTITY"] && $arItem["CAN_BUY_ZERO"] != "Y") { ?>
                    <div class="limited_quantity">
                        <span><?= GetMessage("skyweb24_sharebasketshow_AVAILABLE_PRODUCTS") ?><?= $arItem["QUANTITY"] ?></span>
                        <span> <?= $arItem["MEASURE_SYMBOL_RUS"] ?></span>
                    </div>
                <? } else {
                    $quantity = $arItem["QUANTITY_BUY"] > $arItem["QUANTITY"] ? $arItem["QUANTITY_BUY"] : $arItem["QUANTITY"];
                    ?>
                    <div class="available">
                        <span><?= GetMessage("skyweb24_sharebasketshow_AVAILABLE_PRODUCTS") ?><?= $quantity ?></span>
                        <span> <?= $arItem["MEASURE_SYMBOL_RUS"] ?></span>
                    </div>
                <?} ?>
                </div>
            </div>
            <?
            if ($arParams['PRICE_FIXED'] == "Y") {
                $totalPrice += (int)$arItem['PRICE'] * (int)$arItem['QUANTITY_BUY'];
            } else {
                $totalPrice += $arItem["PRICES"]["DISCOUNT_PRICE"];
            }

            $arProducts[$i]["PRODUCT_ID"] = $arItem["PRODUCT_ID"];
            $arProducts[$i]["PRICE"] = $arItem["PRICES"]["BASE_PRICE"];
            $arProducts[$i]["CURRENCY"] = $arItem["CURRENCY"];
            $arProducts[$i]["LID"] = $arItem["LID"];
            $arProducts[$i]["NAME"] = $arItem["NAME"];
            $arProducts[$i]["MODULE"] = $arItem["MODULE"];
            $arProducts[$i]["QUANTITY"] = $arItem["QUANTITY_BUY"];
            $arProducts[$i]["WEIGHT"] = $arItem["WEIGHT"];
            $arProducts[$i]["PROPERTIES"] = $arItem["PROPERTIES"];
            $arProducts[$i]["PRODUCT_PROVIDER_CLASS"] = $arItem["PRODUCT_PROVIDER_CLASS"];

        }

        ?>

        <div class="col-md-12 col-sm-12 col-xs-12 bottom">
            <? if ($arResult["OPTION_LINK_BASKET"] != "") {
                $optionLinkBasket = $arResult["URL_SITE"] . $arResult["OPTION_LINK_BASKET"];
            } else {
                $optionLinkBasket = $arResult["URL_SITE"] . "/personal/cart/";
            } ?>
            <div class="total_price">
                <span><?= GetMessage("skyweb24_sharebasketshow_TOTAL_PRICE_AVAILABLE") ?></span><span><?= CCurrencyLang::CurrencyFormat($totalPrice, "RUB") ?></span>
            </div>
            <script>
                BX.ready(function () {
                    var data = <?=\CUtil::PhpToJSObject($arProducts);?>;
                    var link = '<?=$optionLinkBasket;?>';

                    BX.bind(document.querySelector("#ssb-add-basket"), 'click', function (e) {
                        e.preventDefault();
                        ajaxPost(data, link);
                    });
                });
            </script>

            <button class="btn"
                    id="ssb-add-basket"><?= GetMessage("skyweb24_sharebasketshow_ADD_TO_BASKET") ?></button>
        </div>
    </div>
</div>
</div>
<script>
    var componentPath = "<?=$componentPath?>";
</script>