本文整理汇总了PHP中Mage_Sales_Model_Order::getStoreId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getStoreId方法的具体用法?PHP Mage_Sales_Model_Order::getStoreId怎么用?PHP Mage_Sales_Model_Order::getStoreId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::getStoreId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStore
/**
* Returns requested store object.
*
* @param int $storeId Specific store ID or null for current one.
*
* @return Mage_Core_Model_Store
*/
public function getStore($storeId = null)
{
if (!$storeId && Mage::app()->getStore()->isAdmin()) {
$storeId = $this->_order->getStoreId();
}
return Mage::app()->getStore($storeId);
}
示例2: _sendEmail
/**
* @param Mage_Sales_Model_Order $order
* @throws Mage_Core_Exception
*/
protected function _sendEmail(Mage_Sales_Model_Order $order)
{
// Send email
$translate = Mage::getSingleton('core/translate');
$translate->setTranslateInline(false);
/** @var Mage_Core_Helper_Data $helper */
$helper = Mage::helper('core');
$loginUrl = Mage::getUrl('ho_customer/account/login', array('encryption' => $helper->getEncryptor()->encrypt($order->getCustomerId()), 'forward_url' => base64_encode(Mage::getUrl('ho_customer/account/completeProfile'))));
/** @var Mage_Core_Model_Email_Template $emailTemplate */
$emailTemplate = Mage::getModel('core/email_template');
$emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $order->getStoreId()))->sendTransactional($this->getConfig()->getEmailTemplate($order->getStoreId()), $this->getConfig()->getEmailSender($order->getStoreId()), $order->getCustomerEmail(), $order->getCustomerName(), array('order' => $order, 'login_url' => $loginUrl));
$customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
$customer->setData('complete_profile_sent', true)->getResource()->saveAttribute($customer, 'complete_profile_sent');
$translate->setTranslateInline(true);
}
示例3: createByApiResponse
/**
* @param Mage_Sales_Model_Order $order
* @param Payone_Api_Response_Interface $response
* @param Payone_Api_Request_Interface $request
* @throws Payone_Core_Exception_TransactionAlreadyExists
* @return null|Payone_Core_Model_Domain_Transaction
*/
public function createByApiResponse(Mage_Sales_Model_Order $order, Payone_Api_Response_Interface $response, Payone_Api_Request_Interface $request)
{
$transaction = $this->getFactory()->getModelTransaction();
$transaction->load($response->getTxid(), 'txid');
// should not exist but to be sure load by txid
if ($transaction->hasData()) {
throw new Payone_Core_Exception_TransactionAlreadyExists($response->getTxid());
}
$transaction->setTxid($response->getTxid());
$transaction->setLastTxaction($response->getStatus());
$transaction->setUserid($response->getUserid());
$transaction->setStoreId($order->getStoreId());
$transaction->setOrderId($order->getId());
$transaction->setReference($order->getIncrementId());
$transaction->setCurrency($order->getOrderCurrencyCode());
$transaction->setCustomerId($order->getCustomerId());
$transaction->setClearingtype($request->getClearingtype());
$transaction->setMode($request->getMode());
$transaction->setMid($request->getMid());
$transaction->setAid($request->getAid());
$transaction->setPortalid($request->getPortalid());
$transaction->setLastSequencenumber(0);
$data = $response->toArray();
$transaction->addData($data);
$transaction->save();
return $transaction;
}
示例4: seamlessConfirmAction
/**
* Confirm Controller for Seamless Payments
*/
public function seamlessConfirmAction()
{
try {
$data = $this->_checkReturnedPost(true);
$storeId = $this->order->getStoreId();
$methodCode = $this->paymentInst->getCode();
$secretKey = Mage::getStoreConfig('payment/' . $methodCode . '/secret_key', $storeId);
$confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString();
$return = WirecardCEE_Client_QPay_Return::createReturnInstance($data['raw'], $secretKey);
if ($return->validate()) {
$this->_confirmState($data['post'], $return);
} else {
throw new Exception('Unhandled Wirecard Checkout Seamless action "' . $data['paymentState'] . '".');
}
$this->order->save();
// send confirmation for status change
die($confirmResponse);
} catch (Exception $e) {
$orderId = !empty($data['orderId']) ? $data['orderId'] : '';
Mage::log('Wirecard Checkout Page transaction status update failed: ' . $e->getMessage() . '(' . $orderId . ')');
Mage::log($e->getMessage() . "\n" . $e->getTraceAsString(), null, 'wirecard_checkout_page_exception.log');
$confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString($e->getMessage());
die($confirmResponse);
}
}
示例5: addOrderToQueue
/**
* Add the items from the given order to the Order Sync queue. Does nothing if
* Order Sync is disabled for the store that the order was placed in.
*
* @param Mage_Sales_Model_Order $order
* @param bool $force Skip enabled check
*
* @return $this
*/
public function addOrderToQueue(Mage_Sales_Model_Order $order, $force = false)
{
if (!$this->isEnabled($order->getStoreId()) && !$force) {
return $this;
}
$items = array();
foreach ($order->getAllVisibleItems() as $item) {
/** @var Mage_Sales_Model_Order_Item $item */
// For configurable products add children items only, for all other products add parents
if ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
foreach ($item->getChildrenItems() as $child) {
if ($child->getId() != null) {
$items[] = $child->getId();
}
}
} else {
if ($item->getId() != null) {
$items[] = $item->getId();
}
}
}
// in case of multiple addresses used for shipping
// its possible that items object here is empty
// if so, we do not add to the item.
if (!empty($items)) {
$this->addItemsToQueue($items);
}
return $this;
}
示例6: logSale
/**
* Send order to MailChimp
*
* @param Mage_Sales_Model_Order $order
* @return bool|array
*/
public function logSale($order)
{
$this->_order = $order;
$api = Mage::getSingleton('monkey/api', array('store' => $this->_order->getStoreId()));
if (!$api) {
return false;
}
$subtotal = $this->_order->getSubtotal();
$discount = (double) $this->_order->getDiscountAmount();
if ($discount != 0) {
$subtotal = $subtotal + $discount;
}
$this->_info = array('id' => $this->_order->getIncrementId(), 'total' => $subtotal, 'shipping' => $this->_order->getShippingAmount(), 'tax' => $this->_order->getTaxAmount(), 'store_id' => $this->_order->getStoreId(), 'store_name' => $this->_order->getStoreName(), 'plugin_id' => 1215, 'items' => array());
$emailCookie = $this->_getEmailCookie();
$campaignCookie = $this->_getCampaignCookie();
$this->setItemstoSend();
if ($emailCookie && $campaignCookie) {
$this->_info['email_id'] = $emailCookie;
$this->_info['campaign_id'] = $campaignCookie;
//Send order to MailChimp
$rs = $api->campaignEcommOrderAdd($this->_info);
} else {
$this->_info['email'] = $this->_order->getCustomerEmail();
$rs = $api->ecommOrderAdd($this->_info);
}
if ($rs === TRUE) {
$this->_logCall();
return true;
} else {
return $rs;
}
}
示例7: _getTrackingUrl
/**
* Retrieve tracking url with params
*
* @param string $key
* @param Mage_Sales_Model_Order|Mage_Sales_Model_Order_Shipment|Mage_Sales_Model_Order_Shipment_Track $model
* @param string $method Optional - method of a model to get id
* @return string
*/
protected function _getTrackingUrl($key, $model, $method = 'getId')
{
$helper = Mage::helper('Mage_Core_Helper_Data');
$urlPart = "{$key}:{$model->{$method}()}:{$model->getProtectCode()}";
$param = array('hash' => $helper->urlEncode($urlPart));
$storeModel = Mage::app()->getStore($model->getStoreId());
return $storeModel->getUrl('shipping/tracking/popup', $param);
}
示例8: toQuote
/**
* Converting order object to quote object
*
* @param Mage_Sales_Model_Order $order
* @return Mage_Sales_Model_Quote
*/
public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
{
if (!$quote instanceof Mage_Sales_Model_Quote) {
$quote = Mage::getModel('sales/quote');
}
$quote->setStoreId($order->getStoreId())->setOrderId($order->getId())->setCustomerId($order->getCustomerId())->setCustomerEmail($order->getCustomerEmail())->setCustomerGroupId($order->getCustomerGroupId())->setCustomerTaxClassId($order->getCustomerTaxClassId())->setCustomerIsGuest($order->getCustomerIsGuest())->setBaseCurrencyCode($order->getBaseCurrencyCode())->setStoreCurrencyCode($order->getStoreCurrencyCode())->setQuoteCurrencyCode($order->getOrderCurrencyCode())->setStoreToBaseRate($order->getStoreToBaseRate())->setStoreToQuoteRate($order->getStoreToOrderRate())->setGrandTotal($order->getGrandTotal())->setBaseGrandTotal($order->getBaseGrandTotal())->setCouponCode($order->getCouponCode())->setGiftcertCode($order->getGiftcertCode())->setAppliedRuleIds($order->getAppliedRuleIds())->collectTotals();
Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
return $quote;
}
示例9: setOrder
/**
* Set order object and grab some metadata from it
*
* @param Mage_Sales_Model_Order $order
* @return Mage_Sales_Model_Order_Status_History
*/
public function setOrder(Mage_Sales_Model_Order $order)
{
$this->_order = $order;
$id = $order->getId();
if (!$id) {
$this->_shouldSetOrderBeforeSave = true;
}
return $this->setParentId($id)->setStoreId($order->getStoreId());
}
示例10: _validateEventData
/**
* Checking returned parameters
* Thorws Mage_Core_Exception if error
* @param bool $fullCheck Whether to make additional validations such as payment status, transaction signature etc.
*
* @return array $params request params
*/
protected function _validateEventData($fullCheck = true)
{
// get request variables
$params = $this->_eventData;
if (empty($params)) {
Mage::throwException('Request does not contain any elements.');
}
// check order ID
if (empty($params['transaction_id']) || $fullCheck == false && $this->_getCheckout()->getMoneybookersRealOrderId() != $params['transaction_id']) {
Mage::throwException('Missing or invalid order ID.');
}
// load order for further validation
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($params['transaction_id']);
if (!$this->_order->getId()) {
Mage::throwException('Order not found.');
}
if (0 !== strpos($this->_order->getPayment()->getMethodInstance()->getCode(), 'moneybookers_')) {
Mage::throwException('Unknown payment method.');
}
// make additional validation
if ($fullCheck) {
// check payment status
if (empty($params['status'])) {
Mage::throwException('Unknown payment status.');
}
// check transaction signature
if (empty($params['md5sig'])) {
Mage::throwException('Invalid transaction signature.');
}
$checkParams = array('merchant_id', 'transaction_id', 'secret', 'mb_amount', 'mb_currency', 'status');
$md5String = '';
foreach ($checkParams as $key) {
if ($key == 'merchant_id') {
$md5String .= Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_CUSTOMER_ID, $this->_order->getStoreId());
} elseif ($key == 'secret') {
$secretKey = Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_SECRET_KEY, $this->_order->getStoreId());
if (empty($secretKey)) {
Mage::throwException('Secret key is empty.');
}
$md5String .= strtoupper(md5($secretKey));
} elseif (isset($params[$key])) {
$md5String .= $params[$key];
}
}
$md5String = strtoupper(md5($md5String));
if ($md5String != $params['md5sig']) {
Mage::throwException('Hash is not valid.');
}
// check transaction amount if currency matches
if ($this->_order->getOrderCurrencyCode() == $params['mb_currency']) {
if (round($this->_order->getGrandTotal(), 2) != $params['mb_amount']) {
Mage::throwException('Transaction amount does not match.');
}
}
}
return $params;
}
示例11: getStoreName
/**
* Returns the name of the website, store and store view the order was placed in.
*
* @param Mage_Sales_Model_Order $order The order to return info from
* @return String The name of the website, store and store view the order was placed in
*/
protected function getStoreName($order)
{
$storeId = $order->getStoreId();
if (is_null($storeId)) {
return $this->getOrder()->getStoreName();
}
$store = Mage::app()->getStore($storeId);
$name = array($store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName());
return implode(', ', $name);
}
示例12: _getStoreIdFromSalesObject
/**
* Get store id from quote address or order object
*
* @param OnePica_AvaTax_Model_Sales_Quote_Address|Mage_Sales_Model_Order $object
* @return int|null
*/
protected function _getStoreIdFromSalesObject($object)
{
$storeId = null;
if ($object instanceof Mage_Sales_Model_Order) {
$storeId = $object->getStoreId();
} elseif ($object instanceof OnePica_AvaTax_Model_Sales_Quote_Address) {
$storeId = $object->getQuote()->getStoreId();
}
return $storeId;
}
示例13: toQuote
/**
* Converting order object to quote object
*
* @param Mage_Sales_Model_Order $order
* @return Mage_Sales_Model_Quote
*/
public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
{
if (!$quote instanceof Mage_Sales_Model_Quote) {
$quote = Mage::getModel('sales/quote');
}
$quote->setStoreId($order->getStoreId())->setOrderId($order->getId());
Mage::helper('core')->copyFieldset('sales_convert_order', 'to_quote', $order, $quote);
Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
return $quote;
}
示例14: _getPaymentMethodsAllowed
/**
* Certain payment methods require a list of other payment methods that will be used to finalize the payment.
* This method forms that list
*
* @return string
*/
protected function _getPaymentMethodsAllowed()
{
$configAllowed = Mage::getStoreConfig('buckaroo/' . $this->_code . '/allowed_methods', $this->_order->getStoreId());
$allowedArray = explode(',', $configAllowed);
if (in_array('all', $allowedArray)) {
$allowedArray = array('amex', 'directdebit', 'giropay', 'ideal', 'mastercard', 'onlinegiro', 'paypal', 'paysafecard', 'sofortueberweisung', 'transfer', 'visa', 'maestro', 'visaelectron', 'vpay', 'bancontactmrcash');
}
$allowedString = implode(',', $allowedArray);
return $allowedString;
}
示例15: putOrderId
/**
* Return the order id or false if order id should not be displayed on document.
*
* @param Mage_Sales_Model_Order $order
* @param string $mode
* @return mixed
*/
public function putOrderId(Mage_Sales_Model_Order $order, $mode = 'invoice')
{
switch ($mode) {
case 'invoice':
if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())) {
return $order->getRealOrderId();
}
break;
case 'shipment':
if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId())) {
return $order->getRealOrderId();
}
break;
case 'creditmemo':
if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID, $order->getStoreId())) {
return $order->getRealOrderId();
}
break;
}
return false;
}