【问题标题】:How to add multiple items onto SCA Add to Cart如何将多个项目添加到 SCA 添加到购物车
【发布时间】:2022-11-10 00:59:23
【问题描述】:

我希望在我的 Suite Commerce 高级商店中为我的产品添加保险服务。

设想:客户访问产品页面,他们喜欢他们想要的项目,但他们也想增加额外的覆盖范围。

我的想法是,如果客户选中该框,那么我可以以某种方式编辑添加到购物车功能以包含服务项目的内部 ID。

HTML

            <div class="form-check form-switch">
             <input class="form-check-input" type="checkbox" id="addwarranty" name="darkmode" value="yes">
              <label class="form-check-label" for="addwarranty"><strong>Add Warranty!</strong> <a href="#" target="_blank">Learn more</a></label>
            </div>

JS

             var wntid = "123456";
             $('#addwarranty').change(function(){
              if (this.checked) {
               //alert('warranty checked');
               // Update add-to-cart event to include wntid
              }
             });

我在购物.js文件,但它只有事件而不是函数。

我应该查看另一个 JS 文件吗?有没有办法可以从 Web 开发人员控制台获取此信息?

【问题讨论】:

    标签: jquery oracle function netsuite suitecommerce


    【解决方案1】:

    除非这是 SCA 的旧版本,否则您应该使用可扩展层来实现这一点。

    您需要下载开发人员工具、创建扩展并添加代码。

    您正在查看的方法是 Cart 组件中的“addLines”。 https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/Cart.html#addLines

    以下链接包含有关可扩展层以及如何设置开发工具的信息。

    https://developers.suitecommerce.com/getting-started.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      • 2017-07-23
      • 1970-01-01
      • 2015-10-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多