如何获得客户Feed扩展的产品实际价格

时间:2015-04-16 09:17:37

标签: magento

我正在尝试获取产品的实际价格,我可以获得产品的正常价格,但对于某些产品我有下拉选择,价格为配置这些产品我的价格是没有同步这种产品。

请查看屏幕截图以获取更多信息:

对于这些类型的产品,我可以得到价格: http://www.awesomescreenshot.com/image/93901/bef62f7ea6f26130a719f4fa25876f3b

对于这些类型的我无法获得价格: http://www.awesomescreenshot.com/image/94069/294f8f9823179a35939fdf8dc8d2c594

这是我的observer.php

 $productData = array(
                    'SKU'               => $product->sku,
                    'Name'              => $product->name,
                    'ShopUrl'           => $product-> getProductUrl(),
                    'Description'       => $product->short_description,
                    'Currency'          => Mage::app()->getStore()->getCurrentCurrencyCode(),
                    'Price'             => number_format($product->price, 2, '.', ''),
                    'DiscountedPrice'   => $product-> special_price == null ? null : number_format($product-> special_price, 2, '.', ''),
                    'IsActive'          => ($product -> status) == 1 ? "true" : "false",
                    'Image'             => $productImage,
                    'Category'          => $productCategory,
                    'CategoryId'        => $productCategoryId
                );

1 个答案:

答案 0 :(得分:1)

如果您使用的是可配置产品,那么您实际上并不需要Feed中的父产品,所以我会用这样的东西包装你的循环;

if( $_product->getTypeId() != 'configurable' ) {
// build the array
}

将包含代表选项选择的简单产品。值得检查他们的名字是否有用 - 例如“Foo Shirt,Size 3,Blue”