News:

Looking for documentation? Take a look on our wiki

Main Menu

Add to cart issues - what's the actual solution?

Started by stuclark, January 06, 2012, 18:30:11 PM

Previous topic - Next topic

Steo

Quote from: BanquetTables.pro on April 10, 2012, 19:04:37 PM
Quote from: Steo on April 10, 2012, 17:07:25 PM
Please help, same 'Add to Cart' problem, no pop up window and no cart stays empty.

Joomla! 1.7.5 Stable, Virtuemart 2.0.4, Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0)
Virtuemart Javascript: all ON
Google library: OFF

Test link : http://www.annybarlowimages.com/test

Help highly appreciated!

Been reading all related post for the last 10 days, tried bit of everything, but no joy!!!


looking in your source code, I see
vmSiteurl = 'http://annybarlowimages.com/test/'; ;

BUT, when I try to access the site WITHOUT the www, i get redirected

Thank you for pointing it out, but as you can see on the attached pic, from the backed it is with WWW

[attachment cleanup by admin]

Steo

Quote from: BanquetTables.pro on April 10, 2012, 19:04:37 PM
Quote from: Steo on April 10, 2012, 17:07:25 PM
Please help, same 'Add to Cart' problem, no pop up window and no cart stays empty.

Joomla! 1.7.5 Stable, Virtuemart 2.0.4, Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0)
Virtuemart Javascript: all ON
Google library: OFF

Test link : http://www.annybarlowimages.com/test

Help highly appreciated!

Been reading all related post for the last 10 days, tried bit of everything, but no joy!!!


looking in your source code, I see
vmSiteurl = 'http://annybarlowimages.com/test/'; ;

BUT, when I try to access the site WITHOUT the www, i get redirected


Thank you BanquetTables.pro!!! Just changed my config.php to point to the www version, and it solved the problem!!! ;D ;D ;D ;D

cpetitclerc73

#122
I still have an issue with the add to cart button not working.

I think this article might help someone:
http://www.designvsdevelop.com/jquery-in-joomla-i-was-wrong/

In reading that I have no idea how to get a no conflict to load first or even J Query before Mootools for that matter. How do you do that?

I have the Beezs template set up for now, Disabled Google JQuery.

Still having problems. I will post the solution if I ever find one.

cpetitclerc73

#123
I changed the configuration.php file and added the http:// www in front my domain to match  Virtumart / Shop url.

That is what did the trick. i.e. http://www.mysite.com

Now the add to cart button is working.

FYI You may have to change the permissions of the configuration.php file from 444 to 777 to make the change and then back to 444.

John2400

I lost the ability to add to the cart today,

I did this by simply telling the server - (on the server Cpanel) to redirect my site to the www.   

ie: my site on some search engines was coming up http://mysite.com    so I told the server to redirect all to  http://www.mysite.com

I then lost my ability to add to the cart and the small icon - show cart on the pop up also disappeared. -

fixed but - I have done this on some vm1 site to correct - some issues.

cpetitclerc73

