1

I installed a plugin from amasty. This plugin adds a field "delivery_date" and "delivery_time" attribute to each order. enter image description here Now I am creating orders manually too and now my question is how can I set custom fields to an order?

1
  • You probably installed the Delivery Date extension, didn't you? – Amasty Jan 16 '16 at 9:03
0

If you need to edit the Delivery Date values from the backend, just go with "Edit" from the order view page:

If you need to edit the Delivery Date values from the backend, just go with "Edit" from the order view page.

To set these values programmatically the following code will work, assuming you have $orderId:

$deliveryDate = Mage::getModel('amdeliverydate/deliverydate');
$deliveryDate->load($orderId, 'order_id');
$data = array(
    'date'         => 'YYYY-MM-DD',
    'tinterval_id' => '[ID], // if using time intervals, this is time interval ID, 
                             // selected from drop-down  
                             // (`amasty_amdeliverydate_tinterval` table)
    'comment'      => 'Text',
);
$deliveryDate->addData($data);
$deliveryDate->save();

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.