Support » Plugin: WooCommerce » Shortcode for random products not working as expected

  • When I limit the products shortcode to 4 products, it repeats only few sets of products, maybe 16, and it never displays the other ones.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rodrigo Primo

    (@rodrigosprimo)

    Hi @forusak,

    The list of products displayed by the [products] shortcode is cached for performance reasons. When orderby=rand is used, a few sets of randomly generated products are cached and then, on each page load, WooCommerce randomly chooses from one of the sets.

    By default, WooCommerce caches six different sets of products. You can use the filter woocommerce_product_query_max_rand_cache_count to change this number.

    Thread Starter Marek Jakubčík

    (@forusak)

    Hi Rodrigo,

    I see, thank you 🙂
    I wonder, how often is this cached cleared? So it shows a different set.

    Thread Starter Marek Jakubčík

    (@forusak)

    @rodrigosprimo hi, can I get the answer for that question above please? thank you 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.