Javascript 订单不会出现在管理面板shopify中,但已在Paypal中注册
我在我的单一产品页面上添加了第二个自定义Paypal按钮,以便为我的用户关闭动态支付按钮 我成功地做到了这一点,按钮的工作和支付贝宝收到 但是,我有一个问题,那就是客户的订单没有在管理面板仪表板(Shopify)中注册,因此我的物流 我也能看到。我的密码在 产品-模板-液体 是这样的Javascript 订单不会出现在管理面板shopify中,但已在Paypal中注册,javascript,paypal,shopify,express-checkout,shopify-template,Javascript,Paypal,Shopify,Express Checkout,Shopify Template,我在我的单一产品页面上添加了第二个自定义Paypal按钮,以便为我的用户关闭动态支付按钮 我成功地做到了这一点,按钮的工作和支付贝宝收到 但是,我有一个问题,那就是客户的订单没有在管理面板仪表板(Shopify)中注册,因此我的物流 我也能看到。我的密码在 产品-模板-液体 是这样的 <script> // Render the PayPal button into #paypal-button-container paypal.Buttons({
<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>
按钮代码
<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>
{{'products.product.add_-to_-cart'|t}
{%if section.settings.enable_payment_button%}
{{表格|付款按钮}
{%endif%}
{%endform%}
{%endform%}
我的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>
//将PayPal按钮渲染到#PayPal按钮容器中
贝宝,按钮({
//设置事务
createOrder:函数(数据、操作){
return actions.order.create({
购买单位:[{
金额:{
值:{{product.price |除以:100.0}
}
}]
});
},
//完成交易
onApprove:功能(数据、操作){
返回actions.order.capture().then(函数(详细信息){
//向买家显示成功消息
警报(“+details.payer.name.given_name+”!”完成的交易);
});
}
}).render(“#贝宝按钮容器”);
由于我是Shopify的新手,所以我应该在现有javascript中实现一个事件或函数。Shopify中的PayPal支付是预先构建的。因此,任何建立在默认可用支付之上的定制贝宝支付都将独立工作。因此,订单履行将被错过 您还可以在Shopify管理员中手动创建订单,以记录您在Shopify之外的订单,或向客户发送发票 请参考这个
谢谢。Shopify中的PayPal支付是预构建的。因此,任何建立在默认可用支付之上的定制贝宝支付都将独立工作。因此,订单履行将被错过 您还可以在Shopify管理员中手动创建订单,以记录您在Shopify之外的订单,或向客户发送发票 请参考这个 谢谢