[Support request] Bug in display of WooCommerce product shortcode when using Social Warfare Pro

Home Forums Support Bug in display of WooCommerce product shortcode when using Social Warfare Pro

  • This topic has 11 replies, 3 voices, and was last updated 1 year ago by Tom.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #996239
    Katja

    Hello Tom and Team,

    I’ve recently come across what seems to be a bug in GP Premium. It involves the wrong display of WooCommerce shortcodes when certain settings from the Social Warfare are enabled. I’ve been in contact with both support teams from Social Warfare and WooCommerce and with all plugins disabled apart from WooCommerce and Social Warfare the problem disappears. Once GP Premium is re-enabled (and everything else remains disabled, except Woo and SW) the problem re-appears.

    I’ve got all this set up on a staging server and will gladly let you have log in details, if you can supply a means of sharing them that is not public. The staging site looks odd right now as other plugins are disabled. It’s the issue below that is of concern.

    So, to the issue. On our home page we have used the WooCommerce [product] shortcode to display our four featured products, as follows:
    [products limit=”4″ columns=”4″ orderby=”menu_order” visibility=”featured” ]

    Without the Social Warfare plugin being activated this displays as we expect, i.e. a single row of four columns with our four featured products. This is also the case when we have the free version of the Social Warfare plugin installed. There is a columns-4 class applied both to a div tag and an ul tag.

    However, as soon as the Social Warfare Pro plugin is activated and two particular settings to enable the Pinterest pinning of images are set, the div and ul tags have a column-3 class applied. This results in oversized images displayed in two rows, the first having three products and the second a single product.

    The two settings in question are the ‘Image Hover Pin Button’ to ON, on the display tab and the ‘Add a data-pin-description to images that do not have one’ to ON in the Advanced tab.

    I hope that you will be able to help provide a solution as we would like to use the full functionality that Social Warfare provides regarding the pinning of images in Pinterest. In the meantime, our live site is using the remaining functionality without further issues.

    Many thanks for your help.

    Best wishes,

    Roger

    #996247
    David
    Staff
    Customer Support

    Hi there,

    just to clarify. If you deactivate Social Warfare then the Woo Shortcodes display the correct number of columns whilst using GP Premium?

    #996255
    Katja

    Hello David,

    yes, that’s correct. That is now the current state on the server URL provided.

    #996259
    David
    Staff
    Customer Support

    GPP uses the standard Woocommerce Templates and Functions. It won’t overwrite any settings you apply in a shortcode or modify the templates. So Social Warfare must be changing that behaviour which seems very peculiar – what feedback did SW provide?

    #996266
    Katja

    Social Warfare:

    “Our plugin does not use any WooCommerce hooks. Social Warfare also does not adjust the style of a page, except for the share buttons.

    Therefore, I can not explain why using your [[[products]]] shortcode is being displayed differently when Pro is active compared to when it is not.
    I did notice that it is the size of each image that is changing – the size is growing when Pro is activated, which forces the fourth product to the next row.

    My suggestions is for you to write to the makers of this shortcode (perhaps it is WooCommerce themselves) and explain that the output is changing, and see if they have an idea as to what is the cause.”

    If I have only SW (with the settings in question)and GPP activated the problem appears. If I deactivate GPP then the problem disappears, despite SW still being activated. This would seem to suggest there is some interaction going on.

    #996285
    David
    Staff
    Customer Support

    How are you adding the SW shortcode to the page? Is it via a GP Hook?

    #996297
    Katja

    Yes, I’m adding the SW shortcode to the bottom of the page directly, no hook involved. Not on my computer right now, but can try and take the shortcode out and see if the issue remains as soon as I’m back in the office. Let me know.

    #996419
    David
    Staff
    Customer Support

    If you can reactivate SW so it breaks the columns – i can take another look.

    #996606
    Katja

    Okay, I tried the taking the manually placed shortcode out of the homepage and it makes no difference to the issue.

    I now have both the SW plugins activated and the GPP too. The problem can now be seen, three columns instead of the four.

    #996608
    David
    Staff
    Customer Support

    Can you go into Customizer > Layout > Woocommerce and set the columns to 4 – let me know if this changes the shortcode columns.

    #996626
    Katja

    Yes, it does. But then it changes the number of columns on product listing pages. Getting closer?

    #996830
    Tom
    Lead Developer
    Lead Developer

    That option in GPP uses this core WooCommerce filter to change the number of columns: https://docs.woocommerce.com/document/change-number-of-products-per-row/

    I just took a look at the code that outputs the WooCommerce shortcodes and found this: https://github.com/woocommerce/woocommerce/blob/da00ef76cc3771f5ec9f4c2339ff5a8ce5be9788/includes/shortcodes/class-wc-shortcode-products.php#L139-L141

    That means if the columns attribute you added to your shortcode isn’t a number, it will fall back to the filter we use.

    I wonder if Social Warfare is doing something to make it so that value isn’t a number? Maybe a filter they’re using that targets shortcodes?

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