offline_update_eav
offline_update_eav offline_update_eav

098 280-61-91

ПН - СБ  09:00 - 19:00

 ВОСКРЕСЕНЬЕ   -   ВЫХОДНОЙ

UK RU
Вход / Регистрация

// Assume $productIds array, $attributeCode = 'special_price', $storeId = 0 $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attributeCode); $table = $attribute->getBackend()->getTable(); $attributeId = $attribute->getId(); $value = 19.99; foreach (array_chunk($productIds, 500) as $chunk) { $write = Mage::getSingleton('core/resource')->getConnection('core_write'); $write->beginTransaction(); try { // Delete existing values $write->delete($table, [ 'attribute_id = ?' => $attributeId, 'entity_id IN (?)' => $chunk, 'store_id = ?' => $storeId ]); // Insert new values foreach ($chunk as $entityId) { $write->insert($table, [ 'entity_id' => $entityId, 'attribute_id' => $attributeId, 'store_id' => $storeId, 'value' => $value ]); } $write->commit(); } catch (Exception $e) { $write->rollBack(); // Log error } } // After all updates: reindex and clean cache

Here’s a piece on offline_update_eav — written as a concise technical note / documentation excerpt. Context In Magento (1.x and early 2.x patterns), EAV attributes are updated via standard models and collection saves. For large catalogs, bulk updates (e.g., price, description, or custom attribute changes) cause significant database load and reindexing overhead. The offline_update_eav approach bypasses live ORM overhead by writing directly to EAV tables in a controlled, offline process.

Этот сайт использует файлы cookie, чтобы помочь вам в навигации, а также предоставить лучший пользовательский опыт. Используя этот сайт, вы соглашаетесь на использование файлов cookie.

mega888 ewallet mega888 ewallet mega888 ewallet
Игры PLAYSTATION Игры XBOX Игры NINTENDO Игры PC