magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

Extend CategoryFilterInput with url_path field #241

Open cjelger opened 4 years ago

cjelger commented 4 years ago

Description (*)

The categoryList field introduced in 2.3.4 should be extended to support the fetching of categories by url_path. Typically a website would indeed have the url_path of the category in the URL, so it would be straightforward to be able to use this field to fetch the corresponding Magento category.

Expected behavior (*)

CategoryFilterInput has an extra url_path field of type FilterEqualTypeInput.

Benefits

This would allow websites using URLs that contain category url paths to easily lookup categories. For example:

https://myshop.com/men/tops --> lookup category with url_path = /men/tops

Currently one has to lookup the category with url_key = tops and then filter the returned categories with url_path = /men/tops to make sure that all other tops categories are ignored (for example, /women/tops).

The alternative is to use urlResolver but this requires two queries to fetch the category.