elgentos/regenerate-catalog-urls
Composer 安装命令:
composer require elgentos/regenerate-catalog-urls
包简介
Regenerate Catalog URL Rewrites (products, categories, cms pages)
README 文档
README
What does it do
This extension adds console commands to be able to regenerate;
- a product rewrite URL based on its url path;
- a category rewrite URL based on its url path;
- a CMS page rewrite URL based on its url path;
- a category URL path based on its URL key and its parent categories.
Install
Using Composer;
composer require elgentos/regenerate-catalog-urls php bin/magento setup:upgrade
Or download and copy the src directory into app/code/Elgentos/RegenerateCatalogUrls and run php bin/magento setup:upgrade.
How to use
Usage:
regenerate:product:url [-s|--store="..."] [pids1] ... [pidsN]
regenerate:category:url [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
regenerate:category:path [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
regenerate:cms-page:url [-s]--store="..."] [pids1] ... [pidsN]
Arguments:
pids Products (or Pages) to regenerate
cids Categories to regenerate
Options:
--store (-s) Use a specific store (store Id, store code or 'all')
--root (-r) Regenerate for root category and its children, ignoring cids.
--verbose (-v) Verbose mode to display the errors. Eg: duplicated product urls
--help (-h) Display this help message
Eg:
# Regenerate url for all products and the global store php bin/magento regenerate:product:url # Regenerate url for products with id (1, 2, 3, 4) for store 1 php bin/magento regenerate:product:url -s1 1 2 3 4 # Regenerate url for all CMS pages php bin/magento regenerate:cms-page:url -s all # Regenerate url for root category 4 and its children for store 1 php bin/magento regenerate:category:url -s1 -r4
FAQ
What's the difference between url_key and url_path?
url_key contains the key, like joust-duffle-bag for the product "Joust Duffle Bag". The url_path is generated by taking the url_key and adding the suffix (which for products is stored in catalog/seo/product_url_suffix and defaults to .html). So the url_path would by default become joust-duffle-bag.html. It also adds the category slugs of the parent categories so the url_path might become bags/joust-duffle-bag.html. However, the use of url_path has been deprecated since early Magento 2.1 versions (see here). If you are running on a recent Magento 2 version, you can safely delete those values by running DELETE FROM catalog_product_entity_varchar WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'url_path' AND entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')).
URL paths are still used in categories though, so don't remove those.
Why am I getting a 'Duplicated url' warning when running the command?
If you see this error, you have duplicate url_key values (within a store) in catalog_product_entity_varchar. You can use this extension to check those (and you need to fix them manually): baldwin/magento2-module-url-data-integrity-checker.
elgentos/regenerate-catalog-urls 适用场景与选型建议
elgentos/regenerate-catalog-urls 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.64M 次下载、GitHub Stars 达 284, 最近一次更新时间为 2018 年 09 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 elgentos/regenerate-catalog-urls 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elgentos/regenerate-catalog-urls 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.64M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 285
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2018-09-04