• Resolved lecoqroach

    (@lecoqroach)


    WooCommerce offers the shortcode [products] and I seem to have a problem with that. The docs say that for the attribute visibility there are:
    -visible (visibile on shop and search results)
    -catalog (visible on the shop only, but not search)
    -search (visible in search results only, but not on the shop)
    and more which are not important for the problem.

    Now I assumed that if I use the shortcode for example in a search results page, I would think I should use visibility=’search’. So here is the problem. All my products, that should result in search have either ‘visible in shop and search’ or ‘visible in search’.

    Now the products shortcode setting visibility=’search’ seems to be only displaying products with ‘visible in search’ but not the products with ‘visible in shop and search’. In my understanding this is a logical mistake because the shortcode should not exclude but include. If the product has the setting SEARCH & SHOP than if the shortcode asks for SEARCH it should display all product that have SEARCH no matter what else. That would be logic.

    Still, if it would be as I think, if somebody really wanted to show only products with the setting SEARCH that again would not be possible.

    As not every case is producible with this shortcode, I thought I could simply add a comma like visibility=”search,visible” but this does not seem to be implemented.

    I hope you understand my problem and maybe have a solution for me.

Viewing 1 replies (of 1 total)
  • Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    @lecoqroach,

    You answered your own question in the first few lines.

    • visible = visibile on shop and search results
    • search = visible in search results only, but not on the shop

    If you want to show all the products that are visible both on the shop page and in the search results, which one of these do you think you should be using?

    The logic is already clearly explained in the descriptions next to each one. Nowhere in the documentation does it say that you can chain the values together with a comma and it wouldn’t make any sense to attempt it.

    It is all clearly documented so that you don’t have to assume. In case you need to look at the documentation again, it is over here – https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-6.

    I’m going to mark this as resolved.

Viewing 1 replies (of 1 total)
  • The topic ‘shortcode [products] visibility issue – bug?’ is closed to new replies.