Home › Forums › WoodMart support forum › Bug enabling option Sticky Product on some products
Bug enabling option Sticky Product on some products
- This topic has 7 replies, 3 voices, and was last updated 12 hours, 17 minutes ago by Bogdan Donovan.
-
AuthorPosts
-
November 10, 2024 at 11:48 pm #611144
alexclicowskiParticipantHi!
I have found an error when enabling the option Sticky Product:
Theme Settings > Single Product > Sticky Product
For some products it works, but for others it doesn’t.
For those that don’t work, it starts working if you open the developer options by selecting Inspect (right click > Inspect) on the product image.
You can see it in the link to the video that he left us privately.
I have installed the theme from scratch with only the necessary plugins and a prebuilt website without modifications. You can activate or deactivate any plugin and make the necessary changes because it is just a demo on a test subdomain.
Regards,
Alex.November 11, 2024 at 11:54 am #611216
Aizaz Imtiaz AwanKeymasterHello,
If you turn on this option, the section with description will be sticky when you scroll the page. In case when the description is higher than images, the images section will be fixed instead.
Best Regards
November 11, 2024 at 3:30 pm #611306
alexclicowskiParticipantHello!
I know how it works perfectly, that’s why I say it doesn’t work. Have you seen the 1 minute video I sent privately?
We start again.
Here is a product where it doesn’t work:
https://share.nmblc.cloud/1731326001212-screencast-beta_robotsnation_com-2024_11_11-12_52_50.webm
And here is a product where it does work:
https://share.nmblc.cloud/1731326042557-screencast-beta_robotsnation_com-2024_11_11-12_53_58.webm
I leave the links to the products in the videos privately.
You also have access to the administration area. As I said, it is a clean installation of the theme and you can make any changes you need.
Regards,
Alex.November 12, 2024 at 8:54 am #611490
Aizaz Imtiaz AwanKeymasterHello,
Now check back your site and check the issue of how it works.
Best Regards
November 13, 2024 at 1:49 pm #611876
alexclicowskiParticipantWhat a disastrous support you provide! Is that why I paid for 1 year of support? You’ve been wasting my time for several days.
You have changed the gallery layout of the product to option 4 and that avoids the issue, but it does not solve it. (Single product > Gallery > Gallery layout > four option)
I want to the first option, just as it was:
https://share.nmblc.cloud/1731494654300-screenshot-beta_robotsnation_com-2024_11_13-11_42_15.png
But your change makes the image gallery look like this:
https://share.nmblc.cloud/1731491382711-screencast-beta_robotsnation_com-2024_11_13-10_49_39.webm
And I need this option, and as you can see, it works perfectly in this product, for example. (https://beta.robotsnation.com/producto/iphone-dock/):
https://share.nmblc.cloud/1731491594671-screencast-beta_robotsnation_com-2024_11_13-10_53_12.webm
The problem is that in some products like this it doesn’t work:
https://share.nmblc.cloud/1731491817359-screencast-beta_robotsnation_com-2024_11_13-10_56_54.webm
However, if you open the developer options by selecting Inspect (right click > Inspect) or any other event on the page starts working correctly:
https://share.nmblc.cloud/1731492229612-screencast-beta_robotsnation_com-2024_11_13-11_03_46.webm
Don’t change the theme options settings to avoid the problem, does it fix it, please.
November 13, 2024 at 5:01 pm #611930
Bogdan DonovanKeymasterHello
Apologies for any confusion. I’m responsible for theme development and will do my best to assist you with this issue. The behavior you’ve described on your site is not a bug; it was intentionally designed to disable the sticky product script when the column height difference is less than 100px. This is implemented in the theme code (as shown here: https://monosnap.com/file/yvSUIIxhRRb1NOAmTcMjZSz7fJORhF) to improve performance in cases where the sticky effect isn’t necessary with nearly identical column heights. This approach also avoids minor content “jumps” when the column height difference is minimal, an issue that cannot be fixed except by disabling the script itself.
When you open the DevTools, the sticky products script reinitializes and functions regardless of the column height difference, but it’s worth noting that this behavior won’t affect the average website visitor.
Since these changes were intentional and are not a bug, they will not be addressed in the theme. However, we can provide a modification to reduce this initial threshold from 100px to 10px. To implement this change on your site, find the following code to the
stickyDetails.min.js
file located atjs/scripts/wc/stickyDetails.min.js
in the parent theme and replace it content with the following one:!function(d){woodmartThemeModule.$document.on("wdHeaderBuilderInited",function(){woodmartThemeModule.stickyDetails()}),woodmartThemeModule.stickyDetails=function(){!d(".single-product-page").hasClass("wd-sticky-on")&&!woodmartThemeModule.$body.hasClass("woodmart-product-sticky-on")||woodmartThemeModule.$window.width()<=1024||d(".entry-summary").each(function(){var e=d(this),t=parseInt(woodmart_settings.sticky_product_details_offset),o=e.find(".summary-inner"),i=e.parent().find(".woocommerce-product-gallery");o.trigger("sticky_kit:detach"),i.trigger("sticky_kit:detach"),i.imagesLoaded(function(){(o.outerHeight()<i.outerHeight()?o:i).stick_in_parent({offset_top:t}),woodmartThemeModule.$window.on("resize",woodmartThemeModule.debounce(function(){woodmartThemeModule.$window.width()<=1024?(o.trigger("sticky_kit:detach"),i.trigger("sticky_kit:detach")):(o.outerHeight()<i.outerHeight()?o:i).stick_in_parent({offset_top:t})},300))})})},d(document).ready(function(){woodmartThemeModule.stickyDetails()})}(jQuery);
Please note that these changes in the parent theme will be overwritten when the theme is updated, but in order to have more flexibility to solve your issue in the next update, we will add a custom filter that will allow you to adjust this initialization threshold. You can add the following custom code in the
functions.php
file in your child theme to adjust this threshold as needed.add_filter('woodmart_sticky_product_details_different', function () { return 10; });
It’s also worth mentioning that the next update is planned very soon, approximately next week.
Kind Regards
November 13, 2024 at 7:16 pm #611969
alexclicowskiParticipantHello!
Perfect! Thank you very much. Finally someone who understands me.
I will wait fot the next update, so you can add a custom filter that will allow me to adjust this initialization threshold (“woodmart_sticky_product_details_different”).
Don’t forget to add the filter. And again, thank you very much.
Kind Regards,
Alex.November 14, 2024 at 10:07 am #612063
Bogdan DonovanKeymasterYou are welcome!
-
AuthorPosts
- You must be logged in to create new topics. Login / Register