Забыл уточнить, у меня версия 1.5.6
Нашел этот же участок кода в версии 1.4.11
Как мне исправить мою версию, чтоб проверялись значения?
Код:
foreach ($features as $feature => $value)
if (Tools::strlen($product->{$feature}) && strncmp($feature, \'#F_\', 3) === 0)
{
$feature_name = str_replace(\'#F_\', \'\', $feature);
$id_feature = Feature::addFeatureImport($feature_name);
$feature_tmp = new Feature($id_feature);
$flag = true;
if (Validate::isLoadedObject($feature_tmp))
{
$id_lang = (int)Language::getIdByIso(trim(Tools::getValue(\'iso_lang\')));
$ProductFeatures = $product->getFeatures();
foreach($ProductFeatures as $ProductFeature)
{
if (is_array($ProductFeature) && isset($ProductFeature[\'id_feature\']) && $ProductFeature[\'id_feature\'] == $id_feature)
{
$featureValue = new FeatureValue((int)$ProductFeature[\'id_feature_value\']);
if(Validate::isLoadedObject($featureValue))
{
$featureValue->value[$id_lang] = $value;
$featureValue->update();
$flag = false;
}
}
}
}
if ($flag)
{
$id_feature_value = FeatureValue::addFeatureValueImport($id_feature, $product->{$feature});
Product::addFeatureProductImport($product->id, $id_feature, $id_feature_value);
}
}
Сообщение отредактировано Vvasya 14-11-2013 18:15 ...