Documentation

UpdateFromForm

Description and parameters

int CCatalogStoreProduct::UpdateFromForm( array arFields);

Method updates record parameters with ID for warehouse arFields["STORE_ID"] and product ID arFields["PRODUCT_ID"], if such exist, otherwise creates a record inside table with remaining product. Static method.

Call parameters

Parameter Description
arFieldsAssociative array with parameters, with keys as parameter names and corresponding values. Permitted keys:
  • PRODUCT_ID - product ID;
  • STORE_ID - warehouse ID;
  • AMOUNT - product quantity;

Returned value

Returns ID on success for a new new record and true for updated record. In case of errors, returns false.

Example

$arFields = Array(
		"PRODUCT_ID" => 25,
		"STORE_ID" => 3,
		"AMOUNT" => 4,
	);
	
	$ID = CCatalogStoreProduct::UpdateFromForm($arFields);

© «Bitrix24», 2001-2024