RokQuickCart Not Adding Items To Cart – How to Solve

One of our clients asked us to install RokQuickCart on his Joomla website. For those of you who don’t know, RokQuickCart is a free Joomla component that is used for small stores with standard items (e.g. online stores selling books, subscriptions, etc…) The nice thing about this component is that it’s extremely easy to use and extremely easy to setup: its configuration consists of merely adding a PayPal email. That’s it!

Now, when we installed it and added a couple of test products, we expected for everything to work smoothly – but it didn’t… Every time we tried to add a product to the cart, nothing happened! The item was not added and the shopping cart was always empty. We immediately realized there’s a JavaScript error somewhere. So we looked at the JavaScript console (in Google Chrome), and there was indeed the following error:

Uncaught TypeError: Object # has no method ‘ready’

Then we looked at the code, and we noticed that both jQuery and Mootools were loaded on the same page, which was causing a conflict. So, we decided to disable the former on the products page only. Here’s how we did it:

  • We opened the file default.php located under the components/com_k2/com_rokquickcart/views/rokquickcart/tmpl folder and we added the following code at the beginning of the file:

    <?php
    	$document = &JFactory::getDocument();
    	$rootPath = JURI::root(true);
    	$arrHead = $document->getHeadData();
    	unset($arrHead['scripts']['//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js']);
    	$document->setHeadData($arrHead);
    ?>

    The above code removed jQuery from the list of JavaScript libraries included on the products page. Note that the location of the jQuery library might be different in your situation, so make sure you unset (remove) the right JavaScript path. Read here for more information on how to remove a JavaScript library from a Joomla page. (Warning: that article that we linked to is about removing Mootools, which is not what you want in this case. We just included the article so that you can have more insight on where the above code came from.)

  • We saved that file and we uploaded it back. The problem was fixed!

Quick note here: Some claim that the problem can be solved by just adding the following code to the affected page (in our case, the aforementioned default.php page):

<script>
	jQuery.noConflict();
</script>

The above code won’t work – just take our word for it!

If you are trying to install RokQuickCart and you’re having problems with it, then please contact us and we’ll do the installation for you. We won’t charge you much and we’ll do the job in no time! What are you waiting for?

5 Responses to “RokQuickCart Not Adding Items To Cart – How to Solve”
  1. Comment by daynuhlee — February 28, 2014 @ 6:50 am

    Hiya

    Thanks for the fix on the front end…but it doesn’t fix the back end when you try to edit the item
    ———
    An error has occurred.
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE `catid` = 0 ORDER BY ordering’ at line 3 SQL=SELECT Array,Array FROM WHERE `catid` = 0 ORDER BY ordering
    —-

    Any thoughts?

  2. Comment by Fadi — March 7, 2014 @ 2:52 pm

    Hi,

    Glad it worked for you on the frontend. This fix is actually not for the backend – it seems you have another problem there. Please contact us directly with your problem and we’ll fix it for you!

  3. Comment by Greg — May 29, 2014 @ 8:05 am

    I’m so glad I found this. I’ve used your fix but I think I have the path wrong to the query libraries

    unset($arrHead['scripts']['//pubic_html/davidmorgans/media/system/js/jquery.Jcrop.min.js']);

    Is this correct?

    Also the default.php file you listed exists actually under /components/com_rokquickcart/views/rokquickcart/tmpl/default.php

    Can you help? When I click add to cart it just seems to link to the same page.

    Thanks in advance! Greg

  4. Comment by Fadi — June 16, 2014 @ 8:34 am

    Hi Greg,

    Can you load your website on Google Chrome and check (in the console) for any JavaScript errors (especially when you click that “Add to Cart” button). Please try it and post back here.

  5. Comment by Andres — September 22, 2014 @ 4:04 pm

    Hi!

    I’m having a little problem with my RokQuickCart. In Google Chrome it works fine, but in other web browsers as Mozilla Firefox it doesn’t works. When I click in “Add to cart” doesn’t add anything.

Leave a comment