M
M
MaxKondratenko2015-07-28 13:16:00
1C-Bitrix
MaxKondratenko, 2015-07-28 13:16:00

The add to cart button does not work on 1s Bitrix?

In general, the task is as follows... in the bitrix.catalog complex component, display products by brand.
in urlrewrite.php I write the following

array(
    "CONDITION" => "#^/beta/katalog/brand_(.*)/.*#",
    "RULE" => "BRAND_NAME=\$1",
    "ID" => "bitrix:catalog",
    "PATH" => "/beta/katalog/index.php",
  ),

thanks to which I get in section.php $_REQUEST['BRAND_NAME'] => (here, for example, Sony);
further before calling the “bitrix:catalog.section” component, I insert the following
if(isset($_REQUEST['BRAND_NAME']) && !empty($_REQUEST['BRAND_NAME'])){
                global $arrFilter;
                $arrFilter = array("PROPERTY_MANUFACTURER_VALUE"=>$_REQUEST['BRAND_NAME']);
        $APPLICATION->AddChainItem($_REQUEST['BRAND_NAME'], "".SITE_DIR."katalog/");
        $APPLICATION->SetTitle($_REQUEST['BRAND_NAME'], "".SITE_DIR."katalog/");
                unset($_REQUEST['BRAND_NAME']);
            }

well, of course, I add the parameter to the "SHOW_ALL_WO_SECTION" => “Y” component, after which everything is displayed, but the add to cart button does not work .... an error is visible in the debugger
GET http://******/beta/katalog/brand_****/?BRAND_NAME=*****&action=ADD2BASKET&id=14187&ajax_basket=Y&quantity=1&prop[0]=0 404 (Not Found)
a.ajax @ core_ajax.js:1534
a.ajax.loadJSON @ core_ajax.js:1534
window.JCCatalogSection.SendToBasket @ page_c4b059f83db2c3de36a38c1ca5fc6e81.js143686117163184:2374
window.JCCatalogSection.Basket @ page_c4b059f83db2c3de36a38c1ca5fc6e81.js143686117163184:2419
window.JCCatalogSection.Add2Basket @ page_c4b059f83db2c3de36a38c1ca5fc6e81.js?143686117163184:2357
BX.delegate @ core.js:3875

'and the smart filter doesn't work... I don't understand where to dig...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Maksimenko, 2015-07-29
@olegprof

Judging by the 404 in the console, the rule in urlrewrite is crooked.

I
Igor, 2015-08-12
@phper1785

make your own complex component based on bitrix:catalog by adding the necessary url for the brand page there.
'BRAND_PAGE_URL' => #FOLDER#/BRAND_#BRAND_CODE#/
Where the bitrix:section component will be executed with the filter by brand, through, as already mentioned arrFilter, the global array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question