偶尔用到的,Magento产品URL修复函数:addUrlRewrite(),记下了以免忘了,下次用到又要花时间search。

$collection->addAttributeToSelect($attributes)
    ->addMinimalPrice()
    ->addFinalPrice()
    ->addTaxPercents()
    ->addCategoryFilter($this->getCategory())
    ->addStoreFilter()
    ->addUrlRewrite()   // i am here

此时的addUrlRewrite()应用在$collection中。