简体   繁体   English

如何使用模糊打印主题脚本转换为bigcommerce模板Framwork格式?

[英]How to use blurprint theme script into bigcommerce stencil Framwork format?

My questions simple. 我的问题很简单。 I just want to use below javascript code into the stencil framework format 我只想使用下面的javascript代码转换成模具框架格式

<script type="text/javascript">
$(document).ready(function() {
var CartTotal = '%%GLOBAL_CartItemTotal%%';
var CustomerGroup = '%%GLOBAL_CustomerGroupName%%';
var CartTotal = CartTotal.replace('$','');
var CartTotal = CartTotal.replace(',','');
if(CartTotal >= 100.0) {
$('.CartTotalMessage').hide();
}
else {
if (CustomerGroup == "Wholesale") {
$('.ProceedToCheckout').hide();
$('.PayPalExpressCheckout').hide();
$('#CartHeader h2 img').hide();
$('.btn-secondary').hide();
$('a[title="Click here to proceed to checkout"]').hide();
}
else {
$('.CartTotalMessage').hide();
}
}
});
</script>

It's not working in stencil format I know there is need to use objects of stencil big. 它不能以模具格式工作,我知道需要使用较大的模具对象。 format i have replaced %%GLOBAL_CartItemTotal%% into {{cart.grand_total}} and %%GLOBAL_CustomerGroupName%% into {{customer.customer_group_name}} but it's not working to hide checkout button untill order above $100 I need your help how I can achieve this. 格式我已将%% GLOBAL_CartItemTotal %%替换为{{cart.grand_total}},并将%% GLOBAL_CustomerGroupName %%替换为{{customer.customer_group_name}},但是直到$ 100以上的订单都无法隐藏结帐按钮,我需要您的帮助实现这一目标。

yes I have solved my problem convert js above like this 是的,我已经解决了我的问题,像上面这样转换js

<script type="text/javascript">
$(document).ready(function() {
var CartTotal = '{{cart.grand_total.formatted}}';
var CartTotal = CartTotal.replace('$','');
var CartTotal = CartTotal.replace(',','');
console.log(CartTotal);
if(CartTotal >= 100.0) {
   $('.CartTotalMessage').hide();
}
else {
  $('.CartTotalMessage').show();
  $('.PayPalExpressCheckout').hide();
  $('#CartHeader h2 img').hide();
  $('.btn-secondary').hide();
  $('a[title="Click here to proceed to checkout"]').hide();
}
});

Thanks for help 感谢帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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