Hi, maybe this are more questions on Joomla! core developers and Joomla! routing system.
mysite.com/1-category-one/ - it's OK!
mysite.com/2-category-one/category-two/ - it's NOT OK! Why did the 'category-one' id change?
It is not ID of category one but of category two - in Joomla! but even generally you can have only on ID for category in URL so the system knows which category you want to see. In Joomla! the tree is built this way:
mysite.com/ID-of-current-category-name-of-parent-category/name-of-category/name-of-subcategory-which-is-current-category
So if you want to see category two, the ID is just from category tow
mysite.com/2-category-one/category-two/1-product-one/ - it's NOT OK!
the same like above - the ID is of the current category (category two), the url gets all categories in tree and the last ID is for the product including its ID.
So you are asking product one in category two. In case you will ask product one in category one, you will have this link:
mysite.com/1-category-two/1-product-one/
If you go to the address mysite.com/2-categoryone/ - I get a 404 error!
If there is one number in url, it tries to find the category, if none of the category meets the url, it tries to find the product. If the alias does not exists, it can be ignored and only ID can be used to recognize the request. Unfortunately, we can have two IDs (category, products), so only one of those can be used in this situation - it is the product, so if you get 404, this can mean that the product ID 2 does not exist.
So, first I am not the developer of this system, so maybe this question should be not answered by be but if you want that your system really understand all requests, you just need such system.
This system can understand:
- which ID is category ID
- which ID is product ID
and
- build tree of categories
There are even more issues, which must be solved when requesting page. E.g. what happens when the alias of subcategory includes ID, like:
mysite.com/1-category-two/3subcategory
In such case the system ist not able to understand if you ask for subcategory or product, because it tries to parste two numbers in url and return category as first and product as second.
Why the system is dependent on numbers? Because integer (number) can be very quickly processed. In Joomla! 4, there will be new router where you can skip using numbers but of course this will take more resources and even such router can have many issues.
If the urls don't fit your needs, you can disable the SEF or write own specific rules in components\com_phocacart\router.php but be always aware, there are thousands of possible combinations which can somehow break the requests, so it is necessary to work with caution)