本文整理汇总了PHP中Varien_Event_Observer::getOrderIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Event_Observer::getOrderIds方法的具体用法?PHP Varien_Event_Observer::getOrderIds怎么用?PHP Varien_Event_Observer::getOrderIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Event_Observer
的用法示例。
在下文中一共展示了Varien_Event_Observer::getOrderIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: salesOrderSave
/**
* Set forced canCreditmemo flag
*
* @param Varien_Event_Observer $observer
* @return Mage_Payment_Model_Observer
*/
public function salesOrderSave($observer)
{
$orderId = current($observer->getOrderIds());
$order = Mage::getModel('sales/order')->load($orderId);
$payment = $order->getPayment();
if (!is_object($payment) || !in_array($payment->getMethod(), array('gwap_cc', 'gwap_oneclick', 'gwap_boleto', 'gwap_2cc'))) {
return $this;
}
$data = $this->getGwapPaymentData($payment);
$mGwap = Mage::getModel('gwap/order');
$mGwap->setStatus(Allpago_Gwap_Model_Order::STATUS_CREATED);
$mGwap->setCreatedAt(Mage::getModel('core/date')->date("Y-m-d H:i:s"));
// Não salvar dados do CC
if (!Mage::getStoreConfig('payment/gwap_cc/tipo_autorizacao') && $payment->getMethod() != "gwap_boleto") {
$mGwap->setInfo(Mage::helper('core')->encrypt(serialize($data->toArray())));
}
$mGwap->setType(Mage::getStoreConfig('payment/' . $payment->getMethod() . '/mc_type'));
$mGwap->setCcType($data->getCcType());
if ($payment->getMethod() == 'gwap_2cc') {
$mGwap->setCcType2($data->getCcType2());
}
$mGwap->setOrderId($order->getId());
$mGwap->save();
if (Mage::getStoreConfig('payment/gwap_cc/tipo_autorizacao')) {
if ($payment->getMethod() != 'gwap_boleto') {
$result = $order->getPayment()->getMethodInstance()->authorizeNow($order, $data->toArray());
if ($result && Mage::getStoreConfig('allpago/clearsale/active') && Mage::getStoreConfig('allpago/clearsale/produto') == 'clearid' && Mage::getStoreConfig('allpago/clearsale/clearid_questionario')) {
Mage::getModel('clearsale/clearid')->SubmitInfo($order);
}
}
}
if ($payment->getMethod() == "gwap_boleto") {
$mGwap->setInfo(Mage::helper('core')->encrypt(serialize($data->toArray())));
$mGwap->save();
$log = Mage::getModel('allpago_mc/log');
try {
$order->getPayment()->getMethodInstance()->authorize($order->getPayment(), $order->getGrandTotal());
$gwapNovo = Mage::getModel('gwap/order')->load($order->getId(), 'order_id');
$gwapNovo->setStatus(Allpago_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);
$gwapNovo->setErrorCode(null);
$gwapNovo->setErrorMessage(null);
$gwapNovo->setTries(0);
$gwapNovo->setAbandoned(0);
$gwapNovo->setUpdatedAt(Mage::getModel('core/date')->date("Y-m-d H:i:s"));
$gwapNovo->save();
$log->add($gwapNovo->getOrderId(), 'Payment', 'authorize()', Allpago_Gwap_Model_Order::STATUS_AUTHORIZED, 'Boleto gerado');
} catch (Exception $e) {
//Salva log
$log->add($mGwap->getOrderId(), '+ Conversao', 'authorize()', Indexa_Gwap_Model_Order::STATUS_ERROR, 'Ocorreu um erro', $e->getMessage());
$mGwap->setUpdatedAt(Mage::getModel('core/date')->date("Y-m-d H:i:s"));
$mGwap->save();
//$url = Mage::getUrl('sales/order/view', array('order_id'=>$order->getId()));
//$linkMessage = Mage::helper('gwap')->__('Clique aqui');
//$this->getResponse()->setBody( sprintf( Mage::helper('gwap')->__('Não foi possível gerar seu boleto no momento. Você pode reimprimir acessando o detalhe de seu pedido. %s.'), '<a href="'.$url.'" target="_blank" class="imprimir_boleto">'.$linkMessage.'</a>' ) );
return $this;
}
}
return $this;
}
示例2: checkoutMultishippingControllerSuccessAction
/**
* @param Varien_Event_Observer $observer
*/
public function checkoutMultishippingControllerSuccessAction(Varien_Event_Observer $observer)
{
$orderIds = $observer->getOrderIds();
Mage::helper('integernet_piwik')->setMultishippingOrderIds($orderIds);
}