3

I'm wondering if anyone could share some information regarding the "updated_at" field in Mangento. What would cause this to change? Is it any update to the product, including category changes?

2 Answers 2

4

In the case of product entity, the attribute updated_at is an EAV attribute assigned which was created with a backend model.

class Mage_Catalog_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
{

public function getDefaultEntities()
{
    return array(
        ....
        'updated_at'         => array(
            'type'                       => 'static',
            'input'                      => 'text',
            'backend'                    => 'eav/entity_attribute_backend_time_updated',
            'sort_order'                 => 20,
            'visible'                    => false,
        );
}
}

Each time the product entity is saved, the backend class Mage_Eav_Model_Entity_Attribute_Backend_Time_Updated is invoked by the method Mage_Eav_Model_Entity_Abstract::walkAttributes then execute the update of the date and time.

For other entities, like the Order entity, the updated_at is done in a different way while saving the model, updated_at is not an EAV attribute. So it does a simple $object->setUpdatedAt(Varien_Date::now()). See Mage_Sales_Model_Resource_Abstract::_prepareDataForSave()

1

Every time a products data is updated the updated_at field is updated as well. This includes when you change the categories that the product is assigned to in the products categories tab.

2
  • thanks for taking the time to respond. Are there any known issues with this? Like is it for the most part reliable? We recently had some issues where some products were removed from categories and we're currently trying to pinpoint a time frame of when this happened so we can eventually find the culprit. Commented Oct 9, 2013 at 19:08
  • Never heard of any issues. Were the products physically removed from the categories or just not displayed? I've had some issues with indexing gone wrong on Mage 1.5 not displaying products. Commented Oct 9, 2013 at 19:15

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.