当前位置: 首页>>代码示例>>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;未经允许,请勿转载。