VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: kavoosi127 on April 11, 2014, 13:17:29 PM

Title: Add To Cart not working in main page..HELP PLEASE
Post by: kavoosi127 on April 11, 2014, 13:17:29 PM
Hi my friends..
add to cart button not work in main page of my site
I installed a quick start joomla 2.5 package with k2 and VM..(with joomla 2.5.8 and VM 2.26)
add to cart in items page works fine (like this page = http://irdookht.ir/فروشگاه/ساک-دستی/ساک-دستی-ساده-detail ) but in home page just refresh page with change title to shopping cart! and no pruduct was added!!
no .js (jquery) files load in home page and "Using the VirtueMart jQuery" is checked..
please help.. i read posts but not found any solution..
I am updated VM to ver 2.6.0 and joomla to 2.5.19 and PHP ver is 5.3.27

my site address to check =  irdookht.ir
sorry for my poor english
Title: Re: Add To Cart not working in main page..HELP PLEASE
Post by: jenkinhill on April 11, 2014, 13:57:30 PM
You have JavaScript problems - the error console shows  "TypeError: $(...).vm2front is not a function"

You load FIVE copies of jQuery:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<script src="/components/com_virtuemart/assets/js/jquery.min.js" type="text/javascript"></script>
<script src="http://irdookht.ir/media/com_zo2framework/js/jquery.min.js" type="text/javascript"></script>
<script src="http://irdookht.ir/modules/mod_zt_virtuemart_scroller/assets/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="http://irdookht.ir/modules/mod_zt_headline/assets/js/jquery-1.7.1.min.js?style=onebyone" type="text/javascript"></script>

You only should load one version to avoid problems such as you have, immediately before loading the other VM js scripts. I guess you need to remove the scroller module and maybe mod_zt_headline - then it may work, but probably easier, as add to cart from product details works, to remove the add to cart from those modules displaying.

See http://forum.virtuemart.net/index.php?topic=119638.0
Title: Re: Add To Cart not working in main page..HELP PLEASE
Post by: kavoosi127 on April 11, 2014, 17:11:14 PM
thank you for your quick reply..
and in my test
<script src="/components/com_virtuemart/assets/js/jquery.min.js" type="text/javascript"></script>
not load in home page..

I know that..but i installed the quick start pack in a free host and it works like a charm!!

the address is = http://kavoosi126.gigfa.com/irdookht/

i complately confused!!
Title: Re: Add To Cart not working in main page..HELP PLEASE
Post by: kavoosi127 on April 12, 2014, 10:22:50 AM
how can i force VM to load .js and .css files in all pages of site?
Title: Re: Add To Cart not working in main page..HELP PLEASE
Post by: StefanSTS on April 12, 2014, 17:22:21 PM
Quote from: kavoosi127 on April 12, 2014, 10:22:50 AM
how can i force VM to load .js and .css files in all pages of site?

Well, you can force to load anything, if you put it into the header of your index.php file in your template, but I don't think, this will solve your problem.

You can try to load the latest jQuery and add the script, that gives you backwards compatability. So the tools that rely on an older jQuery might work with that. Check out the jQuery website, the documentation will fill you in how to do that.

All other jQuery calls need to be thrown out, then you might have a chance to get different jQ-Tools running on one site.

So long
Stefan