Home Forums WoodMart support forum Bug enabling option Sticky Product on some products

Bug enabling option Sticky Product on some products

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #611144

    alexclicowski
    Participant

    Hi!

    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.

    #611216

    Hello,

    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

    #611306

    alexclicowski
    Participant

    Hello!

    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.

    #611490

    Hello,

    Now check back your site and check the issue of how it works.

    Best Regards

    #611876

    alexclicowski
    Participant

    What 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.

    #611930

    Bogdan Donovan
    Keymaster

    Hello

    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 at js/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

    #611969

    alexclicowski
    Participant

    Hello!

    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.

    #612063

    Bogdan Donovan
    Keymaster

    You are welcome!

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