如何解决订单未出现在管理面板 shopify 中,但已在 Paypal 中注册
我在我的单个产品页面上添加了第二个自定义 Paypal 按钮,以便为我的用户关闭动态付款按钮。
我成功地做到了这一点,按钮工作并且收到了 Paypal 中的付款。
但是,我有一个问题是客户下的订单没有在管理面板仪表板(Shopify)中注册,所以我的物流
也能看到。我的代码
product-template.liquid
就这样
按钮代码
<div class="product-single__add js-product-buttons{% unless product.available %} product-single__add--sold{% endunless %}">
<button type="submit" name="add" class="c-btn c-btn--full c-btn--plus c-btn--{% if section.settings.enable_payment_button %}light{% else %}primary{% endif %} product-single__add-btn js-product-add">
<span class="js-product-add-text">{{ 'products.product.add_to_cart' | t }}</span>
</button>
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
</div>
{% endform %}
<!-- Set up a container element for the button -->
<!--<div id="paypal-button-container"></div> -->
</div>
{% endform %}
<!-- Set up a container element for the button -->
<div id="paypal-button-container"></div>
我的 javascript 是这样的
<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({
// Set up the transaction
createOrder: function(data,actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: {{product.price | dividedby: 100.0 }}
}
}]
});
},// Finalize the transaction
onApprove: function(data,actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
</script>
由于我是 Shopify 的新手,所以我应该在现有的 javascript 中实现一个事件或函数。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。