cancel
Showing results for 
Search instead for 
Did you mean: 

Adding fields to custom shipping method

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Adding fields to custom shipping method

Hello,

 

I would like to create a custom shipping module for Magento 2, but I am actually a complete Magento beginner.

 

I found this GitHub repository which provides a great starting point : https://github.com/MagePsycho/magento2-custom-shipping.

 

The first thing I need to do is to add some extra fields to the checkout page when my shipping method is selected.

 

Could help me understand how I should modify the code on this repository in order to add my extra fields (checkboxes, datefields...) ?

 

I tried to use this :

 

http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html

 

But I had a Javascript error because of the " %your_module_dir% " part : my module is in MagePsycho/Customshipping/ so I replaced %your_module_dir% with MagePsycho/Customshipping/, but it didn't work.

Moreover I only need my extra field to be visible when my custom shipping method is selected, so I'm not sure this tutorial is appropriate.

 

Thank you very much !