-- HikaShop version -- : Business: 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.0
-- Browser(s) name and version -- : Chrome 65.0.3325.181
-- Error-message(debug-mod must be tuned on) -- : none
Hello
We use Hikashop for our clients site and we load category modules in an overlay via ajax when user clicks on a main menu item.
This works fine on the desktop version of the site and originally worked well in the iOS (tablet) version of the site until recently updating Hikashop.
The code we use for this is:
//Overlay categories Script (AJAX)
function loadContent(target, myurl, selector) {
jQuery(target).fadeOut('fast', function() {
showLoader();
jQuery.ajax({
url: myurl,
success: function(data,status,jqXHR) {
jQuery(target).html(jQuery(data).find(selector).addBack(selector).children())
.fadeIn('fast', hideLoader());
}
});
});
}
//Get URL and use loadContent to populate overlay
jQuery('a').on('click', function() {
if (jQuery(this).hasClass("overlay")) {
if (jQuery(this).hasClass("accordeonck")) {
} else {
jQuery('#overlay').append('<div id="ovcontent"></div>');
jQuery('header').fadeOut('normal');
jQuery('#overlay').fadeIn(900);
jQuery('#closeova').fadeIn(900);
jQuery('#ovcontent').fadeOut('fast',loadContent);
jQuery('#load').remove();
var myURL = jQuery(this).attr('href');
console.log(myURL);
loadContent( '#ovcontent', myURL, '#contentarea' );
jQuery('html,body').animate({scrollTop:0},900);
return false;
}
}
});
function showLoader() {
jQuery('#load').remove();
jQuery('#ovcontent').append('<span style="color:#fff;" id="load">LOADING...</span>').fadeIn('normal');
}
function hideLoader() {
jQuery('#load').fadeOut('normal');
}
jQuery('#closeova').click(function(){
jQuery('#overlay').fadeOut(900);
jQuery('#ovcontent').remove();
jQuery('header').fadeIn('normal');
});
Currently we are hiding this code from iOS using a PHP if HTTP_USER_AGENT statement as when it runs in iOS it just shows a blank page with no errors in console( the modules do not seem load) however loading any other content this way ( content page or other module) it works fine...e.g. see the privacy policy.
Interestingly If I hardcode a url in place of the myURL variable here it loads the modules ok in iOS: loadContent( '#ovcontent', myURL, '#contentarea' );
But logging myURL to console shows the same result!!?
Just hoping someone could shed some light as to why this stopped working after recent updates to hikashop and if there is a fix for it?
Really hoping I can get someone to take a look as I have tried everything I can think of.