experius / module-reindexcatalogurlrewrites
This package is auto-updated.
Last update: 2024-09-05 22:02:11 UTC
README
本模块已被弃用。
请使用以下推荐的替代方案
https://github.com/elgentos/regenerate-catalog-urls
该模块可能已创建无效的分类URL重写,因为这些重写是为所有商店创建的,而不是为与分类相关的商店创建的。推荐的替代方案使用与分类相关的商店。
要检查是否有无效的URL重写,请运行以下选择查询
SELECT DISTINCT u.url_rewrite_id from store as s
INNER JOIN store_group as sg
ON s.group_id = sg.group_id
INNER JOIN catalog_category_entity as c
ON sg.root_category_id = SUBSTRING_INDEX(SUBSTRING_INDEX(c.path, '/', 2), '/', -1)
LEFT JOIN url_rewrite as u
ON c.entity_id = u.entity_id AND s.store_id != u.store_id
WHERE entity_type = 'category';
此查询将返回您可以从url_rewrite表中删除的URL重写ID。
警告
- BETA
- 请在测试环境或预发布环境测试后再使用。
使用方法
所有分类、所有产品、所有商店视图 php bin/magento experius_reindexcatalogurlrewrites:categoryurls
特定产品、特定商店ID
php bin/magento experius_reindexcatalogurlrewrites:producturls --product_ids=36,37 --store_ids=1
所有产品、所有商店视图
php bin/magento experius_reindexcatalogurlrewrites:producturls
所有产品、选择的商店视图
php bin/magento experius_reindexcatalogurlrewrites:producturls --store_ids=1
所有商店视图、选择的商品
php bin/magento experius_reindexcatalogurlrewrites:producturls --product_ids=36,37
致谢
https://github.com/Iazel/magento2-regenurl/
@PascalBrouwers 分类URL pull request