Hi,
I have a big issue with Virtuemart 3 (specifically product details page) on IE9. In my case I'm not able to use the Generic child variant - variants are simply not loading and not able to move between the products using product navigation (top of the product page). It seems that it has something to do with reloading of the productdetails by an ajax call. I'm not a programmer and waiting for a feedback from someone in the know. I know IE9 is a very old one, but people still use it.
https://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0 (https://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0)
Is there any way to fix that?
VM 3.0.6
J! 3.4.0
a link to your page where this is happening perhaps?
Here you go
Link to the page (http://www.testowa2.asik.ogicom.pl/en/product-catalogue-en/portable-sound-systems/battery-powered-speaker-systems/pss-mini-8-detail)
open file http://www.testowa2.asik.ogicom.pl/components/com_virtuemart/assets/js/dynupdate.js
and around line 28 & 79 comment out
console.log("UpdateContent URI "+url);
console.log('updateDynamicUpdateListeners '+nodeName, el);
so
//console.log("UpdateContent URI "+url);
//console.log('updateDynamicUpdateListeners '+nodeName, el);
this is only console logging but I know early IE's hate this and fail on it
I assume you have a IE9 to test on?
actually in vm3.0.6.2 this has already been done... you should update as there are other bug fixes in this release as well
also in IETester on IE9 I get a JS error
see screenshot
this isn't from VM
Thank you for indicating this JS error. I'll report the matter to the developer.
-------------------
It turned out that it's an issue with 3rd party extension - search module. Sorry that I had been bothering you.
Hmm...the solution is not so simple as I thought :(. Indeed the ploblem lay in 3rd party extension but only for IE 8. When it comes to IE9 it still exists. Looking into developer tool of IE I have the following issue
SCRIPT438: Object doesn't support property or method 'pushState'
in /components/com_virtuemart/assets/js/dynupdate.js?vmver=8740, line 102 character 9
Please for any advice.
http://stackoverflow.com/questions/19634513/using-history-js-with-ie9
plus a lot of linked answers using history in <IE10
So do you mean it's only my personal issue, not general with VM (issue lies in Vm core file) on IE?
I don't understand why tha ajax feature don't use https://github.com/browserstate/history.js, but it's own way, to handel browser history.
or perhaps this is a better solution
https://github.com/devote/HTML5-History-API
Now the solution in same file as before(components/com_virtuemart/assets/js/dynupdate.js):
history.pushState(stateObj, "", url);
to
if (typeof history.pushState != 'undefined') {
history.pushState(stateObj, "", url);
}
This is not the best solution, because this does not add page to browser history in ie 9 and before, but must work in all case.
Hi,
Your solution resolved the problem with "frozen" child variants on IE9 - that's a good thing, thank you :) The bad thing is that now I have another issue with js. I mean that now I'm not able to use fancybox (enlarge image), 'recommend to a friend' and 'ask a question ' forms for example... :(
The following error appears:
SCRIPT5007: Unable to get property 'hide': object is null or undefined in /components/com_virtuemart/assets/js/fancybox
jquery.fancybox-1.3.4.pack.js?vmver=8740, line 18 character 282
Ehh...if it's not one thing it's another...
Could anyone help?
Yes , sorry, i don't know which was writing this script, but this is very buggy.
it would be so simple when using triggers in the script and not so spagetti code.
add :
else Virtuemart.updateContent(url);
now the replacement code is:
if (typeof history.pushState != 'undefined') {
history.pushState(stateObj, "", url);
} else Virtuemart.updateContent(url);
Hum, sorry, i'm not sure this resolve your problem. because window.onpopstate cannot be used for ie9
As i said, you have javascript library doing this for you, but in virtuemart 3.0, this is done internally without real fallback for old browsers.
Thank you for trying to help. Indeed the new code didn't help. Still the same issue. .. The worst thing is there's no any feedback in that matter from VM team. Maybe I'm (we) wrong... Maybe the ajax reloading works well for them in elderly releases of IE. Or maybe not...Would be nice if anyone from VM team expressed his opinion about that.
I know that now VM team has been struggling with numerous bugs related to new J! release but I'd like to ask once again for any feedback in the matter of ajax feature. Does the 'ajax reloading' work well in elderly releases of IE (8/9)? Do the child variants work fine for you in those browsers? Does anyone have the following errors trying to choose one of Generic child variants or using fancybox?
SCRIPT438: Object doesn't support property or method 'pushState'
in /components/com_virtuemart/assets/js/dynupdate.js?vmver=8740, line 102 character 9
SCRIPT5007: Unable to get property 'hide': object is null or undefined in /components/com_virtuemart/assets/js/fancybox
jquery.fancybox-1.3.4.pack.js?vmver=8740, line 18 character 282
It looks like the common issue for Virtuemart but I need someone to confirm (or deny) it. So if someone has an opportunity to check that I give any feedback I'll appreciate.
Hi miku,
You have many solution for this problem.
one is (remove ajax and go to page) after :
QuoteVirtuemart.updateContent = function(url) {
add
Quoteif (document.all && !window.atob) window.location.href = url;
to detect IE9 and lower
See here for more possibility :
http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript
Thanks for a hint but it looks like I'm not able to make use of it - it doesn't work for me. Should the code look like below after the modification? It's not that I'm too lazy to make some effort to do something by myself, it's simply because I'm not a programmer at all :-[
Virtuemart.updateContent = function(url) {
if (document.all && !window.atob) window.location.href = url;
if(Virtuemart.isUpdatingContent) return false;
Virtuemart.isUpdatingContent = true;
url += url.indexOf('&') == -1 ? '?tmpl=component' : '&tmpl=component';
console.log("UpdateContent URI "+url);
$.ajax({
url: url,
dataType: 'html',
success: function(data) {
var el = $(data).find(Virtuemart.containerSelector);
if (! el.length) el = $(data).filter(Virtuemart.containerSelector);
if (el.length) {
Virtuemart.container.html(el.html());
Virtuemart.updateCartListener();
Virtuemart.updateDynamicUpdateListeners();
//Virtuemart.updateCartListener();
if (Virtuemart.updateImageEventListeners) Virtuemart.updateImageEventListeners();
if (Virtuemart.updateChosenDropdownLayout) Virtuemart.updateChosenDropdownLayout();
}
Virtuemart.isUpdatingContent = false;
}
});
Virtuemart.isUpdatingContent = false;
}
By the way indeed the best solution for me would be complete getting rid of the 'ajax reloading for product details', but how to do this?
Miku, I think Patrick meant it that way. Our problem is that there are not a lot people with an IE9. My personal statistic is that there are 2% developers with a real IE9, the rest tries with emulations, which have their own problems.
I have look for statistic. IE8+9. Usage is +/- 7%, depending the stat counters you look.
Milbo, I think, it would be nice that your developpers do something.
Quote from: Studio 42 on March 26, 2015, 02:25:06 AM
Milbo, I think, it would be nice that your developpers do something.
I agree, if not just for IE then maybe some option to completely disable the ajax reloading...
Quote from: Studio 42 on March 26, 2015, 02:25:06 AM
I have look for statistic. IE8+9. Usage is +/- 7%, depending the stat counters you look.
Milbo, I think, it would be nice that your developpers do something.
I did already something and tested your ideas, but without luck. So my solution is a try/catch now.
try {
history.pushState(stateObj, "", url);
}
catch(err) {
// Fallback for IE
window.location.href = url;
return false;
}
and a config to disable the dynupdate (hmm should be called reload, actually) is already there. jdynupdate, and here the tutorial how to set http://forum.virtuemart.net/index.php?topic=128956.0
But others asked also for an option, not any developer for customplugins or joomla content plugins knows how to add the right js.
Quote from: Studio 42 on March 26, 2015, 02:25:06 AM
I have look for statistic. IE8+9. Usage is +/- 7%, depending the stat counters you look.
Milbo, I think, it would be nice that your developpers do something.
You did not read correctly, I did not say that there are only 2% using it. What I said is, that I asked 50 people and only ONE has a real IE9. So the statistic within this forum is 2% and the reason that it is so hard to check for it, because there is no developer using such an old browser.
Look here :
5% > http://www.h3xed.com/web-development/should-your-new-website-support-internet-explorer-8-in-2015
25% > http://www.w3counter.com/globalstats.php
25% > https://www.netmarketshare.com/browser-market-share.aspx?qprid=2&qpcustomd=0
The problem is the Microsoft ie8 update policy for windows 98,XP and Xbox.
I know 25% is not real, but i think the 7% is real !
Paatrick, wake up. I am NOT talking about the percentages in the wild.
I talk about developers! in special VirtueMart developers!
Quote from: Milbo on March 26, 2015, 08:50:44 AM
I did already something and tested your ideas, but without luck. So my solution is a try/catch now.
try {
history.pushState(stateObj, "", url);
}
catch(err) {
// Fallback for IE
window.location.href = url;
return false;
}
Indeed, it seems to work ;)
Quote from: Milbo on March 26, 2015, 08:50:44 AM
and a config to disable the dynupdate (hmm should be called reload, actually) is already there. jdynupdate, and here the tutorial how to set http://forum.virtuemart.net/index.php?topic=128956.0
Yes, jdynupdate helps but it causes another problem - facybox doesn't work :(
what about the facebox?
Quote from: Milbo on March 26, 2015, 15:25:27 PM
what about the facebox?
When we use jdynupdate in config there's an issue with 'Recommend to a friend', 'Print' and 'Ask a question' forms
They are loaded in the new page instead of the pop-up window, respectively:
/recommend?tmpl=component
?tmpl=component&print=1
/askquestion?tmpl=component
Quote from: Milbo on March 26, 2015, 15:25:27 PM
what about the facebox?
And of course, above all, there is an issue with images which load itself in a new page instead of pop-up...So we have something like /images/stories/virtuemart/product/image.jpg in the url.
Now when the reload works thanks to your 'try/catch' solution I see another issue - issue with sub-menu items (rolling out items). The menu levels are distorted after we choose some of the variant of a product. By distorted I mean the sub-menu is in the same line as the main one (it's not rolling out outside) When I took a look at the case thoroughly it looks like issue appears only for central variants of a product - when we choose the first one or the last one of the variants everything works fine... Very strange but it works that way...
MOVE ON please !
Yes there are stats out there on users with IE8
Stick a banner up like the very well visited BBC.co.uk does if a visitor uses an outdated browser -
If they are still using XP or IE8 then it is time they progressed into the 21st century, they can always stick firefox on their machine and have an updated browser.
Why on Earth should the team waste time looking back at a browser that should be dead?
Yes, it should be but is not. IE still exists, many people use it, so you really thing the best solution is to MOVE ON? Do you think it's pleasure for me wasting my (and your time) to things like that? I just report bugs counting it manage to solve them. That's the idea of forum... If it's not possible, ok I will live further, but if it's possible why not to use of it? Do you think a banner will do the trick? I don't think so...
If VM devs' don't intend to deal with issues occurring on older browsers, please say it...
Quote from: Milbo on March 26, 2015, 15:25:27 PM
what about the facebox?
I don't see facebox option in virtuemart configuration....
Regarding Fancybox vs facebox
admin/configuration/templates
bottom right
Use Fancybox
untick to use facebox.
QuoteDo you think a banner will do the trick? I don't think so...
If VM devs' don't intend to deal with issues occurring on older browsers, please say it...
My aim is to say what I feel - not what will work for you and your clients.
And yes a banner would have some impact (better than not putting anything at all) In fact I intend to add one on my site as soon as I finish typing this.
I would like things to work for IE9 possibly, but I am not suffering the issues you are clearly having.
I appreciate that we all provide help and request help in these forums - but I hope the devs are looking forwards - not peering back into the mists of time
Quote from: Hutson on March 26, 2015, 20:32:33 PM
And yes a banner would have some impact (better than not putting anything at all) In fact I intend to add one on my site as soon as I finish typing this.
I definitelly agree: it would have some impact, but it doesn't resolve the issue completely.
Quote from: Hutson on March 26, 2015, 20:32:33 PM
I would like things to work for IE9 possibly, but I am not suffering the issues you are clearly having.
Do you mean ajax update work well for you on IE?
He is my tester and got my file. the ajax reload does not work, but a proper fallback.
QuoteHe is my tester
I tested things to help out the project - I do not work for Milbo as a tester - LMAO
Hmmmm... Muhh
I also used IE8 not IE9
Hutson, I just removed the chains from you and directly you become cheeky. :-P
Quote from: Milbo on March 27, 2015, 09:53:12 AM
Hutson, I just removed the chains from you and directly you become cheeky. :-P
;D ;D ;D ;D ;D ;D ;D
Leaving the whole things not related to the issue... The issue with ajax reload for IE8/9 was solved thanks to Milbo's fix.
try {
history.pushState(stateObj, "", url);
}
catch(err) {
// Fallback for IE
window.location.href = url;
return false;
}
Thank youTwo things:
1. As I wrote - when the ajax reload finally had started to work it turned out that (at least for me) there's an issue with joomla sub-menu items...
2. There's also unclear question of disable the feature of ajax reloading (in product details) by jdynupdate command in VM config which also seems to not working properly (at least for me ).
Quote from: Milbo on March 26, 2015, 08:50:44 AM
and a config to disable the dynupdate (hmm should be called reload, actually) is already there. jdynupdate, and here the tutorial how to set http://forum.virtuemart.net/index.php?topic=128956.0
Anyway the main issue was solved.