2014-03-07 54 views
2

如何將我的magento快速搜索產品結果網址更改爲包含類別?將搜索結果產品網址更改爲包含類別

url.com/product.html到url.com/category/product.html

我知道有對規範的網址選項。但我仍然想改變它。

我的產品是單一類別,但如果它有更多的選擇第一個將會很棒。

回答

1

在管理,去

系統>配置>目錄>搜索引擎優化

和產品的URL

或者在搜索頁面設置使用類別路徑,

$product = Mage::getModel('catalog/product')->load($product_id); 
$category_id = $product->getCategoryIds(); 
$category = Mage::getModel('catalog/category')->load($category_id[0]); 
$url = $product->getUrlPath($category); 
+0

默認情況下它已經是「是」。這個問題只適用於你的分類。但是,如果你搜索的產品,它總是website.com/product.html –

+0

檢查更新的答案 –

+0

我應該編輯什麼文件無法找到它 –

相關問題