Цитата |
---|
0987 пишет: <form action="http://<?echo SITE_SERVER_NAME?>/balances/<?echo $arElement["IBLOCK_SECTION_ID"]?>/index.php?action=ADD2BASKET" method="post" > <input name="id" type="hidden" value="<?echo $arElement["ID"]?>" /> <input name="quantity" type="text" value="1" size="5" /> <input name="" type="submit" value="В корзину" class="vko" /> </form> |
куда это надо вставлять я понял что в стандартный компонент у меня получилось так:
Код |
---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<div class="catalog-section">
<?if($arParams["DISPLAY_TOP_PAGER"]):?>
<p><?=$arResult["NAV_STRING"]?></p>
<?endif?>
<table class="data-table" cellspacing="0" cellpadding="0" border="0" width="100%">
<thead>
<tr bgcolor="#FFFF00">
<td><?=GetMessage("CATALOG_TITLE")?></td>
<?if(count($arResult["ITEMS"]) > 0):
foreach($arResult["ITEMS"][0]["DISPLAY_PROPERTIES"] as $arProperty):?>
<td><?=$arProperty["NAME"]?></td>
<?endforeach;
endif;?>
<?foreach($arResult["PRICES"] as $code=>$arPrice):?>
<td><?=$arPrice["TITLE"]?></td>
<?endforeach?>
<?if(count($arResult["PRICES"]) > 0):?>
<td> </td>
<?endif?>
</tr>
</thead>
<?foreach($arResult["ITEMS"] as $arElement):?>
<tr>
<td>
<a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><?=$arElement["NAME"]?></a>
<?if(count($arElement["SECTION"]["PATH"])>0):?>
<br />
<?foreach($arElement["SECTION"]["PATH"] as $arPath):?>
/ <a href="<?=$arPath["SECTION_PAGE_URL"]?>"><?=$arPath["NAME"]?></a>
<?endforeach?>
<?endif?>
</td>
<?foreach($arElement["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<td>
<?if(is_array($arProperty["DISPLAY_VALUE"]))
echo implode(" / ", $arProperty["DISPLAY_VALUE"]);
elseif($arProperty["DISPLAY_VALUE"] === false)
echo " ";
else
echo $arProperty["DISPLAY_VALUE"];?>
</td>
<?endforeach?>
<?foreach($arResult["PRICES"] as $code=>$arPrice):?>
<td>
<?if($arPrice = $arElement["PRICES"][$code]):?>
<?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?>
<s><?=$arPrice["PRINT_VALUE"]?></s><br /><span class="catalog-price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span>
<?else:?>
<span class="catalog-price"><?=$arPrice["PRINT_VALUE"]?></span>
<?endif?>
<?else:?>
<?endif;?>
</td>
<?endforeach;?>
<?if(count($arResult["PRICES"]) > 0):?>
<td>
<form method="GET" action="index.php">кол-во:<input class='textfield' style='width:30px; text-align:right' name='kolvo' type='textfield' value=1><input class='button' name='submit' type='submit' value=добавить><input type="hidden" name="id" value="<?=$arElement["ID"]?>"><input type="hidden" name="price" value="<?=$arPrice[0]["PRICE"]?>"><input type="hidden" name="action" value="ADD2BASKET"><input type="hidden" name="PRODUCT_ID" value="<?=$arElement["ID"]?>"></form>
<?if($arElement["CAN_BUY"]):?>
<a href="<?echo $arElement["BUY_URL"]?>"><?echo GetMessage("CATALOG_BUY")?></a>
<a href="<?echo $arElement["ADD_URL"]?>"><?echo GetMessage("CATALOG_ADD")?></a>
<?elseif((count($arResult["PRICES"]) > 0) || is_array($arElement["PRICE_MATRIX"])):?>
<?=GetMessage("CATALOG_NOT_AVAILABLE")?>
<?endif?>
</td>
<?endif;?>
</tr>
<?endforeach;?>
</table>
<?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
<p><?=$arResult["NAV_STRING"]?></p>
<?endif?>
</div> |
очень хочется увидеть полный код с интенрацией в файле catalog.section/component.php в разделе Processing of the Buy link