Hello,
When a category is visited, if it only has one product in the category, then I would like to load that product page instead of the category display. I suppose I could easily do this with javascript
But this doesn't seem very efficient. I suppose it's probably not that slow, but I just don't feel like this is the correct way to do this. I would much rather have the redirect loaded server side. I figured I could use the render toolkit command, but I'm not getting far with it. How can I render the product page with a specific product code using the render command?
Any other suggestions that don't involve render from the toolkit or does this seem like the correct choice?
When a category is visited, if it only has one product in the category, then I would like to load that product page instead of the category display. I suppose I could easily do this with javascript
Code:
<mvt:if expr="l.settings:category_product_count EQ 1"> <script type="text/javascript"> window.location.href = "www.storeurl.com/&mvt:category_listing:products[1]:code;.html" </script> <mvt:else> Display category </mvt:if>
Any other suggestions that don't involve render from the toolkit or does this seem like the correct choice?
Comment