本文整理汇总了PHP中OrderSlip::addSlipDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderSlip::addSlipDetail方法的具体用法?PHP OrderSlip::addSlipDetail怎么用?PHP OrderSlip::addSlipDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderSlip
的用法示例。
在下文中一共展示了OrderSlip::addSlipDetail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createOrderSlip
public static function createOrderSlip($order, $productList, $qtyList, $shipping_cost = false)
{
$currency = new Currency($order->id_currency);
$orderSlip = new OrderSlip();
$orderSlip->id_customer = (int) $order->id_customer;
$orderSlip->id_order = (int) $order->id;
$orderSlip->shipping_cost = (int) $shipping_cost;
$orderSlip->conversion_rate = $currency->conversion_rate;
if (!$orderSlip->add()) {
return false;
}
$orderSlip->addSlipDetail($productList, $qtyList);
return true;
}
示例2: createOrderSlip
public static function createOrderSlip($order, $productList, $qtyList, $shipping_cost = false)
{
$currency = new Currency($order->id_currency);
$orderSlip = new OrderSlip();
$orderSlip->id_customer = (int) $order->id_customer;
$orderSlip->id_order = (int) $order->id;
$orderSlip->shipping_cost = (int) $shipping_cost;
if ($orderSlip->shipping_cost) {
$orderSlip->shipping_cost_amount = $order->total_shipping_tax_incl;
}
$orderSlip->conversion_rate = $currency->conversion_rate;
$orderSlip->partial = 0;
$orderSlip->amount = $orderSlip->shipping_cost_amount;
foreach ($productList as $id_order_detail) {
$order_detail = new OrderDetail((int) $id_order_detail);
$orderSlip->amount += $order_detail->unit_price_tax_incl * $qtyList[(int) $id_order_detail];
}
if (!$orderSlip->add()) {
return false;
}
$orderSlip->addSlipDetail($productList, $qtyList);
return true;
}
示例3: createOrderSlip
public static function createOrderSlip($order, $productList, $qtyList, $shipping_cost = false)
{
// create orderSlip
$orderSlip = new OrderSlip();
$orderSlip->id_customer = intval($order->id_customer);
$orderSlip->id_order = intval($order->id);
$orderSlip->shipping_cost = intval($shipping_cost);
if (!$orderSlip->add()) {
return false;
}
// add details
$orderSlip->addSlipDetail($productList, $qtyList);
return true;
}