我们已经有几年了,11,000+的产品进入了我们的Magento商店,我们不得不稍微改变一下档次。
如果Store View中使用的值(titles、enabled/disabled、descriptions)可以覆盖默认值,而不需要无休止的复制/粘贴,那么生活会更轻松。
因此,如果Store View值与默认值不同,请将其设为默认值。感谢您的帮助!
发布于 2014-09-19 02:54:00
这可以直接使用SQL完成,但请确保在开始之前设置维护模式和备份。
SET @default = 0;
SET @store = 1;
-- put the correct store_id here
START TRANSACTION;
INSERT INTO `catalog_product_entity_int` (entity_type_id, attribute_id, store_id, entity_id, value)
SELECT entity_type_id, attribute_id, @default, entity_id, value FROM `catalog_product_entity_int` AS local
WHERE store_id = @store
ON DUPLICATE KEY UPDATE value = local.value;
-- the "ON DUPLICATE..." part works because EAV tables have
-- a unique key for "entity_id, attribute_id, store_id"
DELETE FROM `catalog_product_entity_int`
WHERE store_id = @store;
-- it is safe to delete @store rows because all values
-- have been either copied or updated by now
COMMIT;
对所有catalog_product_entity_*
表重复上述步骤。然后重建索引,您可以在站点处于SSH维护模式时执行此操作。
cd path/to/magento/shell/
php indexer.php --reindex catalog_product_attribute
发布于 2018-10-11 08:24:52
我编写了一个PHP脚本,遍历storeview值,如果它们不同,则将它们复制到默认作用域,然后删除本地值。
你可以在这里看到GIST:https://gist.github.com/janzikmund/a92e0a219af5e362fa1293b52b6b831e。
它的注释是为了给你一个想法。在底部,UPDATE和TRUNCATE行被注释掉了,所以您应该能够在不修改任何数据的情况下首先运行它,然后当您确定取消注释这些行并转换数据时。
当然,不要忘记先做一个备份!
https://stackoverflow.com/questions/25915567
复制相似问题