// Fixed #PSTEST-643
This commit is contained in:
+12
-1
@@ -658,7 +658,8 @@ class ProductCore extends ObjectModel
|
||||
!$this->deleteSceneProducts() ||
|
||||
!$this->deleteSearchIndexes() ||
|
||||
!$this->deleteAccessories() ||
|
||||
!$this->deleteFromAccessories())
|
||||
!$this->deleteFromAccessories() ||
|
||||
!$this->deleteFromSupplier())
|
||||
return false;
|
||||
|
||||
if ($id = ProductDownload::getIdFromIdProduct($this->id))
|
||||
@@ -680,6 +681,16 @@ class ProductCore extends ObjectModel
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function deleteFromSupplier()
|
||||
{
|
||||
$return = Db::getInstance()->execute(
|
||||
'DELETE FROM `'._DB_PREFIX_.'product_supplier`
|
||||
WHERE `id_product` = '.(int)$this->id
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* addToCategories add this product to the category/ies if not exists.
|
||||
*
|
||||
|
||||
@@ -392,8 +392,11 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$address = new Address($obj->id_address);
|
||||
$address->deleted = 1;
|
||||
$address->save();
|
||||
if (Validate::isLoadedObject($address))
|
||||
{
|
||||
$address->deleted = 1;
|
||||
$address->save();
|
||||
}
|
||||
return parent::postProcess();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user