Hello,
i need to solve this issue....by clicking on add to cart button, the website redirect directly in the cart.
In virtuemart configuration the option for popup is activated.
What's wrong in my source code?
I attach page source code.
Thanks.
this type of issue only occur due to javascript conflict. Please provide a link to website where the issue, else looking at source code will not serve any purpose
Thanks
Kishore
Hi Kishore,
thank you for answare me.
this is the link: http://www.progettoaries.it/index.php/catalogo/vmcategory/69-power-bank/13-iphone-5.html
You are not loading the required VirtueMart JavaScript files on that page. Compare the header source for the product list page abd product details page, where quantity change & popup work OK.
i can see below JS files are not included in the template
/components/com_virtuemart/assets/js/vmsite.js?vmver=9293
/components/com_virtuemart/assets/js/dynupdate.js?vmver=9293
/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver=9293
/components/com_virtuemart/assets/js/vmprices.js?vmver=9293
Hi,
i added this:
$document->addScript('/components/com_virtuemart/assets/js/vmsite.js?vmver=9293');
$document->addScript('/components/com_virtuemart/assets/js/dynupdate.js?vmver=9293');
$document->addScript('/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver=9293');
$document->addScript('/components/com_virtuemart/assets/js/vmprices.js?vmver=9293');
but it does not works yet.
Firefox debugger has displayed this errors for all added scripts: ReferenceError: jQuery is not defined
You are loading jQuery after the VM files........
When loading a library (such as jQuery), make sure it is loaded before you access library variables, such as "$". Put the <script> tag that loads the library before your code that uses it.
The name of the js is incorrect
But you should not need to add this stuff manually Vm will add it.
$document->addScript('/components/com_virtuemart/assets/js/vmsite.js
You do not need anything after the .js
Hi,
this is the new situation:
$document = JFactory::getDocument();
$document->addStyleDeclaration($css);
$document->addScript('media/jui/js/jquery.min.js');
$document->addScript('media/jui/js/jquery-migrate.min.js');
$document->addScript('media/jui/js/jquery-noconflict.js');
$document->addScript('components/com_virtuemart/assets/js/vmsite.js?vmver=9293');
$document->addScript('components/com_virtuemart/assets/js/dynupdate.js?vmver=9293');
$document->addScript('components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver=9293');
$document->addScript('components/com_virtuemart/assets/js/vmprices.js?vmver=9293');
Firefox Console do not produce errors, but "add to cart popup" doesn't works yet :-(
Please...any idea?
thanks!!
Hello,
i have good news :-)
The problem was into my template index.php
i added and hidden the source code for minicart module:
<div style="display:none;"> <jdoc:include type="modules" name="cart" style="none" /> </div>
and now it works!!
I think that js code included in minicart has solved the issue.
Thank you all for help.