【问题标题】:how can i remove main-category from the URL of sub-category in magento如何从 magento 中子类别的 URL 中删除主类别
【发布时间】:2010-09-01 07:44:56
【问题描述】:

嗨,我在 magento 中有一个网站,其中包含诸如 mydomain/Parent-category/sub-category 之类的 URL,但我想访问此 URL 以获取子类别之类的子类别,例如 mydomain/Subcategory ..请帮助我如何从中删除主类别magento中子类别的URL...我会很高兴... 非常感谢...我想要像http://www.Sofasshopping.com这样的网址

【问题讨论】:

    标签: php magento


    【解决方案1】:

    这行得通吗?根本不相信它。我也在寻找解决方案,并(可能)在 www.n2ndevelopers.com 上找到了它

    http://www.n2ndevelopers.com/magento/how-to-remove-parent-category-path-from-sub-category-url-in-magento/

    转到app/code/core/Mage/Catalog/Model/

    打开 Url.php 并转到第 632 行并注释(//)以下行

    //if (null === $parentPath) {
    //$parentPath = $this->getResource()->getCategoryParentPath($category);
    //}
    //elseif ($parentPath == '/') {
    $parentPath = ''; //('Don't comment it')
    //}
    

    现在保存并上传。

    现在登录到您网站的管理面板,然后转到系统->配置->索引管理并单击全选,然后从操作下拉列表中选择重新索引数据,然后单击提交。

    现在刷新您的缓存以查看效果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-11
      • 2022-01-07
      • 1970-01-01
      • 2011-08-05
      • 2015-10-29
      • 2014-12-13
      • 2014-08-17
      • 1970-01-01
      相关资源
      最近更新 更多