Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3356758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:33:05+00:00 2026-05-18T02:33:05+00:00

Alright, so I’ve successfully added a custom order field to my page layout in

  • 0

Alright, so I’ve successfully added a custom order field to my page layout in magento. I require a “dealer” from which the user has to select a “dealer state” and then I use ajaxt to pull in all the dealers from that specific state into another field called “dealerid”. The value of this field is in fact the dealer id in my database. My question is kind of a full one.

First, I need to add a field to the “order table” that saves the dealer id for the specific order and secondly I need to actually have magento take this field from the form and insert it. How do I go about doing these things? Mainly, what table would magento store this dealerid and what files do I modify to actually have magento access and insert this field value?

Note: I am using the one page checkout method only.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:33:05+00:00Added an answer on May 18, 2026 at 2:33 am

    First of all, familiarize yourself with magento SQL update mechanism (its diffrent when your dealing with EAV – like customer tables – and regular tables – like orders). Create a module which will have a sql-update script in /YourNamespace/YourModule/sql/yourmodule_setup/mysql4-install-1.0.0.php for instance. You should use something like:

    $installer = $this;
    $installer->getConnection()->addColumn($installer->getTable('sales/order'), 'dealerid', 'decimal(12,4) NULL');
    

    and in your config.xml:

    <global>
    (...)
           <models>
           (...)
               <yourmodule>
                   <class>Mage_Sales_Model</class>
                   <resourceModel>yourmodule_mysql4</resourceModel>
               </yourmodule>
               <yourmodule_mysql4>
                   <class>YourNamespace_Yourmodule_Model_Mysql4</class>
                   <entities>
                       <order><table>sales_order</table></order>
                   </entities>
               (...)
               </yourmodule_mysql4>
           (...) 
           </models>
           <resources>
                <yourmodule_setup>
                    <setup>
                        <module>YourNamespace_YourModule</module>
                        <class>YourNamespace_YourModule_Model_Mysql4_Setup</class>
                    </setup>
                </yourmodule_setup>
            </resources>
    (...)
    </global>
    

    Remember to create your own classes: YourNamespace_YourModule_Model_Mysql4_Setup, YourNamespace_Yourmodule_Model_Mysql4. Check in app/code/core/Mage/Sales/ how they should look like (nothing special needed there, they just must inherit from proper core classes). Also check out the app/code/core/Mage/Sales/sql and app/code/core/Mage/Sales/etc/config.xml.

    If you want to get a field from the onepage checkout, you must do a couple of things… I don’t know what you really need from the user (and in what part of checkout its going to be taken). Adding an input is done by the templates (edit proper files in app/design/frontend/yourskin/default/template/checkout).

    To capture the right data you must rewrite the checkout controller whit your own controller action (look at the app/code/core/Mage/Checkout/Controllers/OnepageController.php) to get the data from the form and store it in the checkout session. After that you must hook to the checkout_type_onepage_save_order_after event (its in the app/code/core/Mage/Checkou/Model/Type/Onepage.php), take the data from your session and put it in the Order model (and save it of course). Its kind of a standard procedure, so you shouldn’t have a problem.

    Its possible that you will also have add a column to the sales_flat_order (the structure of order tables changed in 1.4.x.x, so I’m not sure of it – you will have to do some experimenting).

    If you want to see it in the adminhtml order view, you will have to override some Core/Adminhtml/Blocks/Sales/Order (and templates probably).

    Its kind of a complex procedure, so you’ll have to figure out some things by yourself. This post is kind of a general idea how it should be done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I have a class EIR which is a List based from its base
Alright, I have a UIView which displays a CGPath which is rather wide. It
Alright, here is my problem i'm trying to solve. I have an index page
Alright, hoping someone can help. I've got a page used to search for employees.
Alright, I'm having a little trouble getting 7-zip to execute from VB. Here's my
alright, I'm trying something which should be like really easy. Here it is: usort($newarr,
Alright so i have been working on this Dynamic load of a spinner from
Alright. I have several queries <?php // Make a MySQL Connection mysql_connect(mm.hostname.net, user, pass)
Alright, I am trying to accomplish this: When a user clicks a button that
Alright, switching from working Hpricot to Libxml-ruby due to speed and well the disappearance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.