当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderReturn::addReturnDetail方法代码示例

本文整理汇总了PHP中OrderReturn::addReturnDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderReturn::addReturnDetail方法的具体用法?PHP OrderReturn::addReturnDetail怎么用?PHP OrderReturn::addReturnDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrderReturn的用法示例。


在下文中一共展示了OrderReturn::addReturnDetail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: preProcess

 public function preProcess()
 {
     parent::preProcess();
     if (Tools::isSubmit('submitReturnMerchandise')) {
         $customizationQtyInput = Tools::getValue('customization_qty_input');
         if (!($id_order = (int) Tools::getValue('id_order'))) {
             Tools::redirect('history.php');
         }
         if (!($order_qte_input = Tools::getValue('order_qte_input'))) {
             Tools::redirect('order-follow.php?errorDetail1');
         }
         if ($customizationIds = Tools::getValue('customization_ids') and !$customizationQtyInput) {
             Tools::redirect('order-follow.php?errorDetail1');
         }
         if (!($ids_order_detail = Tools::getValue('ids_order_detail')) and !$customizationIds) {
             Tools::redirect('order-follow.php?errorDetail2');
         }
         $order = new Order((int) $id_order);
         if (!$order->isReturnable()) {
             Tools::redirect('order-follow.php?errorNotReturnable');
         }
         if ($order->id_customer != self::$cookie->id_customer) {
             die(Tools::displayError());
         }
         $orderReturn = new OrderReturn();
         $orderReturn->id_customer = (int) self::$cookie->id_customer;
         $orderReturn->id_order = $id_order;
         $orderReturn->question = strval(Tools::getValue('returnText'));
         if (empty($orderReturn->question)) {
             Tools::redirect('order-follow.php?errorMsg');
         }
         if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput)) {
             Tools::redirect('order-follow.php?errorQuantity');
         }
         $orderReturn->state = 1;
         $orderReturn->add();
         $orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput);
         Module::hookExec('orderReturn', array('orderReturn' => $orderReturn));
         Tools::redirect('order-follow.php');
     }
     $ordersReturn = OrderReturn::getOrdersReturn((int) self::$cookie->id_customer);
     if (Tools::isSubmit('errorQuantity')) {
         self::$smarty->assign('errorQuantity', true);
     } elseif (Tools::isSubmit('errorMsg')) {
         self::$smarty->assign('errorMsg', true);
     } elseif (Tools::isSubmit('errorDetail1')) {
         self::$smarty->assign('errorDetail1', true);
     } elseif (Tools::isSubmit('errorDetail2')) {
         self::$smarty->assign('errorDetail2', true);
     } elseif (Tools::isSubmit('errorNotReturnable')) {
         self::$smarty->assign('errorNotReturnable', true);
     }
     self::$smarty->assign('ordersReturn', $ordersReturn);
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:54,代码来源:OrderFollowController.php

示例2: postProcess

 /**
  * Start forms process
  * @see FrontController::postProcess()
  */
 public function postProcess()
 {
     if (Tools::isSubmit('submitReturnMerchandise')) {
         $customizationQtyInput = Tools::getValue('customization_qty_input');
         if (!($id_order = (int) Tools::getValue('id_order'))) {
             Tools::redirect('index.php?controller=history');
         }
         if (!($order_qte_input = Tools::getValue('order_qte_input'))) {
             Tools::redirect('index.php?controller=order-follow&errorDetail1');
         }
         if (!$customizationQtyInput && ($customizationIds = Tools::getValue('customization_ids'))) {
             Tools::redirect('index.php?controller=order-follow&errorDetail1');
         }
         if (!$customizationIds && !($ids_order_detail = Tools::getValue('ids_order_detail'))) {
             Tools::redirect('index.php?controller=order-follow&errorDetail2');
         }
         $order = new Order((int) $id_order);
         if (!$order->isReturnable()) {
             Tools::redirect('index.php?controller=order-follow&errorNotReturnable');
         }
         if ($order->id_customer != $this->context->customer->id) {
             die(Tools::displayError());
         }
         $orderReturn = new OrderReturn();
         $orderReturn->id_customer = (int) $this->context->customer->id;
         $orderReturn->id_order = $id_order;
         $orderReturn->question = strval(Tools::getValue('returnText'));
         if (empty($orderReturn->question)) {
             Tools::redirect('index.php?controller=order-follow&errorMsg&' . http_build_query(array('ids_order_detail' => $ids_order_detail, 'order_qte_input' => $order_qte_input, 'id_order' => Tools::getValue('id_order'))));
         }
         if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput)) {
             Tools::redirect('index.php?controller=order-follow&errorQuantity');
         }
         $orderReturn->state = 1;
         $orderReturn->add();
         $orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput);
         Hook::exec('actionOrderReturn', array('orderReturn' => $orderReturn));
         Tools::redirect('index.php?controller=order-follow');
     }
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:44,代码来源:OrderFollowController.php

