我正在使用Magento的Simple Configurable Products扩展 .
当用户更改下拉列表中的选项时,我希望能够更改相关产品 .
目前,扩展名更改了价格,短期和长期描述以及图像(即,当可配置下拉选项更改时,描述等更改为简单产品的描述等) . 我还需要能够获得以下内容:交叉销售Upsells相关产品
有没有人之前做过这个,或者知道这样做的方法?
非常感谢 .
刚刚完成添加功能,可以在选项更改时更改URL,SKU和MSRP .
它可以分两步完成 . 您将需要编写一些代码:
Related products
app / code / community / OrganicInternet / SimpleConfigurableProducts / Catalog / Block / Product / View / Type / Configurable.php
skin / frontend / base / default / js / scp_product_extension.js
Update
如果您已经想出如何更换SKU,那么对于相关/加售/交叉销售产品您将很容易 . 使用 $product->getRelatedProductCollection() , $product->getUpSellProductCollection() 和 $product->getCrossSellProductCollection() .
$product->getRelatedProductCollection()
$product->getUpSellProductCollection()
$product->getCrossSellProductCollection()
您可以在此处查看完整的示例:Fetch up-sell / related / cross-sell product programatically
Update 2
在 line 20 Configurable.php 中插入此内容:
line 20
Configurable.php
$related = $product->getRelatedProductCollection() ->addAttributeToSelect('required_options') ->addAttributeToSort('position', Varien_Db_Select::SQL_ASC) ->addStoreFilter(); Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($related); $related->load(); $relatedOutput = '<ul>'; foreach ($related as $item) { $item->setDoNotUseCategoryId(true); $relatedOutput .= '<li><a href="' . $item->getProductUrl() .'">'. $item->getName() .'</a></li>'; } $relatedOutput .= '</ul>'; $childProducts[$productId]['relatedProducts'] = $relatedOutput; // Stored to config var
并使用 relatedProducts 作为配置变量 .
relatedProducts
1 回答
刚刚完成添加功能,可以在选项更改时更改URL,SKU和MSRP .
它可以分两步完成 . 您将需要编写一些代码:
Related products
块的渲染结果:Update
如果您已经想出如何更换SKU,那么对于相关/加售/交叉销售产品您将很容易 . 使用
$product->getRelatedProductCollection()
,$product->getUpSellProductCollection()
和$product->getCrossSellProductCollection()
.您可以在此处查看完整的示例:Fetch up-sell / related / cross-sell product programatically
Update 2
在
line 20
Configurable.php
中插入此内容:并使用
relatedProducts
作为配置变量 .