I have the following links in my header:

  • Account
  • Wishlist
  • Search
  • Cart

They're all working properly, except fot the cart link. Whenever the link is pressed, the console shows the following error:

Uncaught Error: Syntax error, unrecognized expression: http://myshop.com/checkout/cart/

The error refers to a Sizzle error function in a jQuery 1.10.2 script, I've looked through the script but there are multiple Sizzle scripts.

The link is called as followed in minicart.phtml

<a href="<?php echo Mage::getUrl('checkout/cart')?>" class="skip-link skip-cart <?php if($_cartQty <= 0): ?> no-count<?php endif; ?>">

Does anybody have any ideas what may cause this error?

  • do you have an onclick event somewhere close to your link?
    – Marius
    Sep 24, 2014 at 10:16
  • No, There are only href's used Sep 24, 2014 at 10:18

3 Answers 3


Tested, and no syntax error, check the classes and js that control

<a href="<?php echo Mage::getUrl('checkout/cart')?>" class="skip-link skip-cart <?php if($_cartQty <= 0): ?> no-count<?php endif; ?>">Cart</a>

It turned out that the class "skip-link skip-cart" triggerd a jQuery function which caused the error

  • Those classes are required if you want the pop up to appear when you click on the 'Cart' link like in the RWD demo theme. Removing them will just mean that clicking 'Cart' just takes you to the cart page which is not a solution to the problem as it differs from how the default theme is intended to work.
    – zigojacko
    Nov 3, 2015 at 13:17

I recently encountered this issue in the following scenario:-

  • mod_pagespeed was in use (and merged javascript).
  • The extension Ajax Pro was in use (by Templates Master).
  • Custom theme was based on the RWD theme.

At first, I thought this was going to be caused by the incorrect order of javascript in the merging of this via mod_pagespeed but disabling mod_pagespeed and the third party extension did not resolve.

The issue was in fact down to differences in the theme's loading of jQuery that differed from the default version of that Magento (i.e. where Magento has been updated but the theme's specific files had not to reflect the current version of Magento being run).

For example, the theme's app.js file differed from the default version packaged with the current Magento version.

Just simply check all the loading of javascript in your theme's page.xml against the version from a fresh download of the version of Magento installed ensuring that it matches exactly and update your theme specific js one by one (be careful not to overwrite any custom modifications), specifically, app.js.

  • To further add to this answer, it is likely that this boils down to one of the flaws using the downloader (Magento Connect) to upgrade Magento versions.
    – zigojacko
    Mar 15, 2016 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.