Откройте classes/Product.php
Замените стандартную функцию
addProductAttribute на:
Код:
$minimal_quantity = 1
дописать:
Код:
, $depth = NULL
и после:
Код:
'quantity' => 0,
дописать:
Код:
, 'depth' => (float)($depth)
Итог:
Код:
public function addProductAttribute($price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference, $supplier_reference, $ean13, $default, $location = NULL, $upc = NULL, $minimal_quantity = 1, $depth = NULL)
{
$price = str_replace(',', '.', $price);
$weight = str_replace(',', '.', $weight);
Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute',
array('id_product' => (int)($this->id), 'price' => (float)($price), 'ecotax' => (float)($ecotax), 'quantity' => 0, 'depth' => (float)($depth),
'weight' => ($weight ? (float)($weight) : 0), 'unit_price_impact' => ($unit_impact ? (float)($unit_impact) : 0),
'reference' => pSQL($reference), 'supplier_reference' => pSQL($supplier_reference),
'location' => pSQL($location), 'ean13' => pSQL($ean13), 'upc' => pSQL($upc), 'default_on' => (int)($default), 'minimal_quantity' => (int)$minimal_quantity),
'INSERT');
$id_product_attribute = Db::getInstance()->Insert_ID();
Product::updateDefaultAttribute($this->id);
if (!$id_product_attribute)
return false;
$this->addStockMvt((int)$quantity, 1, $id_product_attribute);
if (empty($id_images))
return (int)($id_product_attribute);
$query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES ';
foreach ($id_images AS $id_image)
$query .= '('.(int)($id_product_attribute).', '.(int)($id_image).'), ';
$query = trim($query, ', ');
if (!Db::getInstance()->Execute($query))
return false;
return (int)($id_product_attribute);
}
Открыть tabs/AdminImport.php
после:
Код:
'weight' => array('label' => $this->l('Weight')),
дописать:
Код:
'depth' => array('label' => $this->l('Depth')),
после:
Код:
'weight' => 0,
дописать:
Код:
'depth' => 0,
после:
Код:
'weight' => array('label' => $this->l('Weight')),
дописать:
Код:
'depth' => array('label' => $this->l('Depth')),
Найти:
Код:
$id_product_attribute = $product->addProductAttribute((float)($info['price']), (float)($info['weight']), 0, (float)($info['ecotax']), (int)($info['quantity']), $id_image, strval($info['reference']), strval($info['supplier_reference']), strval($info['ean13']), (int)($info['default_on']), null, strval($info['upc']));
И заменить на:
Код:
$id_product_attribute = $product->addProductAttribute((float)($info['price']), (float)($info['weight']), 0, (float)($info['ecotax']), (int)($info['quantity']), $id_image, strval($info['reference']), strval($info['supplier_reference']), strval($info['ean13']), (int)($info['default_on']), null, strval($info['upc']), (float)($info['depth']));
И так далее для всех необходимых свойств.