0

I'm running Mage 1.4.0.1.

With a mysql setup script, I have created a new column "asyncupload_validated" (tinyint(1) not null default 0) to the "sales_order" table.

I try to set this data to 1 and save it.

Here is my code, who doesn't work currently :

$order = Mage::getModel("sales/order")->load($_POST["order_id"]);
$order->setAsyncuploadValidated(1);
$order->save(); 
echo "<p>".$this->__("Your files are now validated.")."</p>";

The code is called (tested with some Mage::log) and the POST var is ok. It seems to be the save() param who is failing.

2
  • Try clearing the cache. Even if your cache is disabled the table describe results are still cached by ZF.
    – Marius
    Nov 8, 2013 at 14:21
  • I've just cleared the cache, it's not the problem. Maybe something with a mapping or the large amount of Magento tables related to orders ? Nov 8, 2013 at 14:26

2 Answers 2

0

I would say in version 1.4 (UPDATE!!! REALLY!!!) orders where still eav, so to add a table you should use Mage_Sales_Model_Mysql4_Setup to addAttribute(). If you want it in the sales_order table, just use as type static.

If the attribute is added and the Zend_Db cache is renewed it should be saved.

2
  • 1.4 was the version that introduced sales_flat_order tables - 1.4.1 introduced sales_flat_order_grid
    – philwinkle
    Nov 8, 2013 at 22:29
  • really? I thought it was 1.6 but then in 1.6 came Resource vs Mysql4? But still,adding the attribute with addAttribute works for me :) Nov 8, 2013 at 22:57
0

Sorry for my late reply, i've been working on Magento upgrade. Now I'm running 1.6.2, the easiest version with our custom modules.

I've solved my problem by using the addAttribute method.

See documentation here : enter link description here

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.