Most of what you say is correct and your technical analysis is good. The addition to category_id check is a correct suggestion.
But I never meant to change the way VM produces is pathway. I started from a much simpler request: remove VM appended pathway whenever i manually create a menu item directly related to a specific product or category.
Example.
I have a shop which has a "BIKES" category and a "THUNDER" product. This is my menu:
HOME
SHOP (menu type: VirtueMart, no parameters)
I'll click on shop, pathway is Home -> Shop
I see categories listing, i click on BIKES, patwhay is Home -> Shop -> Bikes
I see product listing, i click on THUNDER, patwhay is Home -> Shop -> Bikes -> Thunder
Now i create another couple menu items, and my menu becomes:
HOME
SHOP (menu type: VirtueMart, no parameters)
BIKES (menu type: VirtueMart, category_id = 4)
THUNDER (menu type: VirtueMart, product_id = 12)
With VM 1.1.5:
- if i click on BIKES menu item, pathway is Home -> Shop -> Bikes -> Bikes
- if i click on THUNDER menu item, pathway is Home -> Shop -> Thunder -> Bikes -> Thunder
This is what i am trying to address, because many people asked to do that. I'll stick with that for 1.1.6, with all aforementioned corrections.