我对这段代码有问题。 有人在这里删除/更改了某些内容。 我花了无数个小时试图找出我的 ; 或 } 可能丢失,但没有运气。你能帮帮我吗?
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Корзина");
?><?
if($_REQUEST['otkr'])
{
Add2BasketByProductID(
$_REQUEST['otkr'],
1,
array(),
array(
array("NAME" => "Текст открытки", "CODE" => "TEXT", "VALUE" => $_REQUEST['text_otkr'])
)
);
}
if($_REQUEST['pack'])
{
Add2BasketByProductID(
$_REQUEST['pack'],
1,
array(),
array()
);
}
?> <?$APPLICATION->IncludeComponent(
"infoday:sale.basket.basket",
"cart",
Array(
"COLUMNS_LIST" => array("NAME","PRICE","TYPE","QUANTITY","DELETE","DELAY","WEIGHT","DISCOUNT"),
"COMPOSITE_FRAME_MODE" => "A",
"COMPOSITE_FRAME_TYPE" => "AUTO",
"COUNT_DISCOUNT_4_ALL_QUANTITY" => "Y",
"GIFT_ID" => "",
"HIDE_COUPON" => "Y",
"PATH_TO_ORDER" => "/personal/order/make/",
"PRICE_VAT_SHOW_VALUE" => "N",
"QUANTITY_FLOAT" => "N",
"SET_TITLE" => "Y"
)
);?> <?if($USER->isAdmin()):?> <br>
<br><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
你缺少endif;在最后。
<?if($USER->isAdmin()):?> <br>
<br><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
<? endif; ?>
你的代码风格很糟糕...为什么您将 HTML 与 PHP 混合并在下一行开始一个新部分时结束 PHP 部分 (?>( (<?
我重新格式化了您的代码并在本地主机上对其进行了测试,没有解析错误:
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Корзина");
?>
<?
if($_REQUEST['otkr'])
{
Add2BasketByProductID(
$_REQUEST['otkr'],
1,
array(),
array(
array("NAME" => "Текст открытки", "CODE" => "TEXT", "VALUE" => $_REQUEST['text_otkr'])
)
);
}
if($_REQUEST['pack'])
{
Add2BasketByProductID(
$_REQUEST['pack'],
1,
array(),
array()
);
}
?>
<?php
$APPLICATION->IncludeComponent(
"infoday:sale.basket.basket",
"cart",
array(
"COLUMNS_LIST" => array("NAME","PRICE","TYPE","QUANTITY","DELETE","DELAY","WEIGHT","DISCOUNT"),
"COMPOSITE_FRAME_MODE" => "A",
"COMPOSITE_FRAME_TYPE" => "AUTO",
"COUNT_DISCOUNT_4_ALL_QUANTITY" => "Y",
"GIFT_ID" => "",
"HIDE_COUPON" => "Y",
"PATH_TO_ORDER" => "/personal/order/make/",
"PRICE_VAT_SHOW_VALUE" => "N",
"QUANTITY_FLOAT" => "N",
"SET_TITLE" => "Y"
)
);
?>
<?
if($USER->isAdmin()) :
/* doing nothing here ??? */
endif
?>
<br>
<br>
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
?>