Product file alias tokens from product display
I'm running into an SEO optimization issue here, because of the "Product display" <-> "Commerce product" logic.
My product display has two taxonomy fields; category and type.
And of course several refenreced products (variations)
To improve SEO I'm using file aliasing for my product images which is a vital boost. And the idea is to have a path like [category]/[type]/[title].[ext]
But as product images are in the Commerce product type, and the taxonomy fields in the Display content type, I obviously don't have access to the display's taxonomy tokens from the product images.
Which means I can't SEO optimize files with Drupal Commerce!!
Unless a hook can be used. But still, the issue would be, how to know which display to load, knowing several displays could point to the same product...
It wouldn't be a problem in my case (yet)
And repeating taxonomy fields for each product is not an option.
This is really frustrating and limitating. Any idea how to solve it?