示例3: dirname

    if (!($ids_order_detail = Tools::getValue('ids_order_detail')) and !$customizationIds) {
        Tools::redirect('order-follow.php?errorDetail2');
    }
    $orderReturn = new OrderReturn();
    $orderReturn->id_customer = intval($cookie->id_customer);
    $orderReturn->id_order = $id_order;
    $orderReturn->question = strval(Tools::getValue('returnText'));
    if (empty($orderReturn->question)) {
        Tools::redirect('order-follow.php?errorMsg');
    }
    if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput)) {
        Tools::redirect('order-follow.php?errorQuantity');
    }
    $orderReturn->state = 1;
    $orderReturn->add();
    $orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput);
    Module::hookExec('orderReturn', array('orderReturn' => $orderReturn));
    Tools::redirect('order-follow.php');
}
$ordersReturn = OrderReturn::getOrdersReturn(intval($cookie->id_customer));
if (Tools::isSubmit('errorQuantity')) {
    $smarty->assign('errorQuantity', true);
} elseif (Tools::isSubmit('errorMsg')) {
    $smarty->assign('errorMsg', true);
} elseif (Tools::isSubmit('errorDetail1')) {
    $smarty->assign('errorDetail1', true);
} elseif (Tools::isSubmit('errorDetail2')) {
    $smarty->assign('errorDetail2', true);
}
$smarty->assign('ordersReturn', $ordersReturn);
include dirname(__FILE__) . '/header.php';
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:31,代码来源:order-follow.php

示例4: cronReturnSync

 public function cronReturnSync()
 {
     //  Check if client is initialized
     if (is_null($this->client)) {
         return false;
     }
     //Retrieve returns
     $returns = $this->client->getReturns(array(0));
     //Check declared returns
     if (is_null($returns) || $returns->count() == 0) {
         return false;
     }
     $customizationQtyInput = Tools::getValue('customization_qty_input');
     $customizationIds = Tools::getValue('customization_ids');
     foreach ($returns as $return) {
         $return_lines = $return->getLines();
         $channelengine_order_id = $return->getOrderId();
         $sql = "SELECT id_order FROM " . _DB_PREFIX_ . "orders  WHERE id_channelengine_order ='" . $channelengine_order_id . "'";
         $prestashop_order_id = Db::getInstance()->getValue($sql);
         $sql = "SELECT id_order_detail FROM" . _DB_PREFIX_ . "order_detail  WHERE id_order ='" . $prestashop_order_id . "'";
         $ids_order_details = Db::getInstance()->executeS($sql);
         $ids_order_detail_array = array();
         foreach ($ids_order_details as $key => $ids_order_detail) {
             $ids_order_detail_array[$ids_order_detail['id_order_detail']] = $ids_order_detail['id_order_detail'];
         }
         $quantity_array = array();
         $keys = array_keys($ids_order_detail_array);
         foreach ($return_lines as $i => $return_line) {
             $quantity_array[$keys[$i]] = $return_line->getQuantity();
             $order = new Order((int) $prestashop_order_id);
             $orderReturn = new OrderReturn();
             $orderReturn->id_customer = (int) $order->id_customer;
             $orderReturn->id_order = $prestashop_order_id;
             $orderReturn->question = htmlspecialchars(Tools::getValue('returnText'));
             if (empty($orderReturn->question)) {
                 http_build_query(array('ids_order_detail' => $ids_order_detail_array, 'order_qte_input' => $quantity_array, 'id_order' => $prestashop_order_id));
             }
         }
         $orderReturn->state = 1;
         $orderReturn->add();
         $orderReturn->addReturnDetail($ids_order_detail_array, $quantity_array, $customizationIds, $customizationQtyInput);
         Hook::exec('actionOrderReturn', array('orderReturn' => $orderReturn));
     }
 }
开发者ID:channelengine,项目名称:prestashop,代码行数:44,代码来源:ChannelEngineModule.php


注:本文中的OrderReturn::addReturnDetail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。