2017-07-26 65 views
1

以前使用bigcommerce时,我们可以选择是否弹出窗口或在用户点击“添加到购物车”按钮时将用户带到购物车。有谁知道这个功能是否已被BigCommerce取走,或者我现在可以在哪里找到该设置?谢谢!Bigcommerce加入购物车弹出式菜单

+0

您是使用模具还是蓝图? – Alyss

+0

@Alyss我正在使用模板 – gBasgaard

回答

0

嗨你需要这样做:

登录到管理端,然后去商店设置

2.从顶部的标签选择显示选项卡

3。找到'添加到购物车'操作选择你想要的弹出窗口或重定向到购物车页面。

4.点击保存按钮。

检查图像:

enter image description here

感谢

+0

感谢您的详细解答Raj,但似乎我的项目有一个新的或不同的版本后端。我不再在“显示”选项卡中显示该选项。 – gBasgaard

1

你知道,如果你正在使用的模板或蓝图框架?

如果您使用的是蓝图,您可以转到“存储设置>存储设置>显示”,然后选择“将它们带到购物车”。

如果您使用模具,该功能是隐藏的,您必须进行定制才能使其工作。如果您的产品没有任何选项,您可以按照此页上的说明操作:https://support.bigcommerce.com/articles/Public/How-can-I-add-a-product-to-the-cart-with-a-link/#add-to-cart

但是,如果你有选择,这将无法正常工作,因为它没有更新url中的sku。我所做的工作是编辑product-details.js

首先,您需要下载主题才能编辑js文件。然后,开始在line 234,你会看到下面的代码:

// Open preview modal and update content 
if (this.previewModal) { 
    this.previewModal.open(); 
    this.updateCartContent(this.previewModal, response.data.cart_item.hash); 
} else { 
    this.$overlay.show(); 
    // if no modal, redirect to the cart page 
    this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart); 
} 

直接在注释中,添加/ *然后再往一行else语句(})的右大括号下,并添加* /关闭长期评论。代码现在看起来像这样:

// Open preview modal and update content 
/* 
if (this.previewModal) { 
    this.previewModal.open(); 
    this.updateCartContent(this.previewModal, response.data.cart_item.hash); 
} else { 
    this.$overlay.show(); 
    // if no modal, redirect to the cart page 
    this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart); 
} 
*/ 
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart); 

让我知道这是否有帮助!