简体   繁体   中英

Internet Explorer jQuery Redirect

I am currently working on http://thetradinghouse.co.nz and I have an issue when accessing the cart the process that is taken is.

  • Select Category.

  • Select a product and open the products page.

  • Click add to cart.

  • The product adds to the cart but the page redirects to the category page with the uri http://www.thetradinghouse.co.nz/sporting-goods/index.php?route=checkout/cart

The above step should just load http://www.thetradinghouse.co.nz/index.php?route=checkout/cart Like it does in Chrome and Firefox

I am using the following SEO Module and have been in contact with the developer whom I have stumped with this issue.

Here is a link to my product.tpl and common.js as it was too big to implement here.

I looks like IE is interpreting your redirect poorly. I'd try swapping

121: window.location.href = 'index.php?route=checkout/cart';

with an absolute url:

window.location.href = 'http://www.thetradinghouse.co.nz/index.php?route=checkout/cart'

The best fix for this is to do the following

Open /catalog/view/javascript/common.js

Find the addToCart function in that file, and then find the first instance of

window.location.href = 'index.php?route=checkout/cart';

after it. Change that line to

window.location.href = $('base').attr('href') + 'index.php?route=checkout/cart';

Save, and upload to your server via FTP if necessary

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM