Skip Navigation

[Escalated to 2nd Tier] WooCommerce archive view duplicate products and some missing

This support ticket is created 3 years, 7 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 19 replies, has 2 voices.

Last updated by JamesS2731 3 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1776401

Tell us what you are trying to do? Display woocommerce products and allow the client to manually sort the product order and display that in the view. We're using the initiate scroll and I've set the default ordering to Menu order. This works well down to the point where the infinite scroll loads the next products, at which point the ordering misses out some products and then duplicates some others.

Is there any documentation that you are following? Yes, I read a number of articles asking similar questions but none met these requirements.

Is there a similar example that we can see? yes, certainly. You need to be logged in (I'll attach login) but the category that we're using as an example is hidden link

I've cross referenced it with the manual sorting (when sorting is clicked) in the backend and can see that after 24 products (which is the same number as the infinite scroll setting) the order goes awry.

What is the link to your site? hidden link

#1777797

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

Thank you for getting in touch.

Please provide admin access to the site so that I can have a more detailed look at this one for you.

The private fields have been enabled for your next response.

Thanks,
Shane

#1779033

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-09-16 at 10.22.08 AM.png

Hi James,

Thank you for the credentials.

So I was able to see the issue at hand.

The problem is that your Archive is using the woocommerce sorting, now given that the woocommerce sorting isn't integrated in Views you will need to use the views frontend sorting option by clicking the sorting controls button and adding your sort parameters. See Screenshot

Adding these sorting controls will maintain your sort order through the infinite scrolling. You will perhaps need to hide the woocommerce sort option using some css.

Please let me know if this helps.
Thanks,
Shane

#1779325
Screenshot 2020-09-16 at 21.31.35.png

Hi Shane,

Many thanks for getting back to me.

I've added the sorting controls and hidden the default WP sorting box but I'm still getting duplicates. Two that are easy to spot are:

GEAR LEVER SHAFT BUSHING, 2.6L & 3L COLUMN CHANGE CARS.
DISTRIBUTOR CONTACT SET. ALL 2.6 AND 3 L MODELS

I've attached a screenshot of the sorting placement in the search and pagination section. is this correct?

You can see the duplicates at hidden link

I look forward to your thoughts.

Kind Regards
James

#1784395

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

Would you mind if I took a copy of your site for further testing ?

I will be installing the duplicator plugin so that I can copy it to my localhost this way I can check it better in a more controlled environment.

Please let me know if this is ok.

Thanks,
Shane

#1784725

Hi Shane,

Yes, please do. That would be great.

I look forward to any thoughts or ideas you might have.

Kind regards
James

#1786155

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

I managed to perform an update of the views plugin to our latest version on the test site and the issue is no longer there.

You can go to the link below to update your views plugin and let me know if the issue still remains on your end.
https://toolset.com/account/downloads/#legacy-plugins

Thanks,
Shane

#1786159

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

I've checked again and it seem the issue is still there with the duplicate products but I still advise that you update to the latest versions of our Toolset plugins while I continue to investigate.

#1788211

Hi Shane,

Many thanks for your continued support on this.

I'll update the Views module and look forward to any more thoughts or ideas you might have.

Kind regards
James

#1790701

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

Currently we are experiencing a high volume of tickets in our forum since some of or supporters are on vacation.

I'll provide an update on this issue as soon as I can.

Thanks,
Shane

#1791493

Hi Shane, no problem at all. I look forward too hearing from you in due course.

Have a great weekend.

Kind regards
James

#1794045

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

I have a bit of an update for you here.

So after running some tests, disabling your plugins on the local copy as well as switching your theme to a default one. I found that the issue still remained.

This led me to believe that something was wrong with the archive itself. The next thing I did was to disable your current archive by de-selecting the Product and Product Categories option from the Loop Selection and remade the entire archive in its basic form.

Once I did this the archive stopped displaying with duplicate items. So what you can do now is to do the same on your end.

Remove your current archive from displaying for Product and Product Categories, then create a completely new archive for them.

Please let me know if the same result is reflected on your end.

Thanks,
Shane

#1794377

Hi Shane,

Many thanks for this. I've created a new archive and the issue looked fixed. I then copied over the code for the original to see if the archive itself was corrupted or if the code was the issue.

Looks like it was the code as I'm still seeing the duplicates so now we know it's that, I'll play around with it and see which part is affecting things.

I'll let you know once I've found the culprit.

Thank you again for all of your help with this.

Kind Regards
James

#1794467

Hi Shane,

I spoke too soon. Apologies, but the issue is still arising with a fresh archive and fresh code. I created a simple archive and added the fields but can still se the issue - hidden link

Just to double check, the new archive should 'Display all the items' rather than 'Display the items using a custom search' shouldn't it?

Here's the code for the new archive:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-md-4">[wpv-post-body view_template="loop-item-in-products-archive-3"]</div>
[wpv-item index=other]
<div class="col-md-4">[wpv-post-body view_template="loop-item-in-products-archive-3"]</div>
[wpv-item index=3]
<div class="col-md-4">[wpv-post-body view_template="loop-item-in-products-archive-3"]</div>
</div>
[wpv-item index=pad]
<div class="col-md-4"></div>
[wpv-item index=pad-last]
<div class="col-md-4"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

and the loop item is simply:

[wpv-woo-product-image]
[wpv-post-title]
[wpv-woo-product-price]

Sorry!

Kind regards
James

#1794489

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi James,

I created the one on my end with the setting "Display all the items".

Perhaps what I can do is to replicate what I did on my end to your site and see what happens there.

Let me know if you're ok with this.
Thanks,
Shane