We have an online tyre store with tyres as products and car models as categories. Since tyres can fit multiple cars, each tyre is mapped to all the car models where there is a fit.
However, each car model has certain original equipment tyres (those that come fitted from the factory on brand new cars). We would like to highlight such tyres on the listing page for the car model with a ribbon-style icon. The important point is that although a tyre can fit many car models, it may not be original fit for all of them (in practice it will be an original fit for only a few of them).
The strategy we have thought is to display all original fit tyres at the beginning on the listing pages by assigning them display positions less than 100. All other tyres, which also fit the car model but are not original fit are assigned display positions greater than 100. Therefore, simply being able to get the product position configured in the admin on the listing page would be sufficient to display an icon by checking if the position is less than 100.
I haven't been able to figure out how to get the product position on the listing page. The important part is that I should be able to read the position even if the user sorts by something other than the position, such as, name, price, etc.
ul.first li.first
). But indeed it will mix up if your customer resorts the category. A better approach would be to give your product an custom attribute with comma-separated lists of category IDs to "shine" on. In your template file you canexplode
the list and check if one of its items matches the viewed category. The rest is CSS. Got it or need further help?