asprada/magento2-module-rebuild-url-rewrite

Magento 2 模块,用于重建类别、产品和 CMS 的 URL 重写。

1.5.5 2019-10-16 11:12 UTC

This package is auto-updated.

Last update: 2024-09-16 21:57:23 UTC


README

该模块添加了一个 CLI,允许重建以下 URL 重写: categoriesproductscms-pages

它是由 Stämpfli 仓库 分支而来,并进行了一些改进,以支持

  • Magento 2 多店的多根类别 ID。

    现在,当你使用自定义类别根 ID 重建指定商店的类别 URL 时,将生成正确的 URL。

  • 使用产品 SEO 配置。

    现在在重建产品 URL 时包括了配置选项 使用类别路径作为产品 URL

    当设置为 时,具有子类别的路径的产品 URL 不会存储在 url_rewrite 表中。

    这是出于性能考虑。它防止生成未使用的 URL,并且表中的条目更少,以便快速 SQL 查询。

    配置选项路径

    Admin Panel > Stores > Settings > Configuration > Catalog > Catalog > Search Engine Optimization > Use Categories Path for Product URLs
    

安装

使用 composer 安装模块

composer require asprada/magento2-module-rebuild-url-rewrite  

用法

重建所有内容。

bin/magento urlrewrite:rebuild categories,products,cms-pages  

仅重建类别

bin/magento urlrewrite:rebuild categories  

仅重建产品

bin/magento urlrewrite:rebuild products  

仅重建 CMS 页面

bin/magento urlrewrite:rebuild cms-pages  

仅重建特定类别

bin/magento urlrewrite:rebuild categories -c=25,26,27  

或产品

bin/magento urlrewrite:rebuild products -p=1,2,3  

仅重建特定商店

bin/magento urlrewrite:rebuild categories -s=1,2  

任何组合都是可能的。

查看 --help 以获取更多信息

bin/magento urlrewrite:rebuild --help  

要求

  • PHP: 7.0.x | 7.1.x
  • Magento 2.1.x | 2.2.x

支持

如果您对此扩展有任何问题,请在 GitHub 上提交问题。

贡献

任何贡献都将受到高度赞赏。向 GitHub 提交代码的最佳方式是打开一个 pull request

开发者

Marcel HauriAdam Sprada

许可

开放软件许可 ("OSL") v. 3.0