AlighaThor Posted June 28, 2019 Share Posted June 28, 2019 Hi again community. I managed to make my own custom field for the checkout form, specially to the section Delivery Address. I did this: 1 - I added my custom field to the DB into the Address table. 2 - I modified the CustomerFormatterAddress file to display my custom field: $format['custom_final_customer'] = (new FormField) ->setName('custom_final_customer') ->setType('checkbox') ->setLabel( $this->translator->trans( 'I want my invoice as End Consumer', [], 'Shop.Forms.Labels' ) ); 3 - I modified the Address model file: //Custom Fields public $custom_final_customer = 0; 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), //Custom fields 'custom_final_customer' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool') My field is displaying correctly in the front office: But two things: 1 - I don't know when even start to make that field into de position/order I want in that form. 2 - I assumed that maybe in BO / Countries / My country / Address Format, I could order my custom field like does the default fields, but nope. While my custom field is properly listed in the Address section inside the Address Format fields to add, my front office looks even worst: The final result: Thanks in advance. Link to comment Share on other sites More sharing options...
Ikk3 Posted September 30, 2022 Share Posted September 30, 2022 I would like to know solution too... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now