»
S
I
D
E
B
A
R
«
Magento: Setting Abandoned Nochex order to Pending
Oct 16th, 2010 by Simon

We were seeing our abandoned Nochex orders set as status Processing – exactly the same order status as a fully paid up order. The fix is hacky but simple.

In the file app/code/core/Mage/Nochex/Model/Standard.php add the follwoing bolded line into the getStandardCheckoutFormFields () function:

/**
*  Return Standard Checkout Form Fields for request to Nochex
*
*  @return  array Array of hidden form fields
*/
public function getStandardCheckoutFormFields ()
{
$order = $this->getOrder();
/* set order status to pending until they come back from Nochex*/
$order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
if (!($order instanceof Mage_Sales_Model_Order)) {
Mage::throwException($this->_getHelper()->__(‘Cannot retrieve order object’));
}

/**     *  Return Standard Checkout Form Fields for request to Nochex     *     *  @return  array Array of hidden form fields     */    public function getStandardCheckoutFormFields ()    {        $order = $this->getOrder(); /* set order status to pending until they come back from Nochex*/ $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();        if (!($order instanceof Mage_Sales_Model_Order)) {            Mage::throwException($this->_getHelper()->__(‘Cannot retrieve order object’));        }

It actually sets the order to Pending Paypal status, but it’s better than sending out an order to someone who hasn’t actually paid for it.

Simon

»  Substance: WordPress   »  Style: Ahren Ahimsa