Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    @unicco,
    This is strange.

    Is this Ajax Load More instance outside of any other loop?
    And you aren’t using any filter hooks?

    Thread Starter unicco

    (@unicco)

    Hmm. It seems it caused by these two lines: ( Not 100% sure on this just yet. )

    global $wp_query;
    $cat_slug = $wp_query->get_queried_object()->slug;

    I’m using it on the following ALM-shortcode:

    echo do_shortcode( '[ajax_load_more 
    	cache="false"
    	cache_id="category_'. $cat_slug . '_' . $language . '_' . $vat . '_' . $discount . '"
    	id="ordinary" 
    	scroll_distance="-300" 
    	css_classes="products clearfix products-3" 
    	order="DESC" 
    	orderby="date" 
    	post_type="product" 
    	posts_per_page="9" 
    	taxonomy="product_cat" 
    	taxonomy_terms="' . $cat_slug . '" 
    	taxonomy_operator="IN" 
    	transition="fade"
    	transition_container="false"]' );

    Kinda strange, I’ll try retrieving slug some other way.

    • This reply was modified 7 years, 10 months ago by unicco.
    Thread Starter unicco

    (@unicco)

    @dcooney
    Correction. Actually it’s caused by this line:taxonomy_terms="' . $cat_slug . '"
    Tried disable all custom filters and custom jquery. Issue persist.

    Plugin Author Darren Cooney

    (@dcooney)

    Damn, that’s weird. I’m not sure what the issue would be.
    If you hard code house-doctor as the term I assume the issue persists?

    Feels like a query issue, like ALM doesn’t know which query it is running.

    Does it show duplicates on the filter items as well?

    Thread Starter unicco

    (@unicco)

    Yes. Have just tried that – issue persist. And yeah, it (might) be some async error, where each ajax is running multiple instances of itself, and thereby querying the same items multiple times (as it dosen’t wait for the previous query to finish up). It just seems strange, if you havn’t heard about this issue before – which makes me think, it’s related with my setup (plugins, theme etc.).

    You mean, when I’ve filtered the items by multiple parameters? I’ve just disabled this for now (on my test environment), but you can try it out yourself. https://www.ejstruplys.dk/product-category/maerker/house-doctor/

    • This reply was modified 7 years, 10 months ago by unicco.
    Plugin Author Darren Cooney

    (@dcooney)

    I haven’t heard of this issue before, so there is likely something in the theme conflicting.

    Does it display duplicates on all content types? Not just products with taxonomy queries?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Duplicated products on categorypage – how to prevent?’ is closed to new replies.