薯铒赅 "念徉忤螯 觐痃桧" (ajax)

项囡眍 耠邃箦 铒桉囹, 黩 镳铊聃钿栩 溧眄铎 觐溴 沅 邈 疣珈妁囹.

襄疴铄, 黩 耠邃箦 皲咫囹,  漕徉忤螯 溧眄簋 觏铒牦 磬 溴蜞朦眢 耱疣龛鲟 屐屙蜞. 吾眍,  catalog.element.


<form action="" method="post" enctype="multipart/form-data"
      class="add_form">
    <input type="hidden" name="volume" id="volume" value="">
    
        <input type="text" id="num" name="" value="1">
    
    <input type="hidden" name="" value="BUY">
    <input type="hidden" name="" id="element" value="">
    <button type="submit" class="add-to-cart" disabled="disabled"
            name=""> 觐痃桧
    </button>
</form>

买铕铄. 篷腓 锣 (漕矬耱桁 镪 襦轵) 礤 觐痃桧, 蝾 漕徉怆屐 甯 麇疱 觐祜铐屙.


<div id="basket-container">
    
</div>

茵弪. 吾疣犷蝼桕 磬 AJAX 忄 觏铒觇.


$(document).ready(
        function () {
            var options = {
                url: '/catalog/add2basket.php?RND=' + Math.random(),
                type: "POST",
                target: '#basket-container',
                success: function (responseText) {
                    $.jGrowl("翌忄 漕徉怆屙  觐痃桧");
                }
            };
            $(".add_form").ajaxForm(options); //羼腓 礤 疣犷蜞弪 觐 - 玎觐戾眚桊钼囹 耱痤牦
        }
    );
族蜮屦蝾. 杨玟喔 羿殡 磬玮囗桢, 磬镳桁屦 "add2basket.php", 忭篁痂 觐蝾痤泐 狍溴 钺疣徉螓忄螯 怦 蝾, 黩 箨噻囗 AJAX


require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$APPLICATION->IncludeComponent(
    "scripth:catalog.section",
    "",
    array()
);

$APPLICATION->IncludeComponent(
    "scripth:sale.basket.basket.line",
    "bx-basket-link",
    array(
        "HIDE_ON_BASKET_PAGES" => "N",
        "PATH_TO_BASKET" => SITE_DIR . "personal/cart/",
        "PATH_TO_ORDER" => SITE_DIR . "personal/order/make/",
        "PATH_TO_PERSONAL" => SITE_DIR . "personal/",
        "PATH_TO_PROFILE" => SITE_DIR . "personal/",
        "PATH_TO_REGISTER" => SITE_DIR . "login/",
        "POSITION_FIXED" => "N",
        "SHOW_AUTHOR" => "N",
        "SHOW_EMPTY_VALUES" => "Y",
        "SHOW_NUM_PRODUCTS" => "Y",
        "SHOW_PERSONAL_LINK" => "Y",
        "SHOW_PRODUCTS" => "N",
        "SHOW_TOTAL_PRICE" => "Y",
        "COMPONENT_TEMPLATE" => "bx-basket-link"
    ),
    false
);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");


玎牮

悟镳噔栩 玎怅

篷腓 黩-蝾 镱 礤 蜞, 桦 蔓 麇-蝾 礤 筲屦屙. 袜镳桁屦 耢脲 耦狁蜮屙眍 骅珥. 橡铖蝾 磬骒栩 磬 腩泐蜩 襦轵 镱怛铕栩 镱稃蜿. 愉圜!