News:

Support the VirtueMart project and become a member

Main Menu

Add To Cart not working in main page..HELP PLEASE

Started by kavoosi127, April 11, 2014, 13:17:29 PM

Previous topic - Next topic

kavoosi127

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

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

kavoosi127

#2
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!!

kavoosi127

how can i force VM to load .js and .css files in all pages of site?

StefanSTS

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
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.