Beispiel #1
0
 /**
  * This function delete whole product (its attribute, attribute option and prices )
  * @param :: integer item_id
  * @return :
  * */
 function deleteWholeProduct($item_id)
 {
     $status = $this->isAllowedToDelProduct($item_id);
     if ($status === false) {
         return false;
     }
     $productHelper = new productHelper();
     //  LOAD ATTRIBUTE MODEL FILE
     $quick2cartModelAttributes = $productHelper->loadAttribModel();
     //  TASK1: FETCH ALL ATTRIBUTE ID
     $attributes = $quick2cartModelAttributes->getItemAttributes($item_id);
     if (!empty($attributes)) {
         //  IF ATTRIBURE
         foreach ($attributes as $att) {
             $productHelper->delWholeAttribute($att->itemattribute_id);
         }
     }
     //  AT LAST, DELETE PRODUCT
     $productHelper->delProdBasePrices($item_id);
     return $status = $quick2cartModelAttributes->deleteItem($item_id);
 }