与本指南相关,我已经将我们的商店升级到Magento 1.9.1:
Configurable Swatches Guide for Magento...
问题是缩略图和色板没有播种。在system.log中有以下错误:
2015-01-16T16:56:39+00:00 ERR (3): Notice: Undefined index: product_id in /magento/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 281这是代码片段:
foreach ($mediaGallery['images'] as $mediaGalleryImage) {
if ($mediaGalleryImage['product_id'] == $product->getId()) {
$newMediaGalleryImages[] = $mediaGalleryImage;
} else {
$configurableImages[] = $mediaGalleryImage;
}
}当我检查数组时,我找不到$mediaGalleryImage‘’product_id‘。我不确定是升级出了什么问题,还是magento出了问题。我使用rwd主题对其进行了测试。
发布于 2015-02-03 14:00:46
我遇到了这个问题,在我的例子中,它是一个名为MageWorx SeoSuite (版本3.13.0)的第三方扩展。我遇到的问题是,当启用可配置色板时,画廊图像不会显示在产品详细信息上。到本文为止,升级到最新版本(3.14.2)仍然没有解决这个问题。
我在MageWorx_XSitemap模块的MageWorx_XSitemap_Model_Catalog_Resource_Eav_Mysql4_Product_Attribute_Backend_Media类中找到了'loadGallery‘方法。这会破坏可配置样例功能。
我不得不暂时在模块config.xml中将其注释掉:
<catalog_resource_eav_mysql4>
<rewrite>
<!-- <product_attribute_backend_media>MageWorx_XSitemap_Model_Catalog_Resource_Eav_Mysql4_Product_Attribute_Backend_Media</product_attribute_backend_media> -->
</rewrite>
</catalog_resource_eav_mysql4>所以,检查任何类的重写。
希望这能有所帮助。
发布于 2015-06-18 16:07:46
正如MageMechanic.com所说,如果你正在使用xsitemap,并且你有以下重写:
<catalog_resource_eav_mysql4>
<rewrite>
<product_attribute_backend_media>MageWorx_XSitemap_Model_Catalog_Resource_Eav_Mysql4_Product_Attribute_Backend_Media</product_attribute_backend_media>
</rewrite>
</catalog_resource_eav_mysql4>转到MageWorx_XSitemap_Model_Catalog_Resource_Eav_Mysql4_Product_Attribute_Backend_Media类,并将loadGalary函数更新如下:
public function loadGallery($product, $object)
{
$eventObjectWrapper = new Varien_Object(
array(
'product' => $product,
'backend_attribute' => $object
)
);
Mage::dispatchEvent(
$this->_eventPrefix . '_load_gallery_before',
array('event_object_wrapper' => $eventObjectWrapper)
);
if ($eventObjectWrapper->hasProductIdsOverride()) {
$productIds = $eventObjectWrapper->getProductIdsOverride();
} else {
$productIds = array($product->getId());
}
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
$result = $connection->fetchAll("
SELECT `main`.`value_id`, `main`.`value` AS `file`, `main`.`entity_id` AS `product_id`, `value`.`label`, `value`.`position`,
`value`.`disabled`, `default_value`.`label` AS `label_default`, `default_value`.`position` AS `position_default`,
`default_value`.`disabled` AS `disabled_default`
FROM `" . $tablePrefix . "catalog_product_entity_media_gallery` AS `main`
LEFT JOIN `" . $this->getTable(self::GALLERY_VALUE_TABLE) . "` AS `value`
ON main.value_id=value.value_id
AND value.store_id=" . (int) $product->getStoreId() . "
LEFT JOIN `" . $this->getTable(self::GALLERY_VALUE_TABLE) . "` AS `default_value`
ON main.value_id=default_value.value_id AND default_value.store_id=0
WHERE (main.attribute_id = '" . $object->getAttribute()->getId() . "')
AND (main.entity_id in ('" . implode("','", $productIds). "'))
ORDER BY IF(value.position IS NULL, default_value.position, value.position) ASC");
$this->_removeDuplicates($result);
return $result;
}这样,您将保留此插件的好处,同时将获得默认的magento颜色观察器:) engoy编码;)
https://stackoverflow.com/questions/27989666
复制相似问题