Jump to content

Duplicate products


Jayphen

Recommended Posts

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? :)

Link to comment
Share on other sites

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; ?>&amp;add=<?php echo $results[$i]['cat_id']; ?>" class="txtLink">Add</a>




and replaced it with




<a href="<?php echo $currentPage; ?>&amp;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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...