Jayphen Posted June 20, 2007 Share Posted June 20, 2007 I've had this occur twice now in two different stores I've made for clients. For some reason, if a product is set in a category and then added to other categories, it displays multiple times in those other categories. For example, in the screenshot attached, the product "Horny Little Devil Kit" is in the MAIN category "kits", and has been also added to the "Couples" category. In the couples category, it is duplicating three times, whereas in the main category it only shows once. I had a look in phpmyadmin, and the product has actually been assigned to the "Couples" category 3 times - there are 3 entries in cats.idx for it. Any ideas? :) Quote Link to comment Share on other sites More sharing options...
Jayphen Posted June 21, 2007 Author Share Posted June 21, 2007 I have discovered that this error can be duplicated by opening the 'manage categories' window, and clicking the "ADD" button on a category more than once. Every time you click it, it adds another entry in cats.idx. This is the administrator's fault of course, but it is also bad coding. To prevent administrators from being able to do this in the future, I opened admin/products/extraCats.php and found the following code: <a href="<?php echo $currentPage; ?>&add=<?php echo $results[$i]['cat_id']; ?>" class="txtLink">Add</a> and replaced it with <a href="<?php echo $currentPage; ?>&add=<?php echo $results[$i]['cat_id']; ?>" class="txtLink" onclick="this.style.display='none'">Add</a> This means that the link will disappear as soon as you click it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.