Reputation: 298
I have the following links in my header:
They're all working properly, except for 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?
Upvotes: 0
Views: 911
Reputation: 3127
I had the same issue. However, I found that it was a caching issue after upgrading from Magento CE 1.9.0 to 1.9.1. The wrong app.js file was being used.
I had to clear all the Magento cache, browser cache and CDN (CloudFlare) cache to get it to work.
Upvotes: 1
Reputation: 453
It is because of the class name "skip-link". If you need to redirect to the cart page, you remove this class name from the tag and it will work. "skip-link" is used to show the content near to that link instead of redirecting to other page. If we use "skip-link", then the href attribute will have some identifier value like "#header-top"(it will be id of some hidden div or span) or something like that. That's why the js error happens, because it is trying to parse the href parameter as an element's id which is not in right syntax in this case.
Upvotes: 2