Question

Je suis en cours d'exécution Mage 1.4.0.1.

Avec un script d'installation de MySQL, j'ai créé une nouvelle colonne "asyncupload_validated" (tinyint (1) non par défaut null 0) à la table "sales_order".

J'essaie de mettre ces données à 1 et enregistrez-le.

Voici mon code, qui ne fonctionne pas:

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

Le code est appelé (testé avec un certain Mage :: log) et le var POST est ok. Il semble être le param save () qui échoue.

Était-ce utile?

La solution 2

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top