本文整理汇总了PHP中CSaleOrderPropsVariant::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderPropsVariant::Add方法的具体用法?PHP CSaleOrderPropsVariant::Add怎么用?PHP CSaleOrderPropsVariant::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderPropsVariant
的用法示例。
在下文中一共展示了CSaleOrderPropsVariant::Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
$strError .= GetMessage("ERROR_ADD_PROP") . "<br>";
}
}
}
if (strlen($strError) <= 0) {
if ($TYPE == "SELECT" || $TYPE == "MULTISELECT" || $TYPE == "RADIO") {
$numpropsvals = IntVal($numpropsvals);
for ($i = 0; $i <= $numpropsvals; $i++) {
$strError1 = "";
$CF_ID = IntVal(${"ID_" . $i});
$CF_DEL = ${"DELETE_" . $i};
unset($arFieldsV);
$arFieldsV = array("ORDER_PROPS_ID" => $ID, "VALUE" => Trim(${"VALUE_" . $i}), "NAME" => Trim(${"NAME_" . $i}), "SORT" => IntVal(${"SORT_" . $i}) > 0 ? IntVal(${"SORT_" . $i}) : 100, "DESCRIPTION" => Trim(${"DESCRIPTION_" . $i}));
if ($CF_ID <= 0) {
if (strlen($arFieldsV["VALUE"]) > 0 && strlen($arFieldsV["NAME"]) > 0) {
if (!CSaleOrderPropsVariant::Add($arFieldsV)) {
$strError1 .= GetMessage("ERROR_ADD_VARIANT") . " (" . $arFieldsV["VALUE"] . ", " . $arFieldsV["NAME"] . ", " . $arFieldsV["SORT"] . ", " . $arFieldsV["DESCRIPTION"] . ").<br>";
}
}
} elseif ($CF_DEL == "Y") {
CSaleOrderPropsVariant::Delete($CF_ID);
} else {
if (strlen($arFieldsV["VALUE"]) <= 0) {
$strError1 .= GetMessage("ERROR_EMPTY_VAR_CODE") . " (" . $arFieldsV["NAME"] . ").<br>";
}
if (strlen($arFieldsV["NAME"]) <= 0) {
$strError1 .= GetMessage("ERROR_EMPTY_VAR_NAME") . " (" . $arFieldsV["VALUE"] . ").<br>";
}
if (strlen($strError1) <= 0) {
if (!CSaleOrderPropsVariant::Update($CF_ID, $arFieldsV)) {
$strError .= GetMessage("ERROR_EDIT_VARIANT") . " (" . $arFieldsV["VALUE"] . ", " . $arFieldsV["NAME"] . ", " . $arFieldsV["SORT"] . ", " . $arFieldsV["DESCRIPTION"] . ").<br>";
示例2: Array
$propCityId = $id;
}
if(strlen($prop["CODE"]) > 0)
{
//$arGeneralInfo["propCode"][$prop["CODE"]] = $prop["CODE"];
$arGeneralInfo["propCodeID"][$prop["CODE"]] = $id;
$arGeneralInfo["properies"][$prop["PERSON_TYPE_ID"]][$prop["CODE"]] = $prop;
$arGeneralInfo["properies"][$prop["PERSON_TYPE_ID"]][$prop["CODE"]]["ID"] = $id;
}
if(!empty($variants))
{
foreach($variants as $val)
{
$val["ORDER_PROPS_ID"] = $id;
CSaleOrderPropsVariant::Add($val);
}
}
}
/*
$propReplace = "";
foreach($arGeneralInfo["properies"] as $key => $val)
{
if(IntVal($val["LOCATION"]["ID"]) > 0)
$propReplace .= '"PROP_'.$key.'" => Array(0 => "'.$val["LOCATION"]["ID"].'"), ';
}
WizardServices::ReplaceMacrosRecursive(WIZARD_SITE_PATH."personal/order/", Array("PROPS" => $propReplace));
*/
//1C export
if($personType["fiz"] == "Y" && !$fizExist)
{
示例3: unset
CSaleOrderPropsVariant::Delete($row['ID']);
}
// TODO modernize
unset($variants[$key]);
} else {
++$index;
$variantId = $row['ID'];
$row = array_intersect_key($row, $variantSettings);
if ($variantId) {
unset($row['ID']);
if (!CSaleOrderPropsVariant::Update($variantId, $row)) {
$errors[] = Loc::getMessage('ERROR_EDIT_VARIANT') . " {$index}";
}
} else {
$row['ORDER_PROPS_ID'] = $propertyId;
if ($variantId = CSaleOrderPropsVariant::Add($row)) {
$variants[$key]['ID'] = $variantId;
} else {
$errors[] = Loc::getMessage('ERROR_ADD_VARIANT') . " {$index}";
}
}
}
}
} elseif ($existentProperty && $existentProperty['TYPE'] == 'ENUM') {
CSaleOrderPropsVariant::DeleteAll($propertyId);
}
// save property relations
foreach ($relationsSettings as $name => $input) {
CSaleOrderProps::UpdateOrderPropsRelations($propertyId, $relations[$name], $name);
}
}