Z
Z
Zikdelk2021-03-21 14:47:19
1C-Bitrix
Zikdelk, 2021-03-21 14:47:19

For some reason, in the cart in Bitrix it does not go to the checkout page, what's the problem?

For some reason, in the cart in Bitrix, it does not go to the checkout page. It just redirects to the main page. Where to dig, tell pzh?
Is this a JS issue? It’s just that they commented somewhere before me so that the basket does not function, but I don’t understand where to look.

0EPhrZ1kYKU.jpg?size=1716x524&quality=96&sign=72d2fe1371ed62d97fdc426d6fe434ca&type=album

Here is the code:

<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

$arUrls = Array(
  "delete" => $APPLICATION->GetCurPage()."?".$arParams["ACTION_VARIABLE"]."=delete&id=#ID#",
  "delay" => $APPLICATION->GetCurPage()."?".$arParams["ACTION_VARIABLE"]."=delay&id=#ID#",
  "add" => $APPLICATION->GetCurPage()."?".$arParams["ACTION_VARIABLE"]."=add&id=#ID#",
);

$arBasketJSParams = array(
  'SALE_DELETE' => GetMessage("SALE_DELETE"),
  'SALE_DELAY' => GetMessage("SALE_DELAY"),
  'SALE_TYPE' => GetMessage("SALE_TYPE"),
  'TEMPLATE_FOLDER' => $templateFolder,
  'DELETE_URL' => $arUrls["delete"],
  'DELAY_URL' => $arUrls["delay"],
  'ADD_URL' => $arUrls["add"]
);
?>
<script type="text/javascript">
  var basketJSParams = <?=CUtil::PhpToJSObject($arBasketJSParams);?>
</script>
<?
$APPLICATION->AddHeadScript($templateFolder."/script.js");

if (strlen($arResult["ERROR_MESSAGE"]) <= 0)
{
  ?>
  <div id="warning_message">
    <?
    if (is_array($arResult["WARNING_MESSAGE"]) && !empty($arResult["WARNING_MESSAGE"]))
    {
      foreach ($arResult["WARNING_MESSAGE"] as $v)
        echo ShowError($v);
    }
    ?>
  </div>
  <?

  $normalCount = count($arResult["ITEMS"]["AnDelCanBuy"]);
  $normalHidden = ($normalCount == 0) ? "style=\"display:none\"" : "";

  $delayCount = count($arResult["ITEMS"]["DelDelCanBuy"]);
  $delayHidden = ($delayCount == 0) ? "style=\"display:none\"" : "";

  $subscribeCount = count($arResult["ITEMS"]["ProdSubscribe"]);
  $subscribeHidden = ($subscribeCount == 0) ? "style=\"display:none\"" : "";

  $naCount = count($arResult["ITEMS"]["nAnCanBuy"]);
  $naHidden = ($naCount == 0) ? "style=\"display:none\"" : "";

  ?>
    <form method="post" action="<?=POST_FORM_ACTION_URI?>" name="basket_form" id="basket_form">
      <div id="basket_form_container">
        <div class="bx_ordercart">
          <div class="bx_sort_container">
            <span><?=GetMessage("SALE_ITEMS")?></span>
            <a href="javascript:void(0)" id="basket_toolbar_button" class="current" onclick="showBasketItemsList()"><?=GetMessage("SALE_BASKET_ITEMS")?><div id="normal_count" class="flat" style="display:none">&nbsp;(<?=$normalCount?>)</div></a>
            <a href="javascript:void(0)" id="basket_toolbar_button_delayed" onclick="showBasketItemsList(2)" <?=$delayHidden?>><?=GetMessage("SALE_BASKET_ITEMS_DELAYED")?><div id="delay_count" class="flat">&nbsp;(<?=$delayCount?>)</div></a>
            <a href="javascript:void(0)" id="basket_toolbar_button_subscribed" onclick="showBasketItemsList(3)" <?=$subscribeHidden?>><?=GetMessage("SALE_BASKET_ITEMS_SUBSCRIBED")?><div id="subscribe_count" class="flat">&nbsp;(<?=$subscribeCount?>)</div></a>
            <a href="javascript:void(0)" id="basket_toolbar_button_not_available" onclick="showBasketItemsList(4)" <?=$naHidden?>><?=GetMessage("SALE_BASKET_ITEMS_NOT_AVAILABLE")?><div id="not_available_count" class="flat">&nbsp;(<?=$naCount?>)</div></a>
          </div>
          <?
          include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/basket_items.php");
          include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/basket_items_delayed.php");
          include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/basket_items_subscribed.php");
          include($_SERVER["DOCUMENT_ROOT"].$templateFolder."/basket_items_not_available.php");
          ?>
        </div>
      </div>
      <input type="hidden" name="BasketOrder" value="BasketOrder" />
      <input type="hidden" name="ajax_post" id="ajax_post" value="Y">
    </form>
  <?
}
else
{
  ShowError($arResult["ERROR_MESSAGE"]);
}
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question