Map doesn't working in mobile version

This topic contains 11 replies, has 4 voices, and was last updated by  Alfonso Sánchez Gómez 4 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #534097

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67

    In mobile version the location of listings is not working.
    In desktop its ok.

    Url example: https://alefood.com/restaurantes/madrid/madrid/scorpion/

    Click in “Ubicación” tab and you could test it.

    #534098

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67
    This reply has been marked as private.
    #534101

    Kor
    Moderator
    Post count: 16516

    Hi Alfonso,

    Thanks for your post. Sorry, I can’t see the tab “Ubicación” on this page https://alefood.com/restaurantes/madrid/madrid/scorpion/ . Could you share some screenshots?

    #534344

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67

    Here you have

    #534515

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #534659

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67
    This reply has been marked as private.
    #534660

    Kor
    Moderator
    Post count: 16516
    This reply has been marked as private.
    #534664

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67

    In desktop version yes, but I opened the ticket because it doesn’t work in mobile version. It still doesn’t work.
    Please read title of post.

    #534756

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks for sharing FTP, the developers will take a look.

    #534878

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Alfonso,

    The issue occuring due to map being loaded twice on page.
    I will check further and get back to you with a solution.

    Thanks

    #535085

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Alfonso,

    as I said, it was caused due to desktop layout HTML is also loaded in the mobile view, although it is hidden.
    it creates the js issue for the map.

    I have added following snippet on your site
    https://alefood.com/wp-admin/admin.php?page=edit-snippet&id=6&result=updated

    
    add_action( 'wp_head', function () { 
        if ( wp_is_mobile() ) { ?>
            <script>
                jQuery(document).ready(function(){
    				console.log('mobile here');
                    jQuery('.desktop_tab_container').remove();
                });
            </script>
        <?php } else{ ?>
            <script>
                jQuery(document).ready(function(){
                    jQuery('.mobile_tab_container').remove();
                });
            </script>
        <?php }
    });

    Please have a look on the mobile device now.

    Regards
    Naveen

    #535086

    Alfonso Sánchez Gómez
    Expired Member
    Post count: 67

    Perfect, it´s working. Thanks.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket