1

I am currently working with Magento 1.9.0.1

I am searching information about how can i add a custom comment box bellow an existing shipping method in the checkout page where you can put any text.

After that when the user submits the order, you can see that text reviewing the order in the admin panel bellow the name of the chosen shipping method.

For example i am trying to add that to the default Table Rates method which comes with Magento. Yes i know it is not good to modify a default modules but i want to add this feature to exactly this module.

So can you help me out, step by step guide to how must be done with code examples or any links with information regarding my question.

Thanks in advance!

2 Answers 2

4

You can get help from here ->>
http://excellencemagentoblog.com/blog/2011/10/06/magento-add-custom-fields-checkout-page/
or
https://indiestechtips.wordpress.com/2011/07/30/how-to-add-custom-field-in-the-billing-and-shipping-address-of-onepage-checkout-in-magento/
or
How to add custom fields to custom shipping method(at onepage checkout)?

2
  • This seems very helpful: tutorialsformagento.blogspot.in/2014/06/… . Thank you for the links. I'm going to ask here if i face any problem while developing it. Commented Sep 10, 2015 at 13:53
  • The third link gives a similar example with step by step I described in my answer, I believe this really going to help you. Thanks @Arunendra Commented Sep 11, 2015 at 16:04
3

To do this you will need to change some things in the standard method (not hack the core - make via rewrite) or create a new module (I recommend this way). So:

#1 You need to keep this comment somewhere in your database. There are a few ways to do this, I will mention some of them: You can create a new one attribute in the application and use it for this purpose. Or add this message as a comment in history order (I would do this).

#2 You need a form. I can not say what is the best way because there is no standard form for a block rate of a shipping method on Magento, but you need an input to collect this information.

#3 Save the message comment somewhere to the purchase order is created. For both examples I cited above in # 1 you could save the comment in the session (eg quote or custom variable) and use the place_order event (observer) to save the comment in correct storage (attribute order or create a new comment).

#4 Display the comment in sales order view. If you choose to create a standard comment in order, you already have this view in the comment history. If you make a new attribute, you need to add this information to your adminhtml theme.

I do not have sample code because I could not develop it to test but I believe taking these steps you will do well.

Not the answer you're looking for? Browse other questions tagged or ask your own question.