Skip Navigation

Sibling WooCommerce products cannot be shown when using a Content Template in a layout assigned to a single product

Open

Reported for: Toolset Views 2.6.3

Symptoms

There is an issue with displaying sibling WooCommerce products when using a Content Template inside a layout assigned to a single Product.

This happens when the following conditions are met on your site:

  • You have a post type connected to WooCommerce in a relationship where that post type is the parent in this relationship (products are child posts).
  • You connected several Products to a post.
  • You have a View that displays Products, with a Query filter set to “Select posts in a Toolset Post Types Products relationship that are related to the current post in the loop”.
  • You have a Content Template (not assigned anywhere) and the above-created View is inserted to it.
  • You inserted the Content Template into a layout through a visual editor cell using a shortcode similar to the following:
    [wpv-post-body view_template="context-template-products" item="@toolset-post-type-product.parent"]
  • You assign this layout to display single Product posts.

When you check a product on the front-end, you will not see the sibling posts.

Workaround

This is already reported to our development team and they already fixed it in Views 2.7.3

For now, to fix the issue, you need to pass suppress_filters="true" shortcode attribute to the Content Template shortcode when you insert it into the layout.

The whole shortcode should look similar to the following one:

[wpv-post-body view_template="context-template-products" item="@toolset-post-type-product.parent" suppress_filters="true"]

Leave
a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>