- This topic has 11 replies, 3 voices, and was last updated 1 year, 10 months ago by Tom.
August 29, 2019 at 6:10 am #996239Katja
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.
RogerAugust 29, 2019 at 6:31 am #996247DavidStaffCustomer SupportAugust 29, 2019 at 6:47 am #996255Katja
yes, that’s correct. That is now the current state on the server URL provided.August 29, 2019 at 6:52 am #996259DavidStaffCustomer 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?August 29, 2019 at 7:06 am #996266Katja
“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.August 29, 2019 at 7:34 am #996285DavidStaffCustomer SupportAugust 29, 2019 at 7:46 am #996297Katja
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.August 29, 2019 at 8:02 am #996419DavidStaffCustomer SupportAugust 29, 2019 at 11:13 am #996606Katja
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.August 29, 2019 at 11:22 am #996608DavidStaffCustomer SupportAugust 29, 2019 at 11:46 am #996626Katja
Yes, it does. But then it changes the number of columns on product listing pages. Getting closer?August 29, 2019 at 8:08 pm #996830TomLead DeveloperLead 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
columnsattribute 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?
- You must be logged in to reply to this topic.