Home Forums WoodMart support forum How to off lazy load on checkout page?

How to off lazy load on checkout page?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #320205

    fineorganics
    Participant

    Як уникнути цього зміщення через ледаче навантаження? Можливо, додати атрибут до зображення у php? https://www.awesomescreenshot.com/video/5325663

    #320218

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_disable_lazy_on_page() {
        $current_page_id = get_queried_object_id();
        if ( ! $current_page_id ) {
            $current_page_id = get_the_ID();
        }
        $pages = [
            107, 108,
        ];
        if ( in_array( $current_page_id, $pages ) ) {
            woodmart_lazy_loading_deinit( true );
        }
    }
    add_action( 'wp', 'woodmart_disable_lazy_on_page', 1000 );

    In the above code, you need to replace the values under the "$page" array with the pages ids.

    Regards.
    Xtemos Studios.

    #320225

    fineorganics
    Participant

    Thanks.
    I added but it not work. Check please

    #320239

    Hello,

    Actually, we have Theme Settings presets functionality. And this allows you to disable any option on any page. So the code is no longer required.

    I have added the preset in Theme Settings with Checkout page Preset and disable the Lazy load option only for the Checkout page.

    You can read more about preset here in the theme documentation:
    https://xtemos.com/docs/woodmart/theme-settings-presets/

    Best Regards.

    #320240

    fineorganics
    Participant

    Now lazy loading don’t work on all site on mobile version. Check one more time please

    #320268

    fineorganics
    Participant

    I want to off lazy loading only on checkout page and not everywhere

    #320292

    Artem Temos
    Keymaster

    Try to add the following code snippet to the Custom JS area in Theme Settings to fix this issue.

    jQuery(document).on('updated_checkout', function() {
    	jQuery(document).trigger('wood-images-loaded');
    });
Viewing 7 posts - 1 through 7 (of 7 total)