// Fixed bugs when editing Warehouses & Suppliers for a product
This commit is contained in:
@@ -259,6 +259,7 @@ class ProductCore extends ObjectModel
|
|||||||
'cache_has_attachments' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
'cache_has_attachments' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||||
|
'advanced_stock_management' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
|
||||||
// Lang fields
|
// Lang fields
|
||||||
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* Join categories table */
|
/* Join categories table */
|
||||||
|
|
||||||
if ($id_category = (int)Tools::getValue('productFilter_cl!name'))
|
if ($id_category = (int)Tools::getValue('productFilter_cl!name'))
|
||||||
{
|
{
|
||||||
$this->_category = new Category($id_category);
|
$this->_category = new Category($id_category);
|
||||||
@@ -183,7 +183,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$this->_category = new Category($id_category);
|
$this->_category = new Category($id_category);
|
||||||
else
|
else
|
||||||
$this->_category = new Category();
|
$this->_category = new Category();
|
||||||
|
|
||||||
|
|
||||||
$this->_join = '
|
$this->_join = '
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (a.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang`)
|
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (a.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang`)
|
||||||
@@ -2345,14 +2345,14 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$error = '';
|
$error = '';
|
||||||
$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
|
$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
|
||||||
$detail = array();
|
$detail = array();
|
||||||
|
|
||||||
if (count($this->context->shop->getListOfID()) > 1)
|
if (count($this->context->shop->getListOfID()) > 1)
|
||||||
$error = $this->l('Please select the shop you want to configure');
|
$error = $this->l('Please select the shop you want to configure');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$zones = Zone::getZones();
|
$zones = Zone::getZones();
|
||||||
$id_shop = $this->context->shop->getID();
|
$id_shop = $this->context->shop->getID();
|
||||||
|
|
||||||
// Set default zone value to the shop and sort it
|
// Set default zone value to the shop and sort it
|
||||||
foreach($zones as $zone)
|
foreach($zones as $zone)
|
||||||
{
|
{
|
||||||
@@ -2360,12 +2360,12 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$detail['zones'][$zone['id_zone']]['account_number'] = '';
|
$detail['zones'][$zone['id_zone']]['account_number'] = '';
|
||||||
}
|
}
|
||||||
$zoneAccountNumberList = Accounting::getProductAccountNumberZoneShop($obj->id, $id_shop);
|
$zoneAccountNumberList = Accounting::getProductAccountNumberZoneShop($obj->id, $id_shop);
|
||||||
|
|
||||||
// Set Account number to the id_zone for an id_shop if exist
|
// Set Account number to the id_zone for an id_shop if exist
|
||||||
foreach($zoneAccountNumberList as $zone)
|
foreach($zoneAccountNumberList as $zone)
|
||||||
$detail['zones'][$zone['id_zone']]['account_number'] = $zone['account_number'];
|
$detail['zones'][$zone['id_zone']]['account_number'] = $zone['account_number'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$data->assign(array(
|
$data->assign(array(
|
||||||
'productAccountNumberList' => $detail,
|
'productAccountNumberList' => $detail,
|
||||||
'shopName' => $this->context->shop->name,
|
'shopName' => $this->context->shop->name,
|
||||||
@@ -2528,7 +2528,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
'languages' => $languages,
|
'languages' => $languages,
|
||||||
'default_language' => $default_language,
|
'default_language' => $default_language,
|
||||||
'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED')
|
'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED')
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch();
|
$this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch();
|
||||||
}
|
}
|
||||||
@@ -2604,7 +2604,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
|
|
||||||
$rule = new SpecificPriceRule((int)$specific_price['id_specific_price_rule']);
|
$rule = new SpecificPriceRule((int)$specific_price['id_specific_price_rule']);
|
||||||
$rule_name = ($rule->id ? $rule->name : '--');
|
$rule_name = ($rule->id ? $rule->name : '--');
|
||||||
|
|
||||||
$content .= '
|
$content .= '
|
||||||
<tr '.($i%2 ? 'class="alt_row"' : '').'>
|
<tr '.($i%2 ? 'class="alt_row"' : '').'>
|
||||||
<td class="cell border">'.$rule_name.'</td>
|
<td class="cell border">'.$rule_name.'</td>
|
||||||
@@ -2955,7 +2955,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$data->assign('imagesTypes', ImageType::getImagesTypes('products'));
|
$data->assign('imagesTypes', ImageType::getImagesTypes('products'));
|
||||||
|
|
||||||
$product->tags = Tag::getProductTags($product->id);
|
$product->tags = Tag::getProductTags($product->id);
|
||||||
|
|
||||||
$data->assign('tabs_preloaded', $this->tabs_preloaded);
|
$data->assign('tabs_preloaded', $this->tabs_preloaded);
|
||||||
|
|
||||||
// TinyMCE
|
// TinyMCE
|
||||||
@@ -3118,7 +3118,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
$this->content .= '<b>'.$this->l('You must save this product before adding combinations').'.</b>';
|
$this->content .= '<b>'.$this->l('You must save this product before adding combinations').'.</b>';
|
||||||
|
|
||||||
// @todo
|
// @todo
|
||||||
$data->assign('up_filename', strval(Tools::getValue('virtual_product_filename_attribute')));
|
$data->assign('up_filename', strval(Tools::getValue('virtual_product_filename_attribute')));
|
||||||
$data->assign($this->tpl_form_vars);
|
$data->assign($this->tpl_form_vars);
|
||||||
@@ -3437,6 +3437,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$attributes = $obj->getAttributesResume($this->context->language->id);
|
$attributes = $obj->getAttributesResume($this->context->language->id);
|
||||||
if (empty($attributes))
|
if (empty($attributes))
|
||||||
$attributes[] = array(
|
$attributes[] = array(
|
||||||
|
'id_product' => $obj->id,
|
||||||
'id_product_attribute' => 0,
|
'id_product_attribute' => 0,
|
||||||
'attribute_designation' => ''
|
'attribute_designation' => ''
|
||||||
);
|
);
|
||||||
@@ -3505,7 +3506,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data->assign('available_features', $features);
|
$data->assign('available_features', $features);
|
||||||
|
|
||||||
$data->assign('product', $obj);
|
$data->assign('product', $obj);
|
||||||
$data->assign('link', $this->context->link);
|
$data->assign('link', $this->context->link);
|
||||||
$data->assign('languages', $this->_languages);
|
$data->assign('languages', $this->_languages);
|
||||||
|
|||||||
Reference in New Issue
Block a user