Home Forums WoodMart support forum Woodmart + Relevanssi causes 3rd party plugin compatibility issue

Woodmart + Relevanssi causes 3rd party plugin compatibility issue

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #322972

    Frozen
    Participant

    We are having an issue when we use Relevanssi along with a plugin called Show Single Variations from iconicwp.

    I have been in contact with them, and they have narrowed the issue down to how the theme shows the search results when the product_variation post type is included in the main WP_Query.

    Their plugin adds ‘product_variation’ as a post_type argument along with ‘product’ in the main WP_Query so that the variations would also appear in the loop.

    What happens is then the search results are shown on a posts page with a right hand side bar, rather than the normal products results pages.

    Checking query monitor shows that it still loads archive-product.php template but something in the theme internally changes the sidebar template in the presence of product_variation post type.

    Any ideas on what might be causing such behavior.

    Thanks

    Attachments:
    You must be logged in to view attached files.
    #322985

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a link to your website where we can see this issue? Also, send us a screenshot of how it works with the default WordPress theme so we can see the difference?

    Kind Regards

    #322998

    Frozen
    Participant

    Link to website attached

    #323000

    Artem Temos
    Keymaster

    Please, send us your FTP access as well.

    #323008

    Frozen
    Participant

    SFTP details attached

    #323099

    Artem Temos
    Keymaster

    Try to edit the file woodmart/inc/classes/Layout.php and replace the following line

    if( woodmart_woocommerce_installed() && ( is_product_taxonomy() || is_shop() || is_product_category() || is_product_tag() || woodmart_is_product_attribute_archive() ) ) {

    with this one

    if ( woodmart_woocommerce_installed() && ( is_product_taxonomy() || is_shop() || is_product_category() || is_product_tag() || woodmart_is_product_attribute_archive() || ( is_search() && isset( $_GET['post_type'] ) && 'product' === $_GET['post_type'] ) ) ) {

    #323115

    Frozen
    Participant

    Thanks, that worked, and the correct sidebar is now showing, but it’s on the right rather than the left.

    Any way to put it back on the left and side of the page?

    #323163

    Artem Temos
    Keymaster

    Sorry, you need to replace the following one as well

    if( woodmart_woocommerce_installed() && ( is_shop() || is_product_category() || is_product_tag() || woodmart_is_product_attribute_archive() ) ) {

    with

    if ( woodmart_woocommerce_installed() && ( is_shop() || is_product_category() || is_product_tag() || woodmart_is_product_attribute_archive() || ( is_search() && isset( $_GET['post_type'] ) && 'product' === $_GET['post_type'] ) ) ) {

    #323184

    Frozen
    Participant

    Thanks that’s great. This fixed the issue.

    In total there were three places where this change needed to be made.

    Is this change likely to make it into the next update to Woodmart, or would I need to place this in my child theme?

    Thanks again!

    #323189

    Artem Temos
    Keymaster

    Yes, we will review this code and consider adding to our next theme update.

    #331891

    Frozen
    Participant

    Hi,

    Sorry for digging this up again, but i have discovered another issue affecting search for guest/non logged in users.

    When not logged in, viewing the search page does not show any results. However when logged in, the search functions just fine.

    Switching to the storefront theme resolves the issue, so i’m assuming that its Woodmart related.

    Any ideas why this might be?

    Thanks,

    James

    #331922

    Artem Temos
    Keymaster

    Hello,

    Please, disable all external plugins temporarily so we can check what is wrong.

    Kind Regards

    #331968

    Frozen
    Participant

    It’s the same issue as before, if I disable either WooCommerce Show Single Variations or Relevanssi, or Wholesale Prices Premium the search as a guest works.

    When all are enabled, the search results are only shown when logged in.

    All other plugins have been disabled

    #331984

    Artem Temos
    Keymaster

    Please, turn off all external plugins temporarily including cache and optimization ones.

    #331992

    Frozen
    Participant

    OK, all plugins have been disabled.

    #331994

    Artem Temos
    Keymaster

    As we can see, cache is still enabled https://gyazo.com/fcd562258cea651bf826a07373e4e60e

    #332009

    Frozen
    Participant

    That appears regardless. Both OP Cache, and Object-Cache are disabled. If you log into the dashboard you’ll see.

    https://i.imgur.com/GnFIF7G.png

    #332010

    Artem Temos
    Keymaster

    Could you please enable those plugins that cause this issue and check the same search link with a default WordPress theme?

    #332013

    Frozen
    Participant

    Done. The Following plugins have been enabled.

    https://i.imgur.com/UnLkua9.png

    StoreFront Theme has been activated.

    Issue does not exist

    https://i.imgur.com/xUBKCCt.png

    Thanks

    #332156

    Artem Temos
    Keymaster

    Please, provide us with your current FTP access so we can check it.

    #332187

    Frozen
    Participant

    SFTP details attached.

    #332271

    Artem Temos
    Keymaster

    This plugin has a specific PHP code for the WoodMart theme. And if we remove the code from the plugin it starts working correctly. You need to contact plugin developers for help on this matter.
    You can try to remove this code yourself in the file wp-content/plugins/show-single-variations-premium/inc/class-compat-woodmart.php

Viewing 22 posts - 1 through 22 (of 22 total)