本文整理汇总了PHP中Mage_Sales_Model_Quote::setStoreId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::setStoreId方法的具体用法?PHP Mage_Sales_Model_Quote::setStoreId怎么用?PHP Mage_Sales_Model_Quote::setStoreId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::setStoreId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQuote
/**
* Retrieve quote model object
*
* @return Mage_Sales_Model_Quote
*/
public function getQuote()
{
if (is_null($this->_quote)) {
$this->_quote = Mage::getModel('sales/quote');
if ($this->getStoreId() && $this->getQuoteId()) {
$this->_quote->setStoreId($this->getStoreId())->load($this->getQuoteId());
} elseif ($this->getStoreId() && $this->hasCustomerId()) {
$this->_quote->setStoreId($this->getStoreId())->setCustomerGroupId(Mage::getStoreConfig(self::XML_PATH_DEFAULT_CREATEACCOUNT_GROUP))->assignCustomer($this->getCustomer())->setIsActive(false)->save();
$this->setQuoteId($this->_quote->getId());
}
$this->_quote->setIgnoreOldQty(true);
$this->_quote->setIsSuperMode(true);
}
return $this->_quote;
}
示例2: getQuote
/**
* Retrieve quote model object
*
* @return Mage_Sales_Model_Quote
*/
public function getQuote()
{
if (is_null($this->_quote)) {
$this->_quote = Mage::getModel('sales/quote');
if ($this->getStoreId() && $this->getQuoteId()) {
$this->_quote->setStoreId($this->getStoreId())->load($this->getQuoteId());
} elseif ($this->getStoreId()) {
$this->_quote->setStoreId($this->getStoreId())->assignCustomer($this->getCustomer())->setIsActive(false)->save();
$this->setQuoteId($this->_quote->getId());
}
$this->_quote->setIgnoreOldQty(true);
$this->_quote->setIsSuperMode(true);
}
return $this->_quote;
}
示例3: _getQuote
/**
* Get quote based on quote and store IDs from the request
*
* @return Mage_Sales_Model_Quote|bool
*/
protected function _getQuote()
{
if (null === $this->_quote) {
$quoteId = (int) $this->_request->{$this->_orderNode}->custom_1;
$storeId = (int) $this->_request->{$this->_orderNode}->custom_2;
if ($quoteId > 0) {
$this->_quote = Mage::getModel('sales/quote');
if ($storeId > 0) {
$this->_quote->setStoreId($storeId)->load($quoteId);
} else {
$this->_quote->loadByIdWithoutStore($quoteId);
}
if ($this->_quote->isVirtual()) {
$this->_quote->getBillingAddress()->setPaymentMethod('rakuten');
} else {
$this->_quote->getShippingAddress()->setPaymentMethod('rakuten');
}
} else {
return false;
}
}
return $this->_quote;
}
示例4: runCron
public function runCron()
{
$username = Mage::getStoreConfig('firstdatae4/settings/reporteruser');
$password = Mage::getStoreConfig('firstdatae4/settings/reporterpwd');
$_date = date('Y-m-d');
$start_date = $_date . '%2000:00:00';
$end_date = $_date . '%2023:59:59';
$standard = Mage::getModel('firstdatae4/standard');
$base_url = $standard->getFirstdatae4ReportUrl();
$url = "{$base_url}?start_date={$start_date}&end_date={$end_date}&status=A";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
curl_close($ch);
$report = explode("\n", $output);
array_pop($report);
$filter_a = array('eq' => $_date);
$filter_b = array('from' => $_date, 'to' => $_date . ' 23:59:59');
$recurring = Mage::getModel('firstdatae4/recurring')->getCollection()->addFieldToFilter('next_date', array($filter_a, $filter_b))->addFieldToFilter('status', array('nin' => array('DELETED')));
$data = $recurring->getData();
foreach ($data as $key => $value) {
$orderId = $value['order_id'];
Mage::unregister('rule_data');
Mage::getSingleton('adminhtml/session_quote')->clear();
$order = Mage::getModel('sales/order')->load($orderId);
$incId = $order->getIncrementId();
foreach ($report as $k => $v) {
if ($k > 0) {
if (sizeof($v) > 0) {
$line = explode(",", $v);
if ($line[6] == "Purchase" && $line[10] == $incId) {
$approvalcode = $line[8];
$transid = $line[0];
$newQuote = new Mage_Sales_Model_Quote();
$newQuote->setStoreId($order->getStoreId());
Mage::getSingleton('adminhtml/sales_order_create')->setQuote($newQuote);
$order_model = Mage::getSingleton('adminhtml/sales_order_create');
$order_model->getSession()->clear();
try {
$order->setReordered(true);
Mage::getSingleton('adminhtml/session_quote')->setUseOldShippingMethod(true);
$reorder = new Varien_Object();
$reorder = $order_model->initFromOrder($order);
$newOrder = $reorder->createOrder();
$reOrderId = $newOrder->getId();
$reOrderIncId = $newOrder->getIncrementId();
$next = Mage::getModel('firstdatae4/plans')->nextDate($_date, $value['type']);
$model = Mage::getModel('firstdatae4/recurring');
$model->nextRun($orderId, $next);
$model->prepareHistory(array('recurring_id' => $value['recurring_id'], 'date_of_run' => $_date, 'order_created' => $reOrderIncId));
$newOrder->getPayment()->setTransactionId($transid);
$invoice = $newOrder->prepareInvoice();
$invoice->register()->pay();
Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder())->save();
$newOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, Mage::helper('firstdatae4')->__('Notified customer about invoice #%s.', $invoice->getIncrementId()), $notified = true);
$newOrder->save();
$newOrder->sendNewOrderEmail();
$newOrder->save();
Mage::log("Order #{$incId} is Reorders To New Order #{$reOrderIncId} Successfully", null, "reorder.log");
} catch (Exception $e) {
Mage::log("Order #{$incId} Reorder Error : {$e}", null, "reorder.log");
}
}
}
}
}
}
}
示例5: catch
<?php
require_once 'app/Mage.php';
Mage::app();
$orderId = 382;
Mage::unregister('rule_data');
Mage::getSingleton('adminhtml/session_quote')->clear();
$order = Mage::getModel('sales/order')->load($orderId);
$incId = $order->getIncrementId();
$newQuote = new Mage_Sales_Model_Quote();
$newQuote->setStoreId($order->getStoreId());
Mage::getSingleton('adminhtml/sales_order_create')->setQuote($newQuote);
$order_model = Mage::getSingleton('adminhtml/sales_order_create');
$order_model->getSession()->clear();
try {
$order->setReordered(true);
Mage::getSingleton('adminhtml/session_quote')->setUseOldShippingMethod(true);
$reorder = new Varien_Object();
$reorder = $order_model->initFromOrder($order);
$newOrder = $reorder->createOrder();
$reOrderId = $newOrder->getId();
$reOrderIncId = $newOrder->getIncrementId();
Mage::log("Order #{$incId} is Reorders To New Order #{$reOrderIncId} Successfully", null, "reorder.log");
} catch (Exception $e) {
Mage::log("Order #{$incId} Reorder Error : {$e->getMessage()}", null, "reorder.log");
}
$reorder->getSession()->clear();
Mage::unregister('rule_data');
Mage::getSingleton('adminhtml/session_quote')->clear();
//---------------------------------------------------------------
//run the reminders