2013-11-27 78 views

回答

0

你可以通过url重写来实现这一点。

去URL重写和添加自定义URL重写,给唯一的ID路径。

并在请求路径中给出http://tuinbeursnederland.nl.testbyte.nl/blokhutten-tuinhuizen/blokhutten/op-maat/此URL并在目标路径中给这个URL http://tuinbeursnederland.nl.testbyte.nl/blokhutten/op-maat/ magento在内部考虑它的使用目标路径。

有关网址更多相关资料重写,你可以在这里看到http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index

http://blog.beetleweb.com/2012/10/creating-custom-magento-url-rewrites/

0
class CP_Core_Model_Catalogurl extends Mage_Catalog_Model_Url 
{ 
    /** 
    * Retrieve Category URL 
    * 
    * @param array $params 
    * @return string 
    */ 
    public function getCategoryRequestPath($category, $parentPath) 
    { 
     $storeId = $category->getStoreId(); 
     $idPath = $this->generatePath('id', null, $category); 
     $suffix = $this->getCategoryUrlSuffix($storeId); 

     if (isset($this->_rewrites[$idPath])) { 
      $this->_rewrite = $this->_rewrites[$idPath]; 
      $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); 
     } 

     if ($category->getUrlKey() == '') { 
      $urlKey = $this->getCategoryModel()->formatUrlKey($category->getName()); 
     } 
     else { 
      $urlKey = $this->getCategoryModel()->formatUrlKey($category->getUrlKey()); 
     } 

     $categoryUrlSuffix = $this->getCategoryUrlSuffix($category->getStoreId()); 
     if (null === $parentPath) { 
      $parentPath = $this->getResource()->getCategoryParentPath($category); 
     } 
     elseif ($parentPath == '/') { 
      $parentPath = ''; 
     } 
     $parentPath = Mage::helper('catalog/category')->getCategoryUrlPath($parentPath, 
                      true, $category->getStoreId()); 
     $parentPath = ''; 

     $requestPath = $parentPath . $urlKey . $categoryUrlSuffix; 
     if (isset($existingRequestPath) && $existingRequestPath == $requestPath . $suffix) { 
      return $existingRequestPath; 
     } 

     if ($this->_deleteOldTargetPath($requestPath, $idPath, $storeId)) { 
      return $requestPath; 
     } 

     return $this->getUnusedPath($category->getStoreId(), $requestPath, 
            $this->generatePath('id', null, $category) 
     ); 
    } 


} 

请重写模块就像我上面做自定义此功能。

+0

你好Dharmesh Hariyani, 我应该准确调整哪个文件? –