本文整理汇总了PHP中Mage_Sales_Model_Order::getEntityId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getEntityId方法的具体用法?PHP Mage_Sales_Model_Order::getEntityId怎么用?PHP Mage_Sales_Model_Order::getEntityId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::getEntityId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hookToOrderSaveEvent
public function hookToOrderSaveEvent()
{
$order = new Mage_Sales_Model_Order();
$incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($incrementId);
//Fetch the data from select box and throw it here
$_heared4us_data = null;
$_heared4us_data = Mage::getSingleton('core/session')->getInchooHeared4us();
//Save fhc id to order obcject
$order->setData(self::ORDER_ATTRIBUTE_FHC_ID, $_heared4us_data);
$order->setData("affiliate_sale_type", $_heared4us_data);
$order->save();
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "UPDATE sales_flat_order_grid SET affiliate_sale_type = {$_heared4us_data} WHERE entity_id = '{$order->getEntityId()}'";
$write->query($sql);
if ($_heared4us_data != 3) {
$entity = $order->getEntityId();
$customer_id = $order->getCustomerId();
$expired = Mage::getModel('affiliate/affiliateexpired')->load($customer_id)->getData();
$historic = '[{"order":"' . $entity . '"}]';
$today = date("Y-m-d 23:59:59");
$expired_date = new DateTime($today);
$interval = new DateInterval('P1M');
$expired_date->add($interval);
$final = $expired_date->format('Y-m-d h:i:s');
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
if ($expired) {
$sql = "UPDATE mw_affiliate_expired SET historic='{$historic}', expired_package = '{$final}' WHERE customer_id = '{$customer_id}'";
} else {
$sql = "INSERT INTO mw_affiliate_expired VALUES({$customer_id}, '{$final}', NULL, '{$historic}')";
}
$write->query($sql);
}
}
示例2: __createNewTransaction
/**
* Re-create order with new transaction returned by Eway
* @param $data
*/
private function __createNewTransaction(Mage_Sales_Model_Order $order, $transId)
{
// Load transaction
$currentTrans = Mage::getModel('sales/order_payment_transaction')->getCollection()->addFieldToFilter('order_id', array('eq' => $order->getEntityId()));
foreach ($currentTrans as $t) {
}
if ($t == null) {
$t = new Mage_Sales_Model_Order_Payment_Transaction();
}
$trans = new Mage_Sales_Model_Order_Payment_Transaction();
// Load payment object
$payment = Mage::getModel('sales/order_payment')->load($t->getPaymentId());
$trans->setOrderPaymentObject($payment);
$trans->setOrder($order);
$trans->setParentId($t->getTransactionId());
$trans->setOrderId($order->getEntityId());
$trans->setPaymentId($t->getPaymentId());
// Get new TxnId
$break = true;
for ($i = 0; $i < 100; $i++) {
$transId += 1;
$newTrans = Mage::getModel('sales/order_payment_transaction')->getCollection()->addFieldToFilter('txn_id', array('eq' => $transId));
if (count($newTrans) == 0) {
$break = false;
break;
}
}
if ($break) {
return false;
}
$trans->setTxnId($transId);
$trans->setParentTxnId($t->getTxnId());
$trans->setTxnType($t->getTxnType());
$trans->setIsClosed($t->getIsClosed());
$trans->setCreatedAt(date('Y-m-d H:i:s'));
$trans->save();
}
示例3: __createNewTransaction
/**
* Re-create order with new transaction returned by Eway
* @param $data
*/
private function __createNewTransaction(Mage_Sales_Model_Order $order, $transId)
{
// Load transaction
$currentTrans = Mage::getModel('sales/order_payment_transaction')->getCollection()->addFieldToFilter('order_id', array('eq' => $order->getEntityId()));
foreach ($currentTrans as $t) {
}
if ($t == null) {
$t = new Mage_Sales_Model_Order_Payment_Transaction();
}
$trans = new Mage_Sales_Model_Order_Payment_Transaction();
// Load payment object
$payment = Mage::getModel('sales/order_payment')->load($t->getPaymentId());
$trans->setOrderPaymentObject($payment);
$trans->setOrder($order);
$trans->setParentId($t->getTransactionId());
$trans->setOrderId($order->getEntityId());
$trans->setPaymentId($t->getPaymentId());
$trans->setTxnId($transId);
$trans->setParentTxnId($t->getTxnId());
$trans->setTxnType($t->getTxnType());
$trans->setIsClosed($t->getIsClosed());
$trans->setCreatedAt(date('Y-m-d H:i:s'));
$trans->save();
}
示例4: _handleOrder
/**
* Handle order
*
* @param Mage_Sales_Model_Order $order
* @param ArrayObject $settings
* @return Dhl_Intraship_Model_Autocreate $this
*/
protected function _handleOrder(Mage_Sales_Model_Order $order, ArrayObject $settings = null)
{
try {
// Get intraship shipment.
$shipment = Mage::getModel('intraship/shipment')->load($order->getEntityId(), 'order_id');
if (false === $shipment->isEmpty()) {
// Checks if order has shipments and can execute again.
if (true === $shipment->canExecute()) {
// Set intraship shipment status to retry new.
$status = Dhl_Intraship_Model_Shipment::STATUS_NEW_RETRY;
$shipment->setStatus($status)->save();
}
} else {
/* @var $order Mage_Sales_Model_Order */
$this->process($order, $settings);
}
} catch (Exception $e) {
// Add comment to order if exception appears.
$this->addCommentToOrder($order, $e->getMessage());
}
return $this;
}
示例5: build
/**
* @param PagSeguroTransaction $payment
* @param Mage_Sales_Model_Order $order
* @return multitype:string date Ambigous <number, mixed> NULL
*/
public function build($payment, $order)
{
$config = $order->getEntityId() . '/' . $payment->getRecoveryCode();
// Checkbox of selection for send e-mail
$checkbox = "<label class='chk_email'>";
$checkbox .= "<input type='checkbox' name='send_emails[]' class='checkbox' data-config='" . $config . "' />";
$checkbox .= "</label>";
//$dateOrder = Mage::app()->getLocale()->date($order->getCreatedAt(), null, null, true);
// Receives the full html link to edit an order
$editOrder = "<a class='edit' target='_blank' href='" . $this->getEditOrderUrl($order->getEntityId()) . "'>";
$editOrder .= $this->__('Ver detalhes') . "</a>";
$sent = $this->getSentEmailsById($order->getEntityId());
$sent = current($sent);
if (empty($sent)) {
$sent = 0;
}
return array('checkbox' => $checkbox, 'date' => $this->getOrderMagetoDateConvert($order->getCreatedAt()), 'id_magento' => "#" . $order->getIncrementId(), 'validity_link' => $this->convertAbandonedDayIntervalToDate($order->getCreatedAt()), 'email' => $sent, 'visualize' => $editOrder);
}
示例6: SuccessOrderBeforeSaveToFM
public function SuccessOrderBeforeSaveToFM($observer)
{
$order = new Mage_Sales_Model_Order();
$incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($incrementId);
$this->SaveToFM('core', $order->getEntityId(), 'orders', 0);
Mage::getSingleton('core/session')->unsRegistry();
return;
}
示例7: build
/**
* @param PagSeguroSummaryItem $PagSeguroSummaryItem
* @param Mage_Sales_Model_Order $order
* @return multitype:date string NULL Ambigous <boolean, string, string, multitype:>
*/
public function build($payment, $order)
{
$config = $order->getId() . '/' . $payment->getCode() . '/' . $this->getPaymentStatusFromKey($payment->getStatus()->getValue(), true);
$checkbox = "<label class='chk_email'>";
$checkbox .= "<input type='checkbox' name='conciliation_orders[]' class='checkbox' data-config='" . $config . "' />";
$checkbox .= "</label>";
// Receives the full html link to edit an order
$editOrder = "<a class='edit' target='_blank' href='" . $this->getEditOrderUrl($order->getEntityId()) . "'>";
$editOrder .= $this->__('Ver detalhes') . "</a>";
return array('checkbox' => $checkbox, 'date' => $this->getOrderMagetoDateConvert($order->getCreatedAt()), 'id_magento' => "#" . $order->getIncrementId(), 'id_pagseguro' => $payment->getCode(), 'status_magento' => $this->getPaymentStatusToString($this->getPaymentStatusFromValue($order->getStatus())), 'status_pagseguro' => $this->getPaymentStatusToString($payment->getStatus()->getValue()), 'edit' => $editOrder);
}
示例8: checkRecurrencesByOrder
/**
*
* @param Mage_Sales_Model_Order $order
* @return boolean
*/
public function checkRecurrencesByOrder(Mage_Sales_Model_Order $order)
{
$payment = $order->getPayment();
if ($payment->getAdditionalInformation('isRecurrency') != '1') {
return false;
}
// @var $transactions Mage_Sales_Model_Order_Payment_Transaction
$transactions = Mage::getModel('sales/order_payment_transaction')->getCollection()->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()));
$transactionsKeys = array();
if ($transactions->getSize()) {
foreach ($transactions as $transaction) {
$transactionsKeys[] = $transaction->getAdditionalInformation('TransactionKey');
}
}
// @var $api Uecommerce_Mundipagg_Model_Api
$api = Mage::getModel('mundipagg/api');
$apiTransactions = $api->getTransactionHistory($payment->getAdditionalInformation('OrderKey'));
$transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
if (count($apiTransactions['result'])) {
foreach ($apiTransactions['result']->SaleDataCollection->Sale->CreditCardTransactionDataCollection->CreditCardTransactionData as $transaction) {
if (!in_array($transaction->TransactionKey, $transactionsKeys)) {
// Check if ONEDOLLARAUTH transaction
if ($transaction->AmountInCents == '100' && $transaction->AuthorizedAmountInCents == '100' && $transaction->InstallmentCount == '0' && $transaction->IsReccurency == 'true') {
continue;
}
$this->_addTransaction($payment, $transaction->TransactionKey, $transactionType, $transaction);
}
}
}
}