-
AuthorPosts
-
February 28, 2018 at 1:01 pm #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?
March 1, 2018 at 9:03 pm #919886Hey jonnyckk,
Asked out team members to take a look, so we can be able to define the issue and proceed.
Best regards,
BasilisMarch 5, 2018 at 1:07 pm #921459Has any progress been made on this?
March 6, 2018 at 12:22 am #921943Hi,
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,
VinayMarch 6, 2018 at 12:10 pm #922185That’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.
March 7, 2018 at 6:48 am #922749Hi,
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,
IsmaelMarch 7, 2018 at 1:21 pm #922966Thanks 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.
March 9, 2018 at 2:33 am #924218Hi,
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,
IsmaelMarch 9, 2018 at 12:09 pm #924436I think I added it in the right place. Possibly not though. Attached login details.
March 14, 2018 at 7:28 am #926447Hi,
Thank you for the update. It is also asking for the htaccess authentication. Please include it in the private field.
Best regards,
IsmaelMarch 14, 2018 at 12:26 pm #926562Oh, okay.
March 15, 2018 at 9:05 am #927141Hi,
Please check private message
Best regards,
VinayMarch 15, 2018 at 12:19 pm #927237Authentication details here.
March 16, 2018 at 6:27 am #927942Hi,
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,
IsmaelMarch 16, 2018 at 11:31 am #928039I’ve upgraded WordPress to the latest version.
March 19, 2018 at 5:13 am #928862Hi,
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,
IsmaelMarch 20, 2018 at 11:42 am #929747Thanks for that.
How was the issue fixed, because we have the same issue happening on other sites too?
March 21, 2018 at 5:25 am #930273Hi,
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,
IsmaelMarch 26, 2018 at 10:41 am #932930Thank you. Will this be included in a theme update?
March 27, 2018 at 3:45 am #933307Hi,
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,
IsmaelMarch 20, 2019 at 9:52 pm #1081048Hi 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,
NickMarch 25, 2019 at 2:30 am #1082458 -
AuthorPosts
- The topic ‘Cart icon not working correctly on android’ is closed to new replies.