Пример #1
0
 /**
  * @param $shipping
  * @param $orderDetailIds
  * @param $order
  * @param $subtotal
  * @param $shipFee
  * @param $extraDiscount
  * @param $extraDiscountDesc
  * @return bool
  */
 public function createShippingRow($shipping, $orderDetailIds, $order, $subtotal, $shipFee, $extraDiscount, $extraDiscountDesc, $paid)
 {
     $orderService = new orderService();
     $address = $order->addressReceive->name . ' - ' . $order->address;
     $this->_shippingModel->createShippingRow($shipping, $address, $subtotal, $order->addressReceive->id, $shipFee, $extraDiscount, $extraDiscountDesc, $paid);
     $orderDetails = $orderService->getOrderDetailByIds($orderDetailIds);
     foreach ($orderDetails as $orderDetail) {
         $orderService->updateOrderDetail($orderDetail->id, ['shipping_service_code' => $shipping->OrderCode, 'order_service_status' => KACANA_ORDER_SERVICE_STATUS_SHIPPING, 'order_id' => $orderDetail->order_id]);
     }
     return true;
 }