That was short lived.  :-[
My add to cart button stopped working again. I added a couple products in the back end and POW, It stopped working. This button is very unstable and flakey. The site is https://www.sharptech-inc.com/

PRO

Quote from: cpetitclerc73 on April 11, 2012, 15:45:42 PM
That was short lived.  :-[
My add to cart button stopped working again. I added a couple products in the back end and POW, It stopped working. This button is very unstable and flakey. The site is https://www.sharptech-inc.com/

if you view source, it say "vmSiteurl = 'http://www.sharptech-inc.com/'; ;"

so, when I change the https, to http   the add to cart works


cpetitclerc73

I went to another computer and the add to cart works. Wierd. I have tested on IE7, IE9 and Google Chrome.
Cross my fingers and hope it stays working. I remember having this issue on the last website I built at https://comedycave.com/
Both are working and I hope they stay that way. I am loosing sleep over this issue. The store is pointless without this feature working. Its a good learing experience.  ;)

Studio 42

#128
HI all,
The actual solution is that joomla provide a way to test jquery.
why this exist ?
JHTML::_('behavior.mootools');
and not
JHTML::_('behavior.jQuery');

Simply write in joomla forum, they support jquery as native and then we can sing . Joomla , What a wonderfull word ...

For joomla team example :

/**
* Write a <script></script> element
* @param   string   path to file
* @param   string   library name
* @param   string   library version
* @param   boolean   library version
* @return  nothing
*/

public static function scriptlibrary($path,$namespace,$version='', $minified = null)
{

static $loaded = array();

// Only load once
// using of namespace assume same library have same namespace
// loading 2 time jquery with this method simply return and do not load it the second time

if (!empty($loaded[$namespace])) {
return;
}

$version = $version ? '.'.$version : '';
$min = $minified ? '.min' : '';

JHtml::script( $namespace.$version.$min.'.js', $path);
$loaded[$type] = true;

}

   
        example of use assuming this is integrated in jhtml

   JHTML::scriptLibrary('mypath','jquery','1.6.1',true);

I know myself how to prevent 2 load of files or javascript, but when only one person implement it then the work is done for nothing.
If, with the time, it's integrated to joomla you have no more conflicts because loading 2 tiime same library.

Another good sample :
   JHTML::scriptLibrary('mypath','jquery','1.6.1',true);
   JHTML::scriptLibrary('//ajax.googleapis.com/ajax/libs/jquery/1.6.4/','jquery',false,true);
   JHTML::scriptLibrary('templates/'.$this->template,'jquery','1.5.2');
only load one time the library

template loading vmprices version :
JHTML::scriptLibrary('templates/'.$this->template,'vmprices');
in Virtuemart :
JHTML::scriptLibrary( 'components/com_virtuemart/assets/js/','vmprices');
only load template modified version of vmprices



ah-solutions

Hello,

I'm developing at the moment a webshop based on Joomla 2.5.4 and Virtuemart 2.0.4 with actually 2 Languages (German und English). Following "Add to Cart"-Issue I have recognized. It is possible to add a product to the cart without any problem in the default language of the site, but if you switch to the other language, the button is not working any more.

For Example: if the default language is German, you can press the "Add to Cart"-Button without any problems. If you switch to the English Version of the site, nothing happens any more. The moment you change the default language in Joomla from German to English, it is the other way round, the English "Add to Cart" works, the German not.

I think, the problem comes from the origninal initialization of the Javascript, but unfortunately I haven't found a solution yet, but maybe someone of you has already found one. The moment I find something out so solve this, I will post it here.

Best regards
Bernhard Hödl

jjk

Quote from: ah-solutions on April 13, 2012, 15:18:41 PM
...If you switch to the English Version of the site, nothing happens any more. The moment you change the default language in Joomla from German to English, it is the other way round, the English "Add to Cart" works, the German not.

I'm using Joomla 2.5.4 and VM 2.0.4 on a bilingual german/english installation too. The 'Add to cart' button always works for me. I can add a product in one language, switch to the other language and add another product, switch language again, etc. ...it always works.
Maybe you have a Javascript conflict with another extension or your template somewhere.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

Quote from: jjk on April 13, 2012, 20:48:18 PM
Quote from: ah-solutions on April 13, 2012, 15:18:41 PM
...If you switch to the English Version of the site, nothing happens any more. The moment you change the default language in Joomla from German to English, it is the other way round, the English "Add to Cart" works, the German not.

I'm using Joomla 2.5.4 and VM 2.0.4 on a bilingual german/english installation too. The 'Add to cart' button always works for me. I can add a product in one language, switch to the other language and add another product, switch language again, etc. ...it always works.
Maybe you have a Javascript conflict with another extension or your template somewhere.
A have add a fix in config(checkout tab), seems this only come in some joomla version.
Tested on a live site and local server(next final release is comming next)

janssenrik86

When you use a template of Joomlart with T3 support, you can fix your problem:

Go to your template in the backend of joomla
>>
You see the options 'Optimize CSS' and 'Optimize JS'.

Set:
Optimize CSS to 'Join & minify'
Optimize JS to 'No'

Problem was solved!!!

stuclark

I found a very simple way of fixing this using my Joomlashack template. It really is amazingly simple!

I previously tried all the tricks people were talking about here, but I could only ever get either my template functions working correctly, or my VM functions working correctly - never both together.

...then, looking at the source code it suddenly hit me... load the JS libraries in the other order...

To do this, I modified my template's main PHP file (in this case it's /templates/<template name>/template.php but usually /templates/<template name>/index.php) and made the following change (from the top version to the bottom version):

<?php
/**
* @copyright Copyright (C) 2010 Joomlashack LLC. All rights reserved.
*/
// no direct access
defined'_JEXEC' ) or die( 'Restricted access' );
?>

<doctype>
<html>
<head>
<w:head />
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?>/js/superfish.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery('document').ready(function(){
jQuery('#navbar ul.menu')
.find('li.current_page_item,li.current_page_parent,li.current_page_ancestor,li.current-cat,li.current-cat-parent,li.current-menu-item')
.addClass('active')
.end()
.superfish({})
jQuery('a.sf-with-ul').parent().addClass('sf-with-ul');
});
</script>


<?php
/**
* @copyright Copyright (C) 2010 Joomlashack LLC. All rights reserved.
*/
// no direct access
defined'_JEXEC' ) or die( 'Restricted access' );
?>

<doctype>
<html>
<head>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?>/js/superfish.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery('document').ready(function(){
jQuery('#navbar ul.menu')
.find('li.current_page_item,li.current_page_parent,li.current_page_ancestor,li.current-cat,li.current-cat-parent,li.current-menu-item')
.addClass('active')
.end()
.superfish({})
jQuery('a.sf-with-ul').parent().addClass('sf-with-ul');
});
</script>
<w:head />


If you didn't spot the change, I'll expain... I simply moved the <w:head />tag from loading first to loading last. This had the effect to force VM to load it's JS after the template JS, meaning it took control.

Hey presto - problem fixed!

marrius

My problem was as follows. If you activate jquerry, lightbox does not work well, if I disable jquerry in VirtueMart, not work basket. So I found the following compromise solution for the configuration consisting of Joomla 2.5.4 + VirtueMart 2.0.6 + Template shape5 vertex + xmap + joomla watch:

- I disable the VirtueMart function: Use external library jquery google
- I disabled the function: Using the jQuery VirtueMart
- I disabled system cache, instead I activated progressively cache
I installed JQuery EASY with the following settings:
   = Enable jQuery
  = Strip Conflict No Code: Yes
  = Add No Conflict Code: Thru script declaration

With this settings, both cart and lightbox works fine.