本文整理汇总了PHP中Mage_Sales_Model_Order::getRealOrderId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getRealOrderId方法的具体用法?PHP Mage_Sales_Model_Order::getRealOrderId怎么用?PHP Mage_Sales_Model_Order::getRealOrderId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::getRealOrderId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cancelaPedido
public function cancelaPedido(Mage_Sales_Model_Order $order)
{
$paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
$listPaymentMethodsIdeasa = Mage::helper('base')->listPaymentMethods();
$this->logger->info('Processando cancelamento do pedido ' . $order->getRealOrderId() . ', do modulo: ' . $paymentMethod);
try {
if ($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED) {
$order->cancel();
//força o cancelamento
if ($order->getStatus() != Mage_Sales_Model_Order::STATE_CANCELED) {
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, Mage::helper('base')->__('Pedido cancelado'), $notified = false);
} else {
$order->addStatusToHistory($order->getStatus(), Mage::helper('base')->__('Pedido cancelado.'));
}
if ($order->hasInvoices() != '') {
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, Mage::helper('base')->__('O pagamento e o pedido foram cancelados, mas não foi possível retornar os produtos ao estoque pois já havia uma fatura gerada para este pedido.'), $notified = false);
}
$order->save();
}
if (Mage::helper('base')->isIdeasaPaymentMethod($paymentMethod) && Mage::helper('base/module')->isPagSeguroDiretoExists() && $paymentMethod == $listPaymentMethodsIdeasa[0]) {
Mage::getModel('pagsegurodireto/notification')->sendEmail($order);
}
} catch (Exception $e) {
$this->logger->error("Erro ao cancelar pedido {$orderId} \n {$e->__toString}()");
}
$this->logger->info('Cancelamento do pedido foi concluido ' . $order->getRealOrderId() . ', do modulo: ' . $paymentMethod);
return;
}
示例2: getOrderSecret
/**
* Generate and return order secret
*
* @param Mage_Sales_Model_Order $order
* @return string
*/
public function getOrderSecret($order)
{
$email = $order->getCustomerEmail();
$orderId = $order->getRealOrderId();
$storeSecret = $this->getSBSecret();
return md5($email . $orderId . $storeSecret);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
}
示例4: testRedirectActionIsContentGenerated
public function testRedirectActionIsContentGenerated()
{
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_WPS);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
$this->dispatch('paypal/standard/redirect');
$this->assertContains('<form action="https://www.paypal.com/webscr" id="paypal_standard_checkout"' . ' name="paypal_standard_checkout" method="POST">', $this->getResponse()->getBody());
}
示例5: 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;
}
示例6: testCancelActionIsContentGenerated
public function testCancelActionIsContentGenerated()
{
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_HOSTEDPRO);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
$this->dispatch('paypal/hostedpro/cancel');
$this->assertContains('window.top.checkout.gotoSection("payment");', $this->getResponse()->getBody());
$this->assertContains('window.top.document.getElementById(\'checkout-review-submit\').show();', $this->getResponse()->getBody());
$this->assertContains('window.top.document.getElementById(\'iframe-warning\').hide();', $this->getResponse()->getBody());
}
示例7: _createCustomer
protected function _createCustomer(Mage_Sales_Model_Order $order)
{
$addresses = array();
$primaryPhone = null;
$company = null;
if ($order->getBillingAddress()) {
$addresses[] = Mage::helper('xcom_chronicle')->createAddress($order->getBillingAddress(), array(Xcom_Chronicle_Helper_Data::ADDRESS_TAG_BILLING));
$company = $order->getBillingAddress()->getCompany();
$primaryPhone = $order->getBillingAddress()->getTelephone();
}
if ($order->getShippingAddress()) {
$addresses[] = Mage::helper('xcom_chronicle')->createAddress($order->getShippingAddress(), array(Xcom_Chronicle_Helper_Data::ADDRESS_TAG_SHIPPING));
}
$data = array('id' => Mage::helper('xcom_chronicle')->createEntityId('guest' . $order->getRealOrderId()), 'fullName' => $this->_createCustomerName($order), 'addresses' => $addresses, 'primaryPhone' => array('number' => $primaryPhone, 'type' => 'UNKNOWN'), 'email' => array('emailAddress' => $order->getCustomerEmail(), 'extension' => null), 'gender' => null, 'dateOfBirth' => null, 'company' => $company, 'dateCreated' => date('c', strtotime($order->getCreatedAt())), 'lastModified' => date('c', strtotime($order->getUpdatedAt())), 'sourceIds' => null, 'emailOptOut' => null, 'doNotCall' => null);
return $data;
}
示例8: insertSplitPayment
/**
*
* @param Mage_Sales_Model_Order $order
* @param Allopass_Hipay_Model_PaymentProfile|int $profile $profile
*/
public function insertSplitPayment($order, $profile, $customerId, $cardToken)
{
if (is_int($profile)) {
$profile = Mage::getModel('hipay/paymentProfile')->load($profile);
}
if (!$this->splitPaymentsExists($order->getId())) {
$paymentsSplit = $this->splitPayment($profile, $order->getBaseGrandTotal());
//remove first element because is already paid
array_shift($paymentsSplit);
//remove last element because the first split is already paid
//array_pop($paymentsSplit);
foreach ($paymentsSplit as $split) {
$splitPayment = Mage::getModel('hipay/splitPayment');
$data = array('order_id' => $order->getId(), 'real_order_id' => (int) $order->getRealOrderId(), 'customer_id' => $customerId, 'card_token' => $cardToken, 'total_amount' => $order->getBaseGrandTotal(), 'amount_to_pay' => $split['amountToPay'], 'date_to_pay' => $split['dateToPay'], 'method_code' => $order->getPayment()->getMethod(), 'status' => Allopass_Hipay_Model_SplitPayment::SPLIT_PAYMENT_STATUS_PENDING);
$splitPayment->setData($data);
try {
$splitPayment->save();
} catch (Exception $e) {
Mage::throwException("Error on save split payments!");
}
}
}
}
示例9: logRequest
/**
* @param Mage_Sales_Model_Order $order
* @param string $uri
* @param string $method
* @param string $body
*/
public function logRequest(Mage_Sales_Model_Order $order = null, $uri, $method, $body)
{
if (!$this->isApiLogEnabled()) {
return;
}
$message = $this->getDashHash();
$message .= PHP_EOL;
$message .= PHP_EOL . 'Starting Request';
$message .= PHP_EOL . 'Request Data:';
$message .= PHP_EOL;
if ($order && $order->getId()) {
$message .= PHP_EOL . sprintf('Order ID: %s', $order->getId());
$message .= PHP_EOL . sprintf('Order Real ID: %s', $order->getRealOrderId());
$message .= PHP_EOL . sprintf('Order State: %s', $order->getState());
$message .= PHP_EOL . sprintf('Order Status: %s', $order->getStatus());
}
$message .= PHP_EOL . sprintf('URI: %s', $uri);
$message .= PHP_EOL . sprintf('Method: %s', $method);
$message .= PHP_EOL . sprintf('Request Body: %s', $body);
$message .= PHP_EOL;
$message .= $this->getShortDashHash();
$this->log($message);
}
示例10: sendAcknowledgement
/**
* Associate Magento real order id with Amazon order id
*
* @param Mage_Sales_Model_Order $order
* @return string
*/
public function sendAcknowledgement($order)
{
$_document = '<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>' . $this->getMerchantIdentifier() . '</MerchantIdentifier>
</Header>
<MessageType>OrderAcknowledgement</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<OrderAcknowledgement>
<AmazonOrderID>' . $order->getExtOrderId() . '</AmazonOrderID>
<MerchantOrderID>' . $order->getRealOrderId() . '</MerchantOrderID>
<StatusCode>Success</StatusCode>
</OrderAcknowledgement>
</Message>
</AmazonEnvelope>';
$params = array('merchant' => $this->getMerchantInfo(), 'messageType' => self::MESSAGE_TYPE_ACKNOWLEDGEMENT, 'doc' => $this->_createAttachment($_document));
$this->_proccessRequest('postDocument', $params);
return $this->_result;
}
示例11: cancel
/**
* Cancel order
*
* @param Mage_Sales_Model_Order $order
* @return string Amazon Transaction Id
* Modified to use MWS instead of SOAP
*/
public function cancel($order)
{
$_document = '<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>' . $this->getMerchantIdentifier() . '</MerchantIdentifier>
</Header>
<MessageType>OrderAcknowledgement</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<OrderAcknowledgement>
<AmazonOrderID>' . $order->getExtOrderId() . '</AmazonOrderID>
<MerchantOrderID>' . $order->getRealOrderId() . '</MerchantOrderID>
<StatusCode>Failure</StatusCode>
</OrderAcknowledgement>
</Message>
</AmazonEnvelope>';
$this->_processMWSRequest($_document, "_POST_ORDER_ACKNOWLEDGEMENT_DATA_");
Mage::log("Order cancel request sent with reference ID " . $this->_result . " !");
//Adding reference id to order comments for polling later
$comment = $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PROCESSING, Mage::helper('amazonpayments')->__('Cancelled Reference ID:' . $this->_result . ' and Amazon order ID:' . $order->getExtOrderId()))->save();
return $this->_result;
}
示例12: _getInvoiceText
/**
* Compile invoiceText string. Supported placeholders are '{{store_name}}',
* '{{order_no}}'.
*
* @param Mage_Sales_Model_Order $order
*/
protected function _getInvoiceText(Mage_Sales_Model_Order $order)
{
$invoiceText = str_replace(array('{{store_name}}', '{{order_no}}'), array(Mage::app()->getStore($order->getStoreId())->getName(), $order->getRealOrderId()), $this->getConfigData('invoice_text', $order->getStoreId()));
return $invoiceText;
}
示例13: getCommonOrderValues
/**
* Returns the values which are identical for each row of the given order. These are
* all the values which are not item specific: order data, shipping address, billing
* address and order totals.
*
* @param Mage_Sales_Model_Order $order The order to get values from
* @return Array The array containing the non item specific values
*/
protected function getCommonOrderValues($order)
{
$shippingAddress = !$order->getIsVirtual() ? $order->getShippingAddress() : null;
$billingAddress = $order->getBillingAddress();
return array($order->getRealOrderId(), Mage::helper('core')->formatDate($order->getCreatedAt(), 'medium', true), $order->getStatus(), $this->getStoreName($order), $this->getPaymentMethod($order), $this->getShippingMethod($order), $this->formatPrice($order->getData('subtotal'), $order), $this->formatPrice($order->getData('tax_amount'), $order), $this->formatPrice($order->getData('shipping_amount'), $order), $this->formatPrice($order->getData('discount_amount'), $order), $this->formatPrice($order->getData('grand_total'), $order), $this->formatPrice($order->getData('base_grand_total'), $order), $this->formatPrice($order->getData('total_paid'), $order), $this->formatPrice($order->getData('total_refunded'), $order), $this->formatPrice($order->getData('total_due'), $order), $this->getTotalQtyItemsOrdered($order), $order->getCustomerName(), $order->getCustomerEmail(), $shippingAddress ? $shippingAddress->getName() : '', $shippingAddress ? $shippingAddress->getData("company") : '', $shippingAddress ? $shippingAddress->getData("street") : '', $shippingAddress ? $shippingAddress->getData("postcode") : '', $shippingAddress ? $shippingAddress->getData("city") : '', $shippingAddress ? $shippingAddress->getRegionCode() : '', $shippingAddress ? $shippingAddress->getRegion() : '', $shippingAddress ? $shippingAddress->getCountry() : '', $shippingAddress ? $shippingAddress->getCountryModel()->getName() : '', $shippingAddress ? $shippingAddress->getData("telephone") : '', $billingAddress->getName(), $billingAddress->getData("company"), $billingAddress->getData("street"), $billingAddress->getData("postcode"), $billingAddress->getData("city"), $billingAddress->getRegionCode(), $billingAddress->getRegion(), $billingAddress->getCountry(), $billingAddress->getCountryModel()->getName(), $billingAddress->getData("telephone"));
}
示例14: getOrderData
/**
* Return the order data in an array for easy processing
*
* @param Mage_Sales_Model_Order $order
* @return array
*/
protected function getOrderData($order)
{
$data = array();
$shippingAddress = !$order->getIsVirtual() ? $order->getShippingAddress() : null;
$billingAddress = $order->getBillingAddress();
$data['OrderNumber'] = $order->getRealOrderId();
//$data['OrderCreated'] = Mage::helper('core')->formatDate($order->getCreatedAt(), 'medium', true);
//$data['OrderUpdated'] = Mage::helper('core')->formatDate($order->getUpdatedAt(), 'medium', true);
//$data['OrderCreated'] = $order->getCreatedAt();
//$data['OrderUpdated'] = $order->getUpdatedAt();
$dateCreated = Mage::app()->getLocale()->date(strtotime($order->getCreatedAt()), null, null);
$dateCreated = $dateCreated->toString('yyyy-MM-dd HH:mm:ss');
$dateUpdated = Mage::app()->getLocale()->date(strtotime($order->getUpdatedAt()), null, null);
$dateUpdated = $dateUpdated->toString('yyyy-MM-dd HH:mm:ss');
$data['OrderCreated'] = $dateCreated;
$data['OrderUpdated'] = $dateUpdated;
$data['Status'] = $order->getStatus();
$data['PurchasedFrom'] = $this->getStoreName($order);
if (strtolower($this->getPaymentMethod($order)) == 'paytm_cc') {
$data['PaymentMethod'] = 'Paytm-wallet';
} else {
if (strtolower($this->getPaymentMethod($order)) == 'payumoney_shared') {
$data['PaymentMethod'] = 'Payumoney-wallet';
} else {
$data['PaymentMethod'] = $this->getPaymentMethod($order) == "free" ? 'prepaid' : $this->getPaymentMethod($order);
}
}
$data['ShippingMethod'] = $this->getShippingMethod($order);
//Shipping Provider
$data['ShippingProvider'] = $order->getData('blinkecarrier_id');
//$data['ExpectedDeliveryDate'] = $order->getData('shipping_arrival_date');
$expectedDelivery = $order->getData('shipping_arrival_date');
if (is_null($expectedDelivery)) {
$dateDelivery = "";
} else {
$dateDelivery = Mage::app()->getLocale()->date(strtotime($order->getData('shipping_arrival_date')), null, null);
$dateDelivery = $dateDelivery->toString('yyyy-MM-dd 00:00:00');
}
$data['ExpectedDeliveryDate'] = $dateDelivery;
$timeSlot = $order->getData('shipping_time_slot');
if (is_null($timeSlot)) {
$timeSlot = "";
}
$data['ExpectedTimeSlot'] = $timeSlot;
$data['Currency'] = $order->getOrderCurrencyCode();
$data['ExchangeRate'] = $order->getBaseToOrderRate();
$data['Subtotal'] = $order->getData('subtotal');
$data['Tax'] = $order->getData('tax_amount');
//VAT is for Delhi and CST for other states
if ($shippingAddress->getRegionCode() == 'IN-DL') {
$data['TaxCategory'] = 'VAT';
} else {
$data['TaxCategory'] = 'CST';
}
$data['ShippingAmount'] = $order->getData('shipping_amount');
$data['Discount'] = $order->getData('discount_amount');
$data['ShippingDiscountAmount'] = $order->getData('shipping_discount_amount');
$data['RewardsDiscountAmount'] = $order->getData('rewards_discount_amount');
$data['GrandTotal'] = $order->getData('grand_total');
$data['TotalPaid'] = $order->getData('total_paid');
$data['TotalRefunded'] = $order->getData('total_refunded');
$data['TotalDue'] = $order->getData('total_due');
$data['TotalInvoiced'] = $this->getTotalQtyItemsOrdered($order);
$data['TotalQtyItemsOrdered'] = $this->getTotalQtyItemsOrdered($order);
$data['Weight'] = $order->getWeight();
$data['CustomerName'] = $order->getCustomerName();
$data['CustomerFirstName'] = $order->getCustomerFirstname();
$data['CustomerLastName'] = $order->getCustomerLastname();
$data['CustomerMiddleName'] = $order->getCustomerMiddlename();
$data['CustomerEmail'] = $order->getCustomerEmail();
//Billing Address
$data['BillToTitle'] = $billingAddress->getPrefix();
$data['BillToName'] = $billingAddress->getName();
$data['BillToFirstName'] = $billingAddress->getFirstname();
$data['BillToLastName'] = $billingAddress->getLastname();
$data['BillToMiddleName'] = $billingAddress->getMiddlename();
$data['BillToAddressStreet'] = $billingAddress->getData("street");
$data['BillToCity'] = $billingAddress->getData("city");
$data['BillToRegionCode'] = $billingAddress->getRegionCode();
$data['BillToRegion'] = $billingAddress->getRegion();
$data['BillToCountry'] = $billingAddress->getCountry();
$data['BillToCountryName'] = $billingAddress->getCountryModel()->getName();
$data['BillToPostalCode'] = $billingAddress->getData("postcode");
$billPhoneNumber = $billingAddress->getData("telephone");
$data['BillToCustomerPhoneNum'] = $billPhoneNumber;
$data['BillToEmail'] = $billingAddress->getData("email");
//Shipping Address
$data['ShipToTitle'] = $shippingAddress ? $shippingAddress->getPrefix() : '';
$data['ShipToName'] = $shippingAddress ? $shippingAddress->getName() : '';
$data['ShipToFirstName'] = $shippingAddress ? $shippingAddress->getFirstname() : '';
$data['ShipToLastName'] = $shippingAddress ? $shippingAddress->getLastname() : '';
$data['ShipToMiddleName'] = $shippingAddress ? $shippingAddress->getMiddlename() : '';
$data['ShipToAddressStreet'] = $shippingAddress ? $shippingAddress->getData("street") : '';
$data['ShipToCity'] = $shippingAddress ? $shippingAddress->getData("city") : '';
//.........这里部分代码省略.........
示例15: _getRatingUrl
/**
* Generates the rating url by given order object.
*
* @param Mage_Sales_Model_Order $order Order object.
*
* @return string
*/
protected function _getRatingUrl($order)
{
$trustedRating = Mage::getSingleton('trustedrating/trustedrating');
$storeId = $order->getStoreId();
$tsId = $trustedRating->getTsId($storeId);
$params = array('buyerEmail' => base64_encode($order->getCustomerEmail()), 'shopOrderID' => base64_encode($order->getRealOrderId()));
$ratingUrl = $trustedRating->getEmailRatingLink($storeId) . '_' . $tsId . '.html' . '&' . http_build_query($params);
return $ratingUrl;
}