Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #919010

    Hi,

    We’re having a problem with the cart icon in the menu on Android mobile devices. When you tap on it, it flashes up what’s in the cart like it should do but that disappears very quickly and then you are taken to the cart page. On iOS it works correctly, you see what’s in the cart and you have to tap it again, or tap on one of the buttons that appear, to go the cart.

    Any idea how to fix this?

    #919886

    Hey jonnyckk,

    Asked out team members to take a look, so we can be able to define the issue and proceed.

    Best regards,
    Basilis

    #921459

    Has any progress been made on this?

    #921943

    Hi,

    The mobile device does not support hover hence the items show only when the cart icon is tapped.
    The cart icon is working as intended same as on our demo site.

    Best regards,
    Vinay

    #922185

    That’s not what I meant. When you tap on the cart icon on Android mobiles (not hover, as this doesn’t exist on mobile) it goes to the cart page after showing what is in the cart for only a split second. Only the one tap is occurring.

    #922749

    Hi,

    Thank you for the update.

    Please edit the config-woocommerce > woocommerce-mod.js file, look for the “cart_dropdown_improvement” function around line 316. Replace it with this code.

    $.avia_utilities = $.avia_utilities || {};
    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement)
    {
    	$.avia_utilities.isMobile =  true;
    }
    else
    {
    	$.avia_utilities.isMobile =  false;
    }
    
    //small function that improves shoping cart hover behaviour in the menu
    function cart_dropdown_improvement()
    {
    	var dropdown = jQuery('.cart_dropdown'), subelement = dropdown.find('.dropdown_widget'), isMobile = $.avia_utilities.isMobile;
    
    	subelement.css({display:'none', opacity:0});
    
    	dropdown.click( function(event) {
    		if(isMobile && subelement.css('opacity') != 1) {
    			event.preventDefault();	
    		} else {
    			window.location.href = $(this).find('.cart_dropdown_link').attr('href');
    		}
    	});
    
    	dropdown.hover(
    		function(event){  subelement.css({display:'block'}).stop().animate({opacity:1}); },
    		function(event){  subelement.stop().animate({opacity:0}, function(){ subelement.css({display:'none'}); }); }
    	);
    }

    Don’t forget to remove the browser cache before checking the page. Disable the cache and minification plugins temporarily if there’s any.

    Best regards,
    Ismael

    #922966

    Thanks for that.

    Still problems though. Now there is no number appearing beside the cart to tell users how many items have appeared in the cart, and nothing appears to show anything has been added to the cart.

    #924218

    Hi,

    Are you sure that you edited the correct lines of codes? The modification above should not affect the cart counter. Please provide the login details in the private field so that we can test it.

    Best regards,
    Ismael

    #924436

    I think I added it in the right place. Possibly not though. Attached login details.

    #926447

    Hi,

    Thank you for the update. It is also asking for the htaccess authentication. Please include it in the private field.

    Best regards,
    Ismael

    #926562

    Oh, okay.

    #927141

    Hi,

    Please check private message

    Best regards,
    Vinay

    #927237

    Authentication details here.

    #927942

    Hi,

    Thank you for the info. I was expecting that the site is already running on WP 4.9.4 and we’ll be able to edit the files via the Appearance > Editor panel but it’s not. Please upgrade WordPress to the latest version |OR| post the FTP details in the private field so that we can edit the js files.

    Best regards,
    Ismael

    #928039

    I’ve upgraded WordPress to the latest version.

    #928862

    Hi,

    Thank you for the update. We edited the script and it seems to be working properly on a browser device emulation. Please resave the theme options, remove browser cache then do a hard refresh before checking the page.

    Best regards,
    Ismael

    #929747

    Thanks for that.

    How was the issue fixed, because we have the same issue happening on other sites too?

    #930273

    Hi,

    You can find the modification in the config-woocommerce > wooocommerce-mod.js file.

    $.avia_utilities = $.avia_utilities || {};
    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement)
    {
    	$.avia_utilities.isMobile =  true;
    }
    else
    {
    	$.avia_utilities.isMobile =  false;
    }
    
    //small function that improves shoping cart hover behaviour in the menu
    function cart_dropdown_improvement()
    {
    	var dropdown = jQuery('.cart_dropdown'), subelement = dropdown.find('.dropdown_widget'), isMobile = $.avia_utilities.isMobile;
    
    	subelement.css({display:'none', opacity:0});
    
    	dropdown.on( 'click', function(event) {
    		if(isMobile && subelement.is(':animated')) {
    			event.preventDefault();	
    		} else {
    			window.location.href = $(this).find('.cart_dropdown_link').attr('href');
    		}
    	});
    
    	dropdown.hover(
    		function(event){  subelement.css({display:'block'}).stop().animate({opacity:1}); },
    		function(event){  subelement.stop().animate({opacity:0}, function(){ subelement.css({display:'none'}); }); }
    	);
    }
    

    Best regards,
    Ismael

    #932930

    Thank you. Will this be included in a theme update?

    #933307

    Hi,

    We don’t encounter a lot of reports about this particular issue so it’s probably unique in your installation. Please feel free to request for the feature on Enfold feature request form or vote for it if its already requested.

    Best regards,
    Ismael

    #1081048

    Hi Ismael,

    I am facing the same issue…
    When you tap on the floating cart icon, it flashes up the products in the cart like it should do but that disappears very quickly and then you are taken to the cart page. The right behaviour would be, you tap on the cart icon, you see what’s in the cart and then you have to tap it again, or tap on one of the buttons that appear, to go to the cart.
    I tried your solution above but I am facing some side effects as: the header doesn’t shrink anymore, when I scroll down and the cart quantity buttons have been disappeared. :(

    I am looking forward to your news.

    Best regards,
    Nick

    #1082458

    Hi,

    The header is not supposed to shrink on mobile devices and the cart icon should stay at the top of the page because the header is not fixed or sticky. Please create a new thread if you have another inquiry.

    Best regards,
    Ismael

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Cart icon not working correctly on android’ is closed to new replies.