當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OrderReturn::deleteOrderReturnDetail方法代碼示例

本文整理匯總了PHP中OrderReturn::deleteOrderReturnDetail方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderReturn::deleteOrderReturnDetail方法的具體用法?PHP OrderReturn::deleteOrderReturnDetail怎麽用?PHP OrderReturn::deleteOrderReturnDetail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OrderReturn的用法示例。


在下文中一共展示了OrderReturn::deleteOrderReturnDetail方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postProcess

 public function postProcess()
 {
     $this->context = Context::getContext();
     if (Tools::isSubmit('deleteorder_return_detail')) {
         if ($this->tabAccess['delete'] === '1') {
             if (($id_order_detail = (int) Tools::getValue('id_order_detail')) && Validate::isUnsignedId($id_order_detail)) {
                 if (($id_order_return = (int) Tools::getValue('id_order_return')) && Validate::isUnsignedId($id_order_return)) {
                     $orderReturn = new OrderReturn($id_order_return);
                     if (!Validate::isLoadedObject($orderReturn)) {
                         die(Tools::displayError());
                     }
                     if ((int) $orderReturn->countProduct() > 1) {
                         if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int) Tools::getValue('id_customization', 0))) {
                             Tools::redirectAdmin(self::$currentIndex . '&conf=4token=' . $this->token);
                         } else {
                             $this->errors[] = Tools::displayError('An error occurred while deleting the details of your order return.');
                         }
                     } else {
                         $this->errors[] = Tools::displayError('You need at least one product.');
                     }
                 } else {
                     $this->errors[] = Tools::displayError('The order return is invalid.');
                 }
             } else {
                 $this->errors[] = Tools::displayError('The order return content is invalid.');
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to delete this.');
         }
     } elseif (Tools::isSubmit('submitAddorder_return') || Tools::isSubmit('submitAddorder_returnAndStay')) {
         if ($this->tabAccess['edit'] === '1') {
             if (($id_order_return = (int) Tools::getValue('id_order_return')) && Validate::isUnsignedId($id_order_return)) {
                 $orderReturn = new OrderReturn($id_order_return);
                 $order = new Order($orderReturn->id_order);
                 $customer = new Customer($orderReturn->id_customer);
                 $orderReturn->state = (int) Tools::getValue('state');
                 if ($orderReturn->save()) {
                     $orderReturnState = new OrderReturnState($orderReturn->state);
                     $vars = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order_return}' => $id_order_return, '{state_order_return}' => isset($orderReturnState->name[(int) $order->id_lang]) ? $orderReturnState->name[(int) $order->id_lang] : $orderReturnState->name[(int) Configuration::get('PS_LANG_DEFAULT')]);
                     Mail::Send((int) $order->id_lang, 'order_return_state', Mail::l('Your order return status has changed', $order->id_lang), $vars, $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop);
                     if (Tools::isSubmit('submitAddorder_returnAndStay')) {
                         Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . $this->token . '&updateorder_return&id_order_return=' . (int) $id_order_return);
                     } else {
                         Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . $this->token);
                     }
                 }
             } else {
                 $this->errors[] = Tools::displayError('No order return ID has been specified.');
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to edit this.');
         }
     }
     parent::postProcess();
 }
開發者ID:zangles,項目名稱:lennyba,代碼行數:55,代碼來源:AdminReturnController.php

示例2: postProcess

 public function postProcess()
 {
     global $currentIndex, $cookie;
     if (Tools::isSubmit('deleteorder_return_detail')) {
         if ($this->tabAccess['delete'] === '1') {
             if ($id_order_detail = (int) Tools::getValue('id_order_detail') and Validate::isUnsignedId($id_order_detail)) {
                 if ($id_order_return = (int) Tools::getValue('id_order_return') and Validate::isUnsignedId($id_order_return)) {
                     $orderReturn = new OrderReturn($id_order_return);
                     if (!Validate::isLoadedObject($orderReturn)) {
                         die(Tools::displayError());
                     }
                     if ((int) $orderReturn->countProduct() > 1) {
                         if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int) Tools::getValue('id_customization', 0))) {
                             Tools::redirectAdmin($currentIndex . '&conf=4token=' . $this->token);
                         } else {
                             $this->_errors[] = Tools::displayError('An error occurred while deleting an order return detail.');
                         }
                     } else {
                         $this->_errors[] = Tools::displayError('You need at least one product.');
                     }
                 } else {
                     $this->_errors[] = Tools::displayError('The order return is invalid.');
                 }
             } else {
                 $this->_errors[] = Tools::displayError('The order return detail is invalid.');
             }
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
         }
     } elseif (Tools::isSubmit('submitAddorder_return')) {
         if ($this->tabAccess['edit'] === '1') {
             if ($id_order_return = (int) Tools::getValue('id_order_return') and Validate::isUnsignedId($id_order_return)) {
                 $orderReturn = new OrderReturn($id_order_return);
                 $order = new Order($orderReturn->id_order);
                 $customer = new Customer($orderReturn->id_customer);
                 $orderReturn->state = (int) Tools::getValue('state');
                 if ($orderReturn->save()) {
                     $orderReturnState = new OrderReturnState($orderReturn->state);
                     $vars = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order_return}' => $id_order_return, '{order_name}' => sprintf("#%06d", (int) $order->id), '{state_order_return}' => isset($orderReturnState->name[(int) $order->id_lang]) ? $orderReturnState->name[(int) $order->id_lang] : $orderReturnState->name[(int) _PS_LANG_DEFAULT_]);
                     Mail::Send((int) $order->id_lang, 'order_return_state', Mail::l('Your order return state has changed', (int) $order->id_lang), $vars, $customer->email, $customer->firstname . ' ' . $customer->lastname, NULL, NULL, NULL, NULL, _PS_MAIL_DIR_, true);
                     Tools::redirectAdmin($currentIndex . '&conf=4&token=' . $this->token);
                 }
             } else {
                 $this->_errors[] = Tools::displayError('No order return ID.');
             }
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     }
     parent::postProcess();
 }
開發者ID:Evil1991,項目名稱:PrestaShop-1.4,代碼行數:51,代碼來源:AdminReturn.php

示例3: postProcess

 public function postProcess()
 {
     global $currentIndex, $cookie;
     if (Tools::isSubmit('deleteorder_return_detail')) {
         if ($this->tabAccess['delete'] === '1') {
             if ($id_order_detail = intval(Tools::getValue('id_order_detail')) and Validate::isUnsignedId($id_order_detail)) {
                 if ($id_order_return = intval(Tools::getValue('id_order_return')) and Validate::isUnsignedId($id_order_return)) {
                     $orderReturn = new OrderReturn($id_order_return);
                     if (!Validate::isLoadedObject($orderReturn)) {
                         die(Tools::displayError());
                     }
                     if (intval($orderReturn->countProduct()) > 1) {
                         if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, intval(Tools::getValue('id_customization', 0)))) {
                             Tools::redirectAdmin($currentIndex . '&conf=4token=' . $this->token);
                         } else {
                             $this->_errors[] = Tools::displayError('an error occured while deleting an order return detail');
                         }
                     } else {
                         $this->_errors[] = Tools::displayError('you need at least one product');
                     }
                 } else {
                     $this->_errors[] = Tools::displayError('the order return is invalid');
                 }
             } else {
                 $this->_errors[] = Tools::displayError('the order return detail is invalid');
             }
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
         }
     } elseif (Tools::isSubmit('submitAddorder_return')) {
         if ($this->tabAccess['edit'] === '1') {
             if ($id_order_return = intval(Tools::getValue('id_order_return')) and Validate::isUnsignedId($id_order_return)) {
                 $orderReturn = new OrderReturn($id_order_return);
                 $customer = new Customer($orderReturn->id_customer);
                 $orderReturn->state = intval(Tools::getValue('state'));
                 if ($orderReturn->save()) {
                     $orderReturnState = new OrderReturnState($orderReturn->state);
                     $vars = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order_return}' => $id_order_return, '{state_order_return}' => $orderReturnState->name[intval(Configuration::get('PS_LANG_DEFAULT'))]);
                     Mail::Send(intval($cookie->id_lang), 'order_return_state', html_entity_decode($this->l('Your order return state has changed'), ENT_NOQUOTES, 'UTF-8'), $vars, $customer->email, $customer->firstname . ' ' . $customer->lastname);
                     Tools::redirectAdmin($currentIndex . '&conf=4&token=' . $this->token);
                 }
             } else {
                 $this->_errors[] = Tools::displayError('no order return ID.');
             }
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     }
     parent::postProcess();
 }
開發者ID:sealence,項目名稱:local,代碼行數:50,代碼來源:AdminReturn.php


注:本文中的OrderReturn::deleteOrderReturnDetail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。