We have a magento store and we have over 1000 products listed. We want to assign random related products, but they should be within the category. For example, if a product is listed under Men >> T-shirts category, related products should also be from T-shirt category only. Is there a way to do this using code instead of manually assigning related products?
In the latest version of Magento Enterprise you can use the rule based product assignments to category. You can go to visual Merchandiser and set the rule you want. No code is needed. You will get an option to adjust then assigned products.