VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Narkoman on February 27, 2013, 14:30:21 PM

Title: VM 2.0.18a Add to cart button
Post by: Narkoman on February 27, 2013, 14:30:21 PM
Hello, i have vm 2.0.18a + Joomla! 2.5.6 Stable and I'm getting a problems with 'add to cart' button pop up.

(http://s55.radikal.ru/i148/1302/df/7d55bfe24174.gif)

Thats the configuration, i also have checked all the:

Using the VirtueMart CSS    
Using the VirtueMart jQuery    
Using the product Scripts    
Using the Script ajax Countries / Regions    
Use external google jQuery library

checked. heres the category URL  http://red-flo.spb.ru/index.php/tovary (http://red-flo.spb.ru/index.php/tovary) , add to cart button just redirects me to another page with another bug (select shipment method not working).  Maybe pop up is not working because of the shipment? I also tried to include scripts manually in template, doesn't work too.
Title: Re: VM 2.0.18a Add to cart button
Post by: jenkinhill on February 27, 2013, 18:05:34 PM
I just looked at the code on your site  - no jQuery or VM css is loading.
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on February 27, 2013, 22:59:02 PM
I'm included manually

  <script src="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/js/jquery-ui.min.js" type="text/javascript"></script>
  <script src="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/js/facebox.js" type="text/javascript"></script>
  <script src="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/js/vmprices.js" type="text/javascript"></script>

<link media="screen" rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/javascript" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/css/facebox.css" type="text/javascript" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/css/vmsite-ltr.css" type="text/javascript" />


But still not working
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on February 28, 2013, 13:42:47 PM
I looked up into static function jQuery()  in /administrator/components/com_virtuemart/helpers and figured out that condition if(VmConfig::get('google_jquery',TRUE)){
vmJsApi::js('jquery','//ajax.googleapis.com/ajax/libs/jquery/1.6.4','',TRUE);
gets executed, but still no effect on add to cart button. Maybe i need to include other scripts manually? Also condition if (!VmConfig::get ('jquery', TRUE) and $isSite) {
return FALSE;
}
gets executed too.

In function jPrice()
vmJsApi::js( 'facebox');
vmJsApi::js( 'vmprices');
vmJsApi::css('facebox');
Gets executed as well.



Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on February 28, 2013, 22:25:45 PM
you have coding problems on your site.

the page titles are the urls.

Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on March 01, 2013, 02:11:54 AM
Hi. I fixed that thans, i forgot to add <title><?php echo $this->title?> </title> in my template. But still i cant get the cart working.
Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on March 01, 2013, 19:17:44 PM
you still are not loading the vmart scripts

look in the source code
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on March 02, 2013, 02:38:59 AM
Hi i included   <script src="/components/com_virtuemart/assets//js/jquery.min.js" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets//js/jquery.noConflict.js" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets//js/vmsite.js" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets//js/facebox.js" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets//js/vmprices.js" type="text/javascript"></script>

<link media="screen" rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/css/facebox.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/components/com_virtuemart/assets/css/vmsite-ltr.css" type="text/css" />
Manually and at least i got adding items to the cart to work. But still i dont get any popup. Also i checked $_SESSION['cart']['idx'] and for some reason it stays empty even after adding some items to my cart.
Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on March 02, 2013, 03:42:41 AM
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fred-flo.spb.ru%2Findex.php%2Ftovary

you have html errors in the head of the document , this could be causing problems
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on March 02, 2013, 15:13:06 PM
Hi. I fixed the <head> of the document. Still theres a html errors in the body, but the head seems to be ok. Still cant get popup to work.
Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on March 02, 2013, 20:29:02 PM
what happens when you disable the flash?
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on March 04, 2013, 12:37:53 PM
You mean removing the flash objects ? http://red-flo.spb.ru/index.php/tovary (http://red-flo.spb.ru/index.php/tovary) Removed all the flash objects. Seems nothing changes
Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on March 04, 2013, 20:58:00 PM
the add to cart code is NOT in the head of your webpage

fore xample MINE looks like this (yours will be different)

<script type="text/javascript">

//<![CDATA[
      vmSiteurl = 'http://192.168.1.102/demo/' ;
vmLang = "";
vmCartText = ' was added to your cart.' ;
vmCartError = 'There was an error while updating your cart.' ;
loadingImage = '/demo/components/com_virtuemart/assets/images/facebox/loading.gif' ;
closeImage = '/demo/components/com_virtuemart/assets/images/facebox/closelabel.png' ;
Virtuemart.addtocart_popup = '1' ;
faceboxHtml = '<div id="facebox" style="display:none;"><div class="popup"><div class="content"></div> <a href="#" class="close"></a></div></div>'  ;

//]]>

jQuery(document).ready(function() {
   jQuery("a[rel=vm-additional-images]").fancybox({
      "titlePosition"    : "inside",
      "transitionIn"   :   "elastic",
      "transitionOut"   :   "elastic"
   });
});

  </script>
Title: Re: VM 2.0.18a Add to cart button
Post by: Narkoman on March 10, 2013, 00:01:51 AM
Hello. Adding your js example manually helped me and i got it to working. Thanks. But for some reason number of the items in cart in the session not updating. $_SESSION["cart"]["idx"] is empty. Is this a right constant for the count of caret items which stored in cookies?
Title: Re: VM 2.0.18a Add to cart button
Post by: PRO on March 10, 2013, 17:51:28 PM
the problem is with your install/template/custom coding