public function delete()
 {
     if (!GroupReduction::deleteProductReduction($this->id)) {
         return false;
     }
     Hook::deleteProduct($this);
     if (!parent::delete() or !$this->deleteCategories(true) or !$this->deleteImages() or !$this->deleteProductAttributes() or !$this->deleteProductFeatures() or !$this->deleteTags() or !$this->deleteCartProducts() or !$this->deleteAttributesImpacts() or !$this->deleteAttachments() or !$this->deleteCustomization() or !SpecificPrice::deleteByProductId((int) $this->id) or !$this->deletePack() or !$this->deleteProductSale() or !$this->deleteSceneProducts() or !$this->deleteSearchIndexes() or !$this->deleteAccessories() or !$this->deleteFromAccessories()) {
         return false;
     }
     if ($id = ProductDownload::getIdFromIdProduct($this->id)) {
         if ($productDownload = new ProductDownload($id) and !$productDownload->delete(true)) {
             return false;
         }
     }
     return true;
 }
Beispiel #2
0
 public function delete()
 {
     Hook::deleteProduct($this);
     if (!parent::delete() or !$this->deleteCategories() or !$this->deleteImages() or !$this->deleteProductAttributes() or !$this->deleteProductFeatures() or !$this->deleteTags() or !$this->deleteCartProducts() or !$this->deleteAttributesImpacts() or !$this->deleteAttachments() or !$this->deleteCustomization() or !$this->deleteQuantityDiscounts() or !$this->deletePack() or !$this->deleteProductSale() or !$this->deleteSceneProducts() or !$this->deleteSearchIndexes() or !$this->deleteAccessories()) {
         return false;
     }
     if ($id = ProductDownload::getIdFromIdProduct($this->id)) {
         if ($productDownload = new ProductDownload($id) and !$productDownload->delete(true)) {
             return false;
         }
     }
     return true;
 }
Beispiel #3
0
 public function delete($force_delete = false)
 {
     // check if the product is not used in a non validated order
     if (!$force_delete && !$this->isDeletable()) {
         return false;
     }
     if (!$force_delete && !GroupReduction::deleteProductReduction($this->id)) {
         return false;
     }
     Hook::deleteProduct($this);
     if (!parent::delete() || !$this->deleteCategories(true) || !$this->deleteProductAttributes() || !$this->deleteProductFeatures() || !$this->deleteTags() || !$this->deleteCartProducts() || !$this->deleteAttachments() || !$this->deleteCustomization() || !SpecificPrice::deleteByProductId((int) $this->id) || !$this->deletePack() || !$this->deleteProductSale() || !$this->deleteSceneProducts() || !$this->deleteSearchIndexes() || !$this->deleteAccessories() || !$this->deleteFromAccessories()) {
         return false;
     }
     if (!_PS_MODE_DEMO_ && !$this->deleteImages()) {
         return false;
     }
     if ($id = ProductDownload::getIdFromIdProduct($this->id)) {
         if ($productDownload = new ProductDownload($id)) {
             if (!$productDownload->delete(true)) {
                 return false;
             }
         }
     }
     return true;
 }
 public function delete()
 {
     Hook::deleteProduct($this);
     if (!parent::delete() or !$this->deleteCategories() or !$this->deleteImages() or !$this->deleteProductAttributes() or !$this->deleteProductFeatures() or !$this->deleteTags() or !$this->deleteCartProducts() or !$this->deleteAttributesImpacts()) {
         return false;
     }
     if ($id = ProductDownload::getIdFromIdProduct($this->id)) {
         if ($productDownload = new ProductDownload($id) and !$productDownload->delete(true)) {
             return false;
         }
     }
     return true;
 }