Author Topic: add to cart button not working  (Read 30816 times)

uniqueoperator

  • Beginner
  • *
  • Posts: 9
add to cart button not working
« on: December 16, 2011, 07:09:47 am »
joomla 1.7.3 and vm 2.0 (1.9.8m) for new install.

categories and products loaded.
jquery on

problem: arfter selecting category, ten product, then details then quantity all ok; click on "add to cart" nothing happens, doesn't go to cart; but navigate to cart and there is nothing add reflecting action of "add to cart".

search other topics reporting almost the same problem but not the same as mine, i checked the solutions and no fix.

vm debug shows no java errors, no html errors. its like there is no script fro add to cart. browser debug shows no errors. joomla debug no errors.

sorry for short explanation, broke right arm and it takes time to do all the testing.

please give some direction. i'm not sure how to turn on jquery in joomla, no module found, no place in global config. so far vm 2,0 is working, simple cart, but should do wat i need.

thx,

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: add to cart button not working
« Reply #1 on: December 16, 2011, 11:46:26 am »
if your template or other modules use jquery, disable vmart jquery and test

uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #2 on: December 17, 2011, 06:31:49 am »
disabled jquery in vm, still not working. url www.scorpionantennascompany.com  >>online store>>accessories>>any product details>> add to cart. this is simple store.

still dont know where there is a joomla jquery config; not in site global; no module; no plugin; ???

thx again.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: add to cart button not working
« Reply #3 on: December 17, 2011, 13:36:01 pm »
go to vmart templates

TURN vmart jquery back oon

THEN, also in your config you have an option to turn off google external jquery , turn that off

uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #4 on: December 17, 2011, 19:14:14 pm »
turned google off, jquery was on. no change of problem noted, no change noted anywhere on site.

tried changing site default template, no change to add to cart. changed bact to original template; no chg to problem.

can change product quanity and it will increase up and down in value; clicking add to cart appears to have no observed activity on page no in bebugger.

othere parts of continuing site developement are working as expected. this will be a great product.

thx again







PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: add to cart button not working
« Reply #5 on: December 17, 2011, 22:55:44 pm »
you have 2 jquery files loaded. 1 from vmart and 1 from something else.

Your menu has lots of JS, and for a menu like that, it does not need much.

Your template has NO doctype.

Could be java conflict, or html errors.


uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #6 on: December 18, 2011, 19:54:43 pm »
using firefox debug i dont see jquery running. i see some java scripts have run. maybe i dont understand or follow your observations and things to check,

i was checking shopper groups. i dont want to require having a buyer register, want shop open. would the add to cart only work for either a registered buyer or to all buyers depending on vm config >> checkout ?? and are there also othere requirements for type of shopper def like, -anonymous- with prices checked to show ... etc.

if i have missed some setting would i experience the same problem im having?

i noticed shopper groups can easily be defined for  viewing. however shopper auto fills with the system users i defined for joomla. BUT .. the editing any one of these seems to have just usrname & email for one of the super users in all shoppers, they cant be chg'd. why i checked this  was tried to see if buyer had to be registered for add to cart. could not validate this theory since i couldnt get a buyer reg to appear. even set up menue for "system" reg & login. setting up acl took time.

this is where i jumped into the rabbit hole with "shopper" def.

no clear idea on how all this should work together.

do i have an add to cart button problem or a buyer not defined to "checkout"  ???

i perplexed.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28262
  • Always on vacation
    • Jenkin Hill Internet
Re: add to cart button not working
« Reply #7 on: December 18, 2011, 20:12:38 pm »
You load jQuery here:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> 
which looks like it is for your template "supersize" - the next line is
<script type="text/javascript" src="templates/js_scenica/js/supersized.3.1.3.min.js"></script>

and then here:

<script src="/components/com_virtuemart/assets/js/jquery.min.js" type="text/javascript"></script>

That is two  copies of jQ.

Also the debugger in IE9 throws up an error in modal.js :

SCRIPT5009: 'Hash' is undefined
modal.js, line 4 character 1


And, as no Doctype is defined it will be expected to be HTML5 in modern browsers. So you get this error report.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #8 on: December 19, 2011, 17:46:34 pm »
Thanks for explaining, learned something good, never had this type of conflict before.

i see why too.

changed template which did change the errors of jquery, not removing them. turned vm jquery off and jquery errors gone.

installed jQuery Easy extension. All jQuery errors gone. only one jquery.min.js .  but add to cart still not working. turned vm jquery back, no jquery errors suggesting new extension is effective with solving jq conflict errors.

switched back to my orig template. vm jquerry is on, no jquery conflict errors. add to cart still not working. there is still one error reported. "get" errror in index related to template. ive opened tckt with them for response.

i dont understand why when using a default joomla template still had errors. there is nothing custom with this fresh joomla install or with vm. i even unpub all modules and plugins not needed.

thx again, norm

uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #9 on: December 20, 2011, 05:17:34 am »

GuillaumeHullin

  • Beginner
  • *
  • Posts: 4
    • My Tumblr
Re: add to cart button not working
« Reply #10 on: December 26, 2011, 16:20:05 pm »
I add the same problem, I handled it by uncheck "Use external google jquery library" in Shop settings.
 :) Is it working for you?
"Stay Hungry, Stay Foolish" — Steve Jobs

uniqueoperator

  • Beginner
  • *
  • Posts: 9
Re: add to cart button not working
« Reply #11 on: December 28, 2011, 17:52:59 pm »
Thanks for the suggestion on external google jquery library. Tried it earlier but then again after your comment. I've tried every combination of jquery library toggles on my site including commenting out all calls to jquery which caused everything to break.

