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


PHP OrderDetail::setQuantity方法代码示例

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


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

示例1: completeOrder

 public function completeOrder($tid)
 {
     $transaction = Transaction::getTransactionBasedOnTID($tid);
     $user = new User($transaction->getUser());
     $order = new Order();
     $order->setTid($transaction->getTid());
     $order->setUser($transaction->getUser());
     $order->setCustomerName($user->getName());
     $order->setUserEmail($user->getEmail());
     $order->setPhone($transaction->getPhone());
     $order->setShippingStreet($transaction->getShippingStreet());
     $order->setShippingCity($transaction->getShippingCity());
     $order->setShippingPostal($transaction->getShippingPostal());
     $order->setShippingProvince($transaction->getShippingProvince());
     $order->setShippingCountry($transaction->getShippingCountry());
     $order->setBillingStreet($transaction->getBillingStreet());
     $order->setBillingCity($transaction->getBillingCity());
     $order->setBillingPostal($transaction->getBillingPostal());
     $order->setBillingProvince($transaction->getBillingProvince());
     $order->setBillingCountry($transaction->getBillingCountry());
     $order->setCostSubtotal($transaction->getCostSubtotal());
     $order->setCostTax($transaction->getCostTax());
     $order->setCostShipping($transaction->getCostShipping());
     $order->setCostTotal($transaction->getCostTotal());
     $order->setIp($transaction->getIp());
     $order->setShippingClass($transaction->getShippingClass());
     $order->setPaymentClass($transaction->getPaymentClass());
     $order->setDeliveryInstructions($transaction->getDeliveryInstructions());
     $order->setStatus('Pending');
     $order->save();
     $cartItems = CartItem::getAll($transaction->getSession());
     foreach ($cartItems as $cartItem) {
         $product = new Product($cartItem->getProduct());
         $orderDetail = new OrderDetail();
         $orderDetail->setOrderNb($order->getId());
         $orderDetail->setProduct($product->getId());
         $orderDetail->setProductName($product->getName());
         $orderDetail->setQuantity($cartItem->getQuantity());
         $orderDetail->save();
         $cartItem->delete();
     }
     $transaction->delete();
     //Send an email to the user
     $this->sendEmailOrderComplete($order->getId());
     return true;
 }
开发者ID:anas,项目名称:feedstore,代码行数:46,代码来源:EComm.php

示例2: change_quantity

 public function change_quantity()
 {
     if (!isset($_POST['quantity']) || !isset($_POST['productID']) | !isset($_POST['orderID'])) {
         return call('pages', 'error');
     }
     require_once 'models/order_detail.php';
     OrderDetail::setQuantity($_POST['orderID'], $_POST['productID'], $_POST['quantity']);
     header("Location: index.php?controller=orders&action=show");
 }
开发者ID:Hield,项目名称:e-commerce,代码行数:9,代码来源:orders_controller.php


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