html - 如何将 "add to shopping cart"按钮重定向到另一个页面?

标签 html shopping-cart business-catalyst

我想在购物者将商品添加到购物车后将其重定向到主购物页面。我正在使用 Business Catalyst 来构建购物车,我发现这个问题有很多过时的解决方案,但新的解决方案并不多。

这是按钮现在的样子:

<input class="productSubmitInput" name="AddToCart_Submit" type="submit" value="Purchase Now" onclick="AddToCart(150613,5623468,'',4,'','',true);return false;" />

我该怎么办?

最佳答案

来自 BC 的旧知识库

Refreshing the page after adding a product to a cart

Add this code in the Site-Wide Template that your shopping cart is using (or link to this JavaScript in an external .js file).

<script type="text/javascript">
function AddProductExtras(){
document.location.reload(true);
}
</script>

刚刚测试过,

function AddProductExtras() { $('input[name="AddToCart_Submit"]').on('click',document.location.replace('/products')); }

关于html - 如何将 "add to shopping cart"按钮重定向到另一个页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31711316/

相关文章:

html - 如何创建两个彩色的单个div?

c# - 如何使用另一个类中的方法添加到 ListBox?

content-management-system - 是否可以在 Adob​​e Business Catalyst 中确定产品订单的优先级?

jquery - Onclick删除cookie并刷新当前页面

html - Photoshop 和 CSS3 背景阴影

javascript - 改变 <select> 的背景颜色

当 url 附加 #name 时的 Javascript 函数

php - 如何从 Controller 加载 magento View (.phtml) 文件

java - 从头开始开发购物车的最佳实践