本文整理汇总了PHP中Mage_Sales_Model_Order::addStatusHistoryComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::addStatusHistoryComment方法的具体用法?PHP Mage_Sales_Model_Order::addStatusHistoryComment怎么用?PHP Mage_Sales_Model_Order::addStatusHistoryComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::addStatusHistoryComment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _printPdf
/**
* Send PDF to customer, add status history comment to order.
*
* @param stdClass $response
* @param Mage_Sales_Model_Order $order
* @return Dhl_OnlineRetoure_AddressController
*/
protected function _printPdf(stdClass $response, Mage_Sales_Model_Order $order)
{
$localeDate = Mage::app()->getLocale()->date($response->issueDate);
$filenameDate = Mage::getSingleton('core/date')->date('Y-m-d', $response->issueDate);
$this->_prepareDownloadResponse(sprintf("%s_Return_%s_%s.pdf", str_replace(" ", "_", Mage::app()->getStore()->getName()), $order->getIncrementId(), $filenameDate), base64_decode($response->label), 'application/pdf');
$comment = 'Return label with ident code (IDC) %s successfully created on %s.';
$order->addStatusHistoryComment($this->__($comment, $response->idc, $localeDate))->setIsVisibleOnFront(true)->save();
Mage::helper("dhlonlineretoure/validate")->logSuccess();
return $this;
}
示例2: _createIpnComment
/**
* Generate an "IPN" comment with additional explanation.
* Returns the generated comment or order status history object
*
* @param string $comment
* @param bool $addToHistory
* @return string|Mage_Sales_Model_Order_Status_History
*/
protected function _createIpnComment($comment = '', $addToHistory = false)
{
$paymentStatus = $this->getRequestData('payment_status');
$message = Mage::helper('paypal')->__('IPN "%s".', $paymentStatus);
if ($comment) {
$message .= ' ' . $comment;
}
if ($addToHistory) {
$message = $this->_order->addStatusHistoryComment($message);
$message->setIsCustomerNotified(null);
}
return $message;
}
示例3: _processPendingPayment
/**
* processes an order awaiting payment. Sets its new state and status.
*
* @param $newStates
* @param bool $description
* @return bool
*/
protected function _processPendingPayment($newStates, $description = false)
{
$description = Mage::helper('buckaroo3extended')->__($description);
$description .= " (#{$this->_postArray['brq_statuscode']})";
//sets the transaction key if its defined ($trx)
//will retrieve it from the response array, if response actually is an array
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
}
if ($this->_order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
$this->_order->addStatusHistoryComment($description, $newStates[1])->save();
$this->_order->setStatus($newStates[1])->save();
} else {
$this->_order->addStatusHistoryComment($description)->save();
}
return true;
}
示例4: addCommentToOrder
/**
* Add comment to order
*
* @param Mage_Sales_Model_Order $order
* @param string $comment
* @param boolean $isShipmentSuccessfullyCreated
*
* @return void
*/
public function addCommentToOrder(Mage_Sales_Model_Order $order, $comment, $isShipmentSuccessfullyCreated = false)
{
/*
* for Magento 1.4.x.x
*/
if (true === $this->getConfig()->isVersionRecommendedOrLarger()) {
$order->addStatusHistoryComment($comment)->setIsVisibleOnFront(false)->setIsCustomerNotified(false)->save();
/*
* for Magento 1.3.x.x
*/
} else {
//Get existing order status
$status = $order->getStatus();
//If shipment was created successfully
if (true === $isShipmentSuccessfullyCreated) {
$status = Mage_Sales_Model_Order::STATE_PROCESSING;
}
//Is status is empty, take state
if ($status == "") {
$status = $order->getState();
}
if (false === $isShipmentSuccessfullyCreated) {
/*
* reload the order to avoid that unwanted order data is saved | SEE DHLIS-181
* Order Items are set as shipped in CE 1.3 even if there was an exception
*/
$order = Mage::getModel('sales/order')->load($order->getId());
}
$order->addStatusToHistory($status, $comment)->save();
}
}
示例5: createInvoice
/**
* Create invoice for order
*/
protected function createInvoice(Mage_Sales_Model_Order $order)
{
if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
try {
if (!$order->canInvoice()) {
$order->addStatusHistoryComment('MultiSafepay: Order cannot be invoiced.', false);
$order->save();
return false;
}
//START Handle Invoice
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
$invoice->register();
$invoice->getOrder()->setCustomerNoteNotify(false);
$invoice->getOrder()->setIsInProcess(true);
$order->addStatusHistoryComment('Automatically invoiced by MultiSafepay invoicer.', false);
$transactionSave = Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder());
$transactionSave->save();
//END Handle Invoice
//Send Invoice emails
$mail_invoice = $this->getConfigData("mail_invoice");
$send_bno_invoice = $this->getConfigData("bno_no_invoice");
$gateway = $order->getPayment()->getMethodInstance()->_gateway;
if ($mail_invoice && $gateway != 'PAYAFTER') {
$invoice->setEmailSent(true);
$invoice->sendEmail();
$invoice->save();
} elseif ($gateway == 'PAYAFTER' && !$send_bno_invoice && $mail_invoice) {
$invoice->setEmailSent(true);
$invoice->sendEmail();
$invoice->save();
}
$order->setTotalPaid($order->getGrandTotal());
} catch (Exception $e) {
$order->addStatusHistoryComment('MultiSafepay invoicer: Exception occurred during the creation of the invoice. Exception message: ' . $e->getMessage(), false);
$order->save();
}
}
return false;
}
示例6: _transactionRefunded
/**
* execute if transaction was refunded
*
* @param SofortLib_TransactionData $transData
* @param Mage_Sales_Model_Order $order
* @return void
*/
private function _transactionRefunded($transData, $order)
{
$payment = $order->getPayment();
if (!$payment->getTransaction($transData->getTransaction() . '-refund')) {
$payment->setParentTransactionId($transData->getTransaction())->setShouldCloseParentTransaction(true)->setIsTransactionClosed(0)->registerRefundNotification($transData->getAmountRefunded());
// lastschrift by sofort
if ($transData->isLastschrift()) {
$refundStatus = Mage::getStoreConfig('payment/sofort/lastschriftsofort_order_status_refund');
// Rechnung
} else {
$refundStatus = Mage::getStoreConfig('payment/sofort/sofortrechnung_order_status_refund');
}
if ($refundStatus == 'unchanged') {
$order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('The invoice has been canceled.'))->setIsVisibleOnFront(true);
} else {
$order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('The invoice has been canceled.'), $refundStatus)->setIsVisibleOnFront(true);
}
$order->save();
}
}
示例7: createInvoice
/**
* Create invoice for order
*/
protected function createInvoice(Mage_Sales_Model_Order $order)
{
if ($order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
try {
if (!$order->canInvoice()) {
$order->addStatusHistoryComment('MultiSafepay: Order cannot be invoiced.', false);
$order->save();
return false;
}
//START Handle Invoice
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$invoice->register();
$invoice->getOrder()->setCustomerNoteNotify(false);
$invoice->getOrder()->setIsInProcess(true);
$order->addStatusHistoryComment('Automatically invoiced by MultiSafepay invoicer.', false);
$transactionSave = Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder());
$transactionSave->save();
$payment = $order->getPayment();
$transaction = $payment->getTransaction($this->mspDetails['ewallet']['id']);
if (is_object($transaction)) {
$transaction->setAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $this->transdetails);
$transaction->save();
}
if ($this->_config["updatetransaction"]) {
$invoiceId = $invoice->getIncrementId();
$msp = new MultiSafepay();
$msp->test = $this->_config["test_api"] == 'test';
$msp->merchant['account_id'] = $this->_config["account_id"];
$msp->merchant['site_id'] = $this->_config["site_id"];
$msp->merchant['site_code'] = $this->_config["secure_code"];
$msp->transaction['id'] = $_GET['transactionid'];
$msp->transaction['invoice_id'] = $invoiceId;
$msp->updateInvoice();
if ($msp->error) {
echo 'update trans error';
}
}
//END Handle Invoice
//Send Invoice emails
$mail_invoice = $this->getConfigData("mail_invoice");
$send_bno_invoice = $this->getConfigData("bno_no_invoice");
$gateway = $order->getPayment()->getMethodInstance()->_gateway;
if ($mail_invoice && $gateway != 'PAYAFTER' && $gateway != 'KLARNA') {
$invoice->setEmailSent(true);
$invoice->sendEmail();
$invoice->save();
} elseif (($gateway == 'PAYAFTER' || $gateway == 'KLARNA') && $send_bno_invoice && $mail_invoice) {
$invoice->setEmailSent(true);
$invoice->sendEmail();
$invoice->save();
}
$order->setTotalPaid($order->getGrandTotal());
} catch (Exception $e) {
$order->addStatusHistoryComment('MultiSafepay invoicer: Exception occurred during the creation of the invoice. Exception message: ' . $e->getMessage(), false);
$order->save();
}
}
return false;
}
示例8: checkForOpsStateOnStatusUpdate
/**
* checks if the order's state is valid for the according Barclaycard's status. If not the order's state is reset
* to it's previous state
*
* @param Mage_Sales_Model_Order $order
*
* @return $this
*/
public function checkForOpsStateOnStatusUpdate(Mage_Sales_Model_Order $order)
{
$opsStatus = $order->getPayment()->getAdditionalInformation('status');
$opsOrderStates = $this->getStatusMappingModel()->getStatusForOpsStatus($opsStatus);
$origData = $order->getOrigData();
if (0 < count($opsOrderStates) && !in_array($order->getStatus(), $opsOrderStates)) {
$comment = $this->getDataHelper()->__('revert state update to it\'s original one because of Barclaycard\'s state restriction');
$order->addStatusHistoryComment($comment, $origData['status']);
}
return $this;
}
示例9: riskDisputeCreated
/**
* Add risk dispute to order comment
*
* @param \PayPal\Api\WebhookEvent $webhookEvent
*/
protected function riskDisputeCreated(\PayPal\Api\WebhookEvent $webhookEvent)
{
//Add IPN comment about registered dispute
$this->_order->addStatusHistoryComment($webhookEvent->getSummary())->setIsCustomerNotified(false)->save();
}
示例10: printCustomFieldComments
/**
* Print comments inside order
*
* @param Mage_Sales_Model_Order $order
* @param ShopgateOrder $shopgateOrder
* @return mixed
*/
public function printCustomFieldComments($order, $shopgateOrder)
{
if (Mage::getStoreConfig(Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_ORDER_CUSTOMFIELDS_TO_STATUSHISTORY, Mage::helper('shopgate/config')->getConfig()->getStoreViewId())) {
$comment = '';
$customFieldSet = array($this->_getHelper()->__('[SHOPGATE] Custom fields:') => $shopgateOrder->getCustomFields(), $this->_getHelper()->__('Shipping Address fields:') => $shopgateOrder->getDeliveryAddress()->getCustomFields(), $this->_getHelper()->__('Billing Address fields:') => $shopgateOrder->getInvoiceAddress()->getCustomFields());
foreach ($customFieldSet as $title => $set) {
$comment .= '<strong>' . $title . '</strong><br/>';
foreach ($set as $field) {
$comment .= '"' . addslashes($field->getLabel()) . '" => "' . addslashes($field->getValue()) . '"<br />';
}
}
$order->addStatusHistoryComment($comment, false);
}
return $order;
}
示例11: _setOrderStatusHistory
/**
* @param Mage_Sales_Model_Order $order
* @param ShopgateOrder $shopgateOrder
*
* @return Mage_Sales_Model_Order
*/
protected function _setOrderStatusHistory($order, $shopgateOrder)
{
$order->addStatusHistoryComment($this->_getHelper()->__("[SHOPGATE] Order added by Shopgate."), false);
$order->addStatusHistoryComment($this->_getHelper()->__("[SHOPGATE] Shopgate order number: %s", $shopgateOrder->getOrderNumber()), false);
Mage::helper('shopgate/import_order')->printCustomFieldComments($order, $shopgateOrder);
return $order;
}
示例12: urlerrorAction
public function urlerrorAction()
{
// este m�to es al que me dva a devolder el gateway en caso que algo salga mal
$order_id = $this->getRequest()->get('Order');
Mage::log("Modulo de pago - TodoPago ==> urlerror - orderid: " . $order_id);
$answer = $this->getRequest()->get('Answer');
Mage::log("Modulo de pago - TodoPago ==> urlerror - AnswerKey: " . $answer);
$order = new Mage_Sales_Model_Order();
$order->loadByIncrementId($order_id);
if (Mage::getStoreConfig('payment/modulodepago2/modo_test_prod') == "test") {
$order->setStatus('test_todopago_canceled');
$order->addStatusHistoryComment("Todo Pago (TEST): error en el pago del formulario");
} else {
$order->setStatus(Mage::getStoreConfig('payment/todopago_avanzada/estado_denegada'));
$order->addStatusHistoryComment("Todo Pago: error en el pago del formulario");
}
$order->save();
Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure' => true));
}
示例13: addCommentToOrder
/**
* @param Mage_Sales_Model_Order $order
* @param string $comment
* @return Mage_Sales_Model_Order_Status_History
*/
protected function addCommentToOrder(Mage_Sales_Model_Order $order, $comment)
{
$comment = $this->helper()->__($comment);
return $order->addStatusHistoryComment($comment);
}
示例14: processOrderNotifications
protected function processOrderNotifications(Mage_Sales_Model_Order $magentoOrder)
{
if ($this->getOrder()->getAccount()->isCustomerOrderNotificationEnabled()) {
$magentoOrder->sendNewOrderEmail();
}
$checkoutMessage = $this->getOrder()->getData('checkout_message');
$orderCommentsArray = $this->_proxyQuote->getOrderComments();
if (!$checkoutMessage && !count($orderCommentsArray)) {
return;
}
$comments = '<br /><b><u>' . Mage::helper('M2ePro')->__('M2E Pro Notes') . ':</u></b><br /><br />';
if ($checkoutMessage) {
$comments .= '<b>' . Mage::helper('M2ePro')->__('Checkout Message From Buyer') . ': </b>';
$comments .= $checkoutMessage . '<br />';
}
foreach ($orderCommentsArray as $comment) {
$comments .= $comment . '<br /><br />';
}
$magentoOrder->addStatusHistoryComment($comments)->save();
}
示例15: manipulateOrderWithPaymentData
/**
* Generic order manipulation, taken originally from Plugin::_setOrderPayment()
*
* @param Mage_Sales_Model_Order $magentoOrder
*
* @return Mage_Sales_Model_Order
*/
public function manipulateOrderWithPaymentData($magentoOrder)
{
$shopgateOrder = $this->getShopgateOrder();
if ($shopgateOrder->getIsPaid()) {
if ($magentoOrder->getBaseTotalDue()) {
$magentoOrder->getPayment()->setShouldCloseParentTransaction(true);
$magentoOrder->getPayment()->registerCaptureNotification($shopgateOrder->getAmountComplete());
$magentoOrder->addStatusHistoryComment($this->_getHelper()->__("[SHOPGATE] Payment received."), false)->setIsCustomerNotified(false);
}
}
$magentoOrder->getPayment()->setLastTransId($shopgateOrder->getPaymentTransactionNumber());
return $magentoOrder;
}