2

I am using Magento 1.7 version and having issue while updating data of order after make payment from PayPal.

I have an event sales_order_invoice_pay which works on invoice generate. When I make a payment from PayPal, it generates an invoice of order placed then this event calls.

<sales_order_invoice_pay>
      <observers>
          <test>
              <type>singleton</type>
              <class>test/observer</class>
              <method>getInvoice</method>
           </test>
       </observers>        
</sales_order_invoice_pay>

Then, I have a field in sales_flat_order table which I want to update using

$orders = Mage::getModel('sales/order')->load($orderId);
$orders->setFieldId($fieldId);

I have value of both $orderId and $fieldId.

But it is not updating. It shows blank. I think this is due to PayPal IPN which overwrites the value of my field.

Is there any event for updating this value?

Any event which trigger after PayPal IPN received?

Any event which trigger after order detail email sent to customer?

Any idea which solves above issue?

1

Just a clue but do you $orders->save(); after your code to actually save your changes?

You can find a list of available Events here: http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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