Why before calling the component and after calling the component bitrix:catalog.store.amount :

 <?$APPLICATION->IncludeComponent("bitrix:catalog.store.amount", "store_amount", array( "ELEMENT_ID" => $ElementID, "STORE_PATH" => $arParams['STORE_PATH'], "CACHE_TYPE" => "A", "CACHE_TIME" => "36000", "MAIN_TITLE" => $arParams['MAIN_TITLE'], "USE_MIN_AMOUNT" => $arParams['USE_MIN_AMOUNT'], "MIN_AMOUNT" => $arParams['MIN_AMOUNT'], "STORES" => $arParams['STORES'], "SHOW_EMPTY_STORE" => $arParams['SHOW_EMPTY_STORE'], "SHOW_GENERAL_STORE_INFORMATION" => $arParams['SHOW_GENERAL_STORE_INFORMATION'], "USER_FIELDS" => $arParams['USER_FIELDS'], "FIELDS" => $arParams['FIELDS'] ), $component, array("HIDE_ICONS" => "Y") );?> 
$ElementId=5; ( b_catalog_store_product nothing in the b_catalog_store_product table). However, in the bitrix:catalog.store.amount component bitrix:catalog.store.amount , if you set echo $arParams["ELEMENT_ID"]; then mp are displayed id = 65 ; и кол-во торгового предложения, не товара (Если прописать ; и кол-во торгового предложения, не товара (Если прописать print_r ($ arResult ["STORES"]) , то выведет [0] => Array ([ID] => 0 [AMOUNT] => 105 `)). The total balance of goods is 100 ". (if the sales proposal, then the balance must be = 105)

Why dont know....

  • If you are given an exhaustive answer, mark it as correct (tick the selected answer). - Mihanik71

1 answer 1

You have set the parameter Show general information on warehouses in the bitrix:catalog component. Uncheck it and look. If we print $arResult , then we will see the following picture:

 Array ( [IS_SKU] => 1 [STORES] => Array ( [0] => Array ( [ID] => 1 [URL] => /store/1 [TITLE] => Склад [PHONE] => [SCHEDULE] => [IMAGE_ID] => [EMAIL] => [COORDINATES] => [DESCRIPTION] => [AMOUNT] => 105 [REAL_AMOUNT] => 105 ) [1] => Array ( [ID] => 2 [URL] => /store/2 [TITLE] => Склад2 [PHONE] => [SCHEDULE] => [IMAGE_ID] => [EMAIL] => [COORDINATES] => [DESCRIPTION] => [AMOUNT] => 20 [REAL_AMOUNT] => 20 ) ) [JS] => Array ( [SKU] => Array ( [156] => Array ( [1] => 100 [2] => 50 ) [155] => Array ( [1] => 100 [2] => 40 ) [154] => Array ( [1] => 100 [2] => 30 ) [153] => Array ( [1] => 100 [2] => 10 ) [152] => Array ( [1] => 105 [2] => 20 ) ) ) ) 

Here in the [STORES] array are the number of one of the TP, in my case of the latter, but when entering the page the active TP is different and its quantity is displayed. If you search, then the necessary TP will be found and it will have the right amount. The component works correctly, but it loads data through JS