I don't think the problem is with jquery conflicts. I've loaded an extension, jQuery Easy, that appears to have eliminated all jquery conflicts. Seems to work well. All my other extensions using different jquery libraries do not have any problems using their own jquery library. excellent product.

The jquery error I have now only impacts the template.

I've had several programmers check it out now and they say the problem is with a GET within VM 2.0 . They quit at this point saying VM has problem either in configuration or in code for add to cart varriables.

I also had JoomShack check out the Template and they say it's most likely a VM problem and not their problem. The template is working correctly and the errors are not impacting.

I loaded Joomshopping to check out if a different Cart will work. It works without errors. It has jQuery calls without conflicts. If I can't find a solution quick to this problem, I just have to learn a new Cart. I've used VM for more than 3 years. I have to move my hosting and upgrading to Joomlla 1.7.3 seemed like a good idea at the time and upgrading to VM2.0 also seemed like a good idea.

Pardon my rant, Frustrated but learning more than I wanted.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: add to cart button not working
« Reply #12 on: December 28, 2011, 19:26:03 pm »
Pardon my rant, Frustrated but learning more than I wanted.

You still dont have a doctype, or most of the header correct

change it to this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >

also, you are not loading mootools. THATS why the modal doesnt work on your site.
IF you are using J1.7
under this in your template
<?php
// No direct access.
defined('_JEXEC') or die;

ADD THIS

$app = JFactory::getApplication();


ALSO: when viewing source, I see the script declartation is doubled for every declaration.


<script type="text/javascript">
jQuery.noConflict();
siteurl = 'http://www.scorpionantennascompany.com/' ;
vmCartText = ' was added to your cart.' ;
vmCartError = 'There was an error while updating your cart.' ;
loadingImage = '/components/com_virtuemart/assets/images/facebox/loading.gif'  ;
closeImage = '/components/com_virtuemart/assets/images/facebox/closelabel.png' ;
faceboxHtml = "<div id='facebox' style='display:none;'><div class='popup'><div class='content'></div> <a href='#' class='close'><img src='/components/com_virtuemart/assets/images/facebox/closelabel.png' title='close' class='close_image' /></a></div></div>" ;

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});
         SqueezeBox.assign($$('a.modal'), {
            parse: 'rel'
         });
      });
      window.addEvent('domready', function() {
         $$('.hasTip').each(function(el) {
            var title = el.get('title');
            if (title) {
               var parts = title.split('::', 2);
               el.store('tip:title', parts[0]);
               el.store('tip:text', parts[1]);
            }
         });
         var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
      });

   jQuery(document).ready(function($) {
      $('a.ask-a-question').click( function(){
         $.facebox({
            iframe: '/index.php?option=com_virtuemart&amp;view=productdetails&amp;task=askquestion&amp;virtuemart_product_id=2&amp;virtuemart_category_id=1&amp;tmpl=component&amp;Itemid=546',
            rev: 'iframe|550|550'
         });
         return false ;
      });
   });

jQuery.noConflict();
siteurl = 'http://www.scorpionantennascompany.com/' ;
vmCartText = ' was added to your cart.' ;
vmCartError = 'There was an error while updating your cart.' ;
loadingImage = '/components/com_virtuemart/assets/images/facebox/loading.gif'  ;
closeImage = '/components/com_virtuemart/assets/images/facebox/closelabel.png' ;
faceboxHtml = "<div id='facebox' style='display:none;'><div class='popup'><div class='content'></div> <a href='#' class='close'><img src='/components/com_virtuemart/assets/images/facebox/closelabel.png' title='close' class='close_image' /></a></div></div>" ;

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});
         SqueezeBox.assign($$('a.modal'), {
            parse: 'rel'
         });
      });
      window.addEvent('domready', function() {
         $$('.hasTip').each(function(el) {
            var title = el.get('title');
            if (title) {
               var parts = title.split('::', 2);
               el.store('tip:title', parts[0]);
               el.store('tip:text', parts[1]);
            }
         });
         var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
      });

   jQuery(document).ready(function($) {
      $('a.ask-a-question').click( function(){
         $.facebox({
            iframe: '/index.php?option=com_virtuemart&amp;view=productdetails&amp;task=askquestion&amp;virtuemart_product_id=2&amp;virtuemart_category_id=1&amp;tmpl=component&amp;Itemid=546',
            rev: 'iframe|550|550'
         });
         return false ;
      });
   });

jQuery.noConflict();
      window.addEvent('domready', function() {

         SqueezeBox.initialize({});
         SqueezeBox.assign($$('a.modal'), {
            parse: 'rel'
         });
      });
  </script>

Globacide Solutions

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
  • Globacide Solutions
    • Joomla & VirtueMart Affiliate Component/Extension
Re: add to cart button not working
« Reply #13 on: December 30, 2011, 19:17:53 pm »
Hey @uniqueoperator,

I think I may know what your problem is, since I may have encountered the same one.

Can you please tell me what hosting do you use?
Emilian Manolache
Globacide Solutions
VirtueMart Affiliate

Rabble

  • Beginner
  • *
  • Posts: 14
Re: add to cart button not working
« Reply #14 on: January 01, 2012, 21:56:54 pm »
I am also having this problem.  The "Add to Cart" button works on the Atomic template, but not on the RocketTheme template I've been planning to use.

I have tried every combination of the JQuery toggles in the back end.  JQuery is only loading once on the page.  I don't have any other modules installed yet.  This is a fresh install of Joomla 1.7.3, VM 2.0, and a RocketTheme tempate. I have disabled as much of the standard RocketTheme JS as possible, including the menu system.  Still, the Add to Cart button will not work with this template.

The site is currently in offline mode, but here is a copy of the doctype and the scripts that are loading...  any ideas on how to fix this?