BigCommerce - Custom Shipping Method (RoyalMail Widget for Collect Location)

狂风中的少年 提交于 2020-01-16 15:52:26

问题


I would like to setup custom shipping option using RoyalMail collect widget so customer can go through widget and it would return address after customer selection. So we need to map those address fields with customer shipping address fields.

I have tried with checkout-js-sdk but it required considerable effort to create customm checkout from scratch. I am aiming to have a solution to map widget with BigCommerce shipping method using JavaScript or Angular Js.

    window.language = {{ langJson 'optimized_checkout' }};      
    widgetConfigObj = {
        viewingOptions:['Grid'],
        royalMail: { getRMId: function () { return 'key' } },
        deliveryPostCode: 'NG11DB',
        defaultRadius: 10,
        defaultNbrOfResults: 10,
        onOpenWidget: function () {
            //document.getElementById('checkout').disabled = true;
        },
        onLocationSelected : function(localCollect) {   
            console.log(location.organisationName);                
        },
        onCancelSelection : function() {/*a call back in case of cancelation*/},
    };
    var stopMusicExt = document.getElementsByClassName('optimizedCheckout-form-checklist-item')[2];
    stopMusicExt.onclick = localCollectSelected(widgetConfigObj);
</script>```

来源:https://stackoverflow.com/questions/55346169/bigcommerce-custom-shipping-method-royalmail-widget-for-collect-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!