本文整理汇总了PHP中Magento\Quote\Model\Quote::setReservedOrderId方法的典型用法代码示例。如果您正苦于以下问题:PHP Quote::setReservedOrderId方法的具体用法?PHP Quote::setReservedOrderId怎么用?PHP Quote::setReservedOrderId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Quote\Model\Quote
的用法示例。
在下文中一共展示了Quote::setReservedOrderId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quoteInitialization
/**
* Initialization the quote
*
* @param Quote $quote
* @return void
*/
protected function quoteInitialization(Quote $quote)
{
$quote->setCheckoutMethod(Onepage::METHOD_REGISTER);
$quote->setCustomerEmail('user@example.com');
$quote->setCustomerFirstname('Firstname');
$quote->setCustomerLastname('Lastname');
$quote->setCustomerIsGuest(false);
$quote->setReservedOrderId(null);
}
示例2: prepareOrderNumber
private function prepareOrderNumber()
{
if ($this->proxyOrder->isOrderNumberPrefixSourceChannel()) {
$orderNumber = $this->addPrefixToOrderNumberIfNeed($this->proxyOrder->getChannelOrderNumber());
if ($this->getHelper('Magento')->isMagentoOrderIdUsed($orderNumber)) {
$orderNumber .= '(1)';
}
$this->quote->setReservedOrderId($orderNumber);
return;
}
$orderNumber = $this->quote->getReservedOrderId();
if (empty($orderNumber)) {
$orderNumber = $this->quote->getResource()->getReservedOrderId($this->quote);
}
$orderNumber = $this->addPrefixToOrderNumberIfNeed($orderNumber);
if ($this->quote->getResource()->isOrderIncrementIdUsed($orderNumber)) {
$orderNumber = $this->quote->getResource()->getReservedOrderId($this->quote);
}
$this->quote->setReservedOrderId($orderNumber);
}