// fixxed bug save Product

This commit is contained in:
lLefevre
2011-12-12 16:01:26 +00:00
parent 2ffa2ea399
commit d4b3f8d222
2 changed files with 2 additions and 3 deletions
@@ -57,7 +57,6 @@
// Update submit button value
var split_position = id.indexOf('-') + 1;
var btn_name = id.substr(split_position);
$("#product_form_submit_btn").attr('name', 'submit'+btn_name);
if ($(this).attr("id") != $(".productTabs a.selected").attr('id'))
{
+2 -2
View File
@@ -725,7 +725,7 @@ class ProductCore extends ObjectModel
foreach ($categories as $new_id_categ)
if (!in_array($new_id_categ, $current_categories))
$new_categ_pos[] = '('.$new_id_categ.', '.$this->id.', '.$new_categ_pos[$new_id_categ].')';
$product_cats[] = '('.$new_id_categ.', '.$this->id.', '.$new_categ_pos[$new_id_categ].')';
if (count($product_cats))
return Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'category_product` (`id_category`, `id_product`, `position`)
@@ -755,7 +755,7 @@ class ProductCore extends ObjectModel
$this->deleteCategory($categ_to_delete['id_category']);
// if none are found, it's an error
if (!is_array($result))
return (false);
return false;
if (!$this->addToCategories($categories))
return false;