Internet Explorer jQuery Redirect

邮差的信 提交于 2019-12-02 05:36:08

问题


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.


回答1:


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




回答2:


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'



来源:https://stackoverflow.com/questions/8248251/internet-explorer-jquery-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!