skip to Main Content

We are using Magento 1.9 for our application. Here is my sample code

 $customer_collection= Mage::getModel("customer/customer")->load($data['customer_id']);
 foreach ($data['data'] as $key => $customer) {
    $customer_collection->setData($customer['attribute_name'] , $customer['attribute_value']); 
 }
$customer_collection->save(); //finally saving the data

Above code is working for all the fields except date field. Issue is when we send multiple data including date fields, other fields are getting updated but date field is not getting updated. Can anyone help me to solve this issue?

2

Answers


  1. Chosen as BEST ANSWER

    As @mladen-ilić Suggested,

    I did Flush Cache Storage and tried again to post the data. It works like a charm.


  2. For date field update try to use

    $object->setData($attributeCode, Varien_Date::now());
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search