I am coming from a previous enviornment where doing things like modifying queries and adding columns was just a matter of writing the sql and executing it. However, now that I'm working in Magento I want to do things "the Magento way".
Scenario: we use paypal express, and before the controller redirects to paypal, I would really like to add a field (if not there already) in sales_flat_quote
, called paypal_status
- and set the value = 1 (we'll call it, sent to paypal).
On return I want to update that to either 2 or 3 (returned and pending transaction, or returned and captured transaction).
So there are two things I need to know how to do:
have something like
$db->addColumn('paypal_status')
where it will only add if not exists, andwrite
UPDATE sales_flat_quote SET paypal_status = 1 WHERE entity_id = {whatever}
This will be inside the ...Paypal_Express class.