Skip Navigation

[Resolved] Displaying only one item of each

This thread is resolved. Here is a description of the problem and solution.

Problem:
Displaying only one item of each

Solution:
I've made changes to the javascript code user shred and fixed the issue.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/displaying-only-one-item-of-each/#post-923499

Relevant Documentation:

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Matthias Reichl 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#923359

Hi,

we´ve created a view, which displays all products. There are different products twice and more in this view, because they are set to different categories. To avoid displaying the same products twice, you have sent us the following script a while ago;

[code]
jQuery(document).ready(function(){
var strs = [];
var dupes = [];
jQuery('.wpv-loop').find('li > a').each(function(index,item){
var txt = jQuery(item).text(); if( strs.indexOf(txt) > -1 ) {
dupes.push(index);
} else{
strs.push(txt);
}
});
dupes.reverse();
for(var i=0; i<dupes.length; i++) {
jQuery('.wpv-loop').find('li').eq(dupes[i]).remove();
}
});
[/code]

It doesn´t work anymore - we don´t really know, if it was caused by a toolset update or anything else. We´ven´t changed the loop or the script. The loop classes are right.
Please open a private answer for letting you know all details.

Thanks and regards,

#923466

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - Please share problem URL and access details and view name so I can look into it.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#923499

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I'm able to remove the duplicate but I need to know what is your expected output.
=> hidden link

So, I will adjust the content accordingly.

#923549

Hi,

thanks - it seemed that the view was different at live - we could solve it by our own.