Showing results for 
Search instead for 
Did you mean: 

How to recieve custom data from frontend to shipping method on checkout

How to recieve custom data from frontend to shipping method on checkout

Hello everyone!


How can i recieve custom data (array or json) from frontend to custom shipping method? On frontend, when I check shipping method, I have map with select delivery point option. When I need to recieve selected point data to my shipping method. How can I do that?

I was create observable object in quote object (quote.pickPoint) and set point data to it. But I can not add this data to payload and get it in CollectRates method in my shipping method.

Please help anyone! Thanks beforehand.


My code:


return Component.extend({
: ko.observable(false) }

/js/view/modal.js (show modal with pickpoints map)

window.onPointSelected = function (data) {
   //Data ricieved from shipping carrier
   var pointData = {
city: data['city'],
region: data['region'],
address: data['address'],
deliveryCost1: data['deliveryCost1'],
deliveryCost2: data['deliveryCost2'],
deliveryCost3: data['deliveryCost3'],
deliveryCost4: data['deliveryCost4'],
deliveryCost5: data['deliveryCost5'],
deliveryCost6: data['deliveryCost6'],
deliveryCost7: data['deliveryCost7'],
deliveryCost8: data['deliveryCost8'],
hash: data['hash'],
hash8: data['hash8'],
hash16: data['hash16'],
name: data['name'],
returnCost1: data['returnCost1'],
returnCost2: data['returnCost2'],
returnCost3: data['returnCost3'],
returnCost4: data['returnCost4'],
returnCost5: data['returnCost5'],
returnCost6: data['returnCost6'],
returnCost7: data['returnCost7'],
returnCost8: data['returnCost8'],
shopId: data['shopId'],
deliveryOperatorId: data['deliveryOperatorId'],
deliveryOperator: data['deliveryOperator'] };

quote.pickPoint(pointData); //Trigger hack for rates reload: var address = quote.shippingAddress();
rateRegistry.set(address.getKey(), null);
rateRegistry.set(address.getCacheKey(), null);

Then I add pickPont data to payload /js/model/shipping-save-processor/default.js

return {
saveShippingInformation: function () {
payload = {
addressInformation: {
shipping_address: quote.shippingAddress(),
billing_address: quote.billingAddress(),
shipping_method_code: quote.shippingMethod().method_code,
: quote.shippingMethod().carrier_code },
pickPoint: quote.pickPoint() };


Now, how can I get pickPoint data from collectRates method of the my custom shipping carrier? This data I need for shipping cost calculation and set pickPoint address to shipping address.



Re: How to recieve custom data from frontend to shipping method on checkout

Please help anyone, I working with problem whole days without any results.
Maybe any ideas?