本文整理匯總了PHP中OrderItem::price方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderItem::price方法的具體用法?PHP OrderItem::price怎麽用?PHP OrderItem::price使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OrderItem
的用法示例。
在下文中一共展示了OrderItem::price方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: confirm
function confirm()
{
//Generate a new basket item
$Item = new OrderItem();
$Basket = $this->_fetchBasket();
$Title = array();
foreach ($Basket['items'] as $Option) {
if ($Option->type == 'Style') {
$Item->image($Option->image);
}
$String = $Option->type . ': ' . $Option->title;
if (isset($Option->variant)) {
$String .= ' (' . $Option->variant . ')';
}
$Title[] = $String;
}
$Item->title('Custom Order');
$Item->subtitle(implode($Title, ' & '));
$Item->source('custom:' . substr(md5(time()), 0, 6));
$Item->quantity(1);
$Item->hidden(json_encode($this->basket));
$Item->price($Basket['total']);
$Item->addToOrder();
$this->clear();
redirect('/checkout/');
}
示例2: fromOrderItem
function fromOrderItem(OrderItem $Item)
{
$this->title = $Item->title();
$this->subtitle = $Item->subtitle();
$this->quantity = $Item->quantity();
$this->hidden = $Item->hidden();
$this->price = $Item->price();
$this->image = $Item->image();
list($Source, $ID) = $Item->source();
if ($Source == 'shop') {
$this->storeitem = $ID;
}
}
示例3: addtocart
function addtocart($ProductID)
{
//Generate a new basket item
$Item = new OrderItem();
$Product = new mStoreItem($ProductID);
$Item->title($Product->title);
$Item->source('shop:' . $Product->id());
$Item->subtitle($Product->description);
$Item->quantity(1);
$Item->image($Product->main_image()->filename);
$Item->hidden(json_encode($Product->_data));
$Item->price($Product->price);
$Item->addToOrder();
redirect('/checkout/');
}