0

We dispatch our goods using a 3rd party fulfillment company and have a sales order export module which fires over all orders with the status of Processing.

We currently accept card payments with a card facilitator using their hosted form, and when payment has gone through successfully the order is given the status of Pending. We can then manually change this to Processing when we're confident the order is fully in stock and good to go.

When customers pay via PayPal Express, the order is automatically given the status of Processing.

How can I change this to Pending?

2 Answers 2

2

I found that it was actually the following flag in app/code/core/Mage/Paypal/Model/Express.php which was responsible for this:

protected $_isInitializeNeeded = false;

Change to true and this worked.

4
  • Please test entire Paypal flow to see nothing is broken anywhere. It might result in some negative consequences.
    – Prateek
    Commented Feb 3, 2016 at 15:29
  • I would not encourage to edit this in the Mage core file. I would suggest to override this by adding a rewrite of Mage_Paypal_Model_Express which contains the protected $_isInitializeNeeded = false;
    – 7ochem
    Commented Feb 3, 2016 at 15:52
  • 1
    @7ochem I would say that goes without saying :) Commented Feb 4, 2016 at 17:44
  • @Prateek Yep, I'll let you know if we come across anything. Commented Feb 4, 2016 at 17:45
0

You should be able to get the status to default to pending by doing the following:

Create a copy of app/code/core/Mage/Paypal/Model/Express.php at app/code/local/Mage/Paypal/Model/Express.php

Then change the following in your new local copy (line 220 in Magento 1.9.1.0):

$state  = Mage_Sales_Model_Order::STATE_PROCESSING;

to

$state  = Mage_Sales_Model_Order::STATE_NEW;

I'd suggest to clear Magento cache for this to take effect.

2
  • Hello, thank you for your answer, clear and precise. I have done exactly as you said and cleared the cache several times but still no joy, placed 2 orders and both go straight to Processing. Any other suggestions?
    – Nathan
    Commented Mar 26, 2015 at 17:03
  • Just to clarify a couple of things, are you using Paypal UK as this has another module to it. Also, are you using the Paypal Express Checkout option or the Website Payments Standard (includes Paypal Express Checkout)? Commented Mar 27, 2015 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.