VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: pixelperfectcreative on February 21, 2018, 00:31:27 AM

Title: Dependent options not loading (ajax issue?)
Post by: pixelperfectcreative on February 21, 2018, 00:31:27 AM
I have a site that is complete except for one big problem. If you go to a product and select an option from the first box, it should populate the other option boxes. However about half the time it will not... unless you refresh the page.

Watch this video for an example of the problem: https://screencast-o-matic.com/watch/cFn23boKAF

Notice that I go to a product, select the first option and nothing happens (ajax issue?). Then, if I refresh the page, make a selection in that first box, the other options are then loaded.

I am desperate for an answer on this. Thanks in advance to anyone that has any help for me.
Title: Re: Dependent options not loading (ajax issue?)
Post by: Milbo on February 25, 2018, 18:18:42 PM
use in your browser with right click the "examine" or some other method to get the console, then click on js console and try the dropdown. You should now see below in the console how the js is working. and when it does not work, you will see an error there.
Title: Re: Dependent options not loading (ajax issue?)
Post by: Studio 42 on February 26, 2018, 13:41:51 PM
This is typical an obsolete template not loading Vm scripts.
You need to add in your template file YOURSHOP/templates/YOURTEMPLATE/html/com_virtuemart/productdetails/default.php
echo vmJsApi::writeJS();
at end of file but before closing </div>

Note that in some case other JavaScripts are not load, but it work with this change 80% of time.