News:

Support the VirtueMart project and become a member

Main Menu

VM 2.0.18a Add to cart button

Started by Narkoman, February 27, 2013, 14:30:21 PM

Previous topic - Next topic

Narkoman

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.



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 , 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.

jenkinhill

I just looked at the code on your site  - no jQuery or VM css is loading.
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

Narkoman

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

Narkoman

#3
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.




PRO

you have coding problems on your site.

the page titles are the urls.


Narkoman

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.

PRO

you still are not loading the vmart scripts

look in the source code

Narkoman

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.

PRO


Narkoman

#9
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.

PRO

what happens when you disable the flash?

Narkoman

You mean removing the flash objects ? http://red-flo.spb.ru/index.php/tovary Removed all the flash objects. Seems nothing changes

PRO

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>

Narkoman

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?

PRO

the problem is with your install/template/custom coding