Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Onepage checkout problem - Save order
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 

I’ve added a field to the address in my onepage checkout. No user registration needed, only guest can place orders.

So, i copied the code from the field “postcode”, created the rows in the db as so…

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
    
$AttrCode 'taxcode';
    
$settings = array (
        
'position' => 1,
        
'is_required'=> 0,
    );
    
$setup->addAttribute('1'$AttrCode$settings);

INSERT INTO `magento`.`eav_entity_attribute` (
`
entity_attribute_id` ,
`
entity_type_id` ,
`
attribute_set_id` ,
`
attribute_group_id` ,
`
attribute_id` ,
`
sort_order`
)
VALUES (
'457''2''2''2''457''90'
);



INSERT INTO `magento`.`eav_entity_attribute` (
`
entity_attribute_id` ,
`
entity_type_id` ,
`
attribute_set_id` ,
`
attribute_group_id` ,
`
attribute_id` ,
`
sort_order`
)
VALUES (
'458''12''12''16''458''90'
);

Now my problem is that magento store the field only in the table sales_flat_quote_address, but not in the sales_order_entity_varchar one. So, i can’t get this value from the admin area…

Somebody knows why?

I post 2 attachment.

Image Attachments
magento_tabella.JPGmagento_tabella2.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 

Solved. checkout.xml error: needed <to_order>1</to_order> in taxcode node…

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

I am trying to do a similar thing and stumbled upon your post. Currently I am trying to update a custom order attribute in the db but to no success.

When you say checkout.xml do you mean the layout xml?

Also, taxcode node in checkout.xml, how would that be coded?
would it look like the following:

<taxcode><to_order>1</to_order></taxcode>

And where would the taxcode node be located in checkout.xml?

Thanks for any light you can shed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 
seudo? - 05 November 2008 02:27 PM

I am trying to do a similar thing and stumbled upon your post. Currently I am trying to update a custom order attribute in the db but to no success.

When you say checkout.xml do you mean the layout xml?

Also, taxcode node in checkout.xml, how would that be coded?
would it look like the following:

<taxcode><to_order>1</to_order></taxcode>

And where would the taxcode node be located in checkout.xml?

Thanks for any light you can shed.

Here’s is the final solution after 1 week of work… http://code.google.com/p/magento-codice-fiscale/

For me it’s now difficult to explain all the changes i’ve made, i don’t remeber all of those. I suggest you to do a compare between my code and official core and merge where you find the key word “taxcode”.

In your case, you could check only xml files to understand where you should put your “to_order” config…

If you want, add me to msn messenger (matteopuppis@yahoo.it) and i’ll try to explain even if i don’t speak english well… .wink

Now i’m at work, so i’ll reply as soon as possible.

Bye.

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@mattoweb - thank you very much. I will compare and get back to you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

Hi ,

Can anybody explain me what does this <to_order> tag do ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 
prionko - 06 March 2009 04:47 AM

Hi ,

Can anybody explain me what does this <to_order> tag do ???

The node <to_order> assign a specific attribute (customer’s field, shipping address’s field, any attribute you want....) to the order’s “data collector”. By this way, when you have an object of type order (es.: $order = $this->getOrderById(1);, or something similar, now i don’t rember exacly...), do a var_dump of $order and you’ll see it contains also that specific field.

You can deduct this by searching term “<to_order>” into all *.xml files… wink

Bye.

 
Magento Community Magento Community
Magento Community
Magento Community
 
prionko
Jr. Member
 
Total Posts:  21
Joined:  2009-03-04
 

Thanks for the info Matteoweb,

Im a complete newbie in magento, and Im trying to figure the xml configurations of magento, especially related to config.xml of the various models. Can you tell me if I will find some good links for this? I googled a lot, but didnt get any information.

Thanx once again !!

 
Magento Community Magento Community
Magento Community
Magento Community
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 
prionko - 06 March 2009 05:14 AM

Thanks for the info Matteoweb,

Im a complete newbie in magento, and Im trying to figure the xml configurations of magento, especially related to config.xml of the various models. Can you tell me if I will find some good links for this? I googled a lot, but didnt get any information.


Thanx once again !!

http://www.google.it/search?hl=it&client;=firefox-a&rls;=org.mozilla&#x3A;it&#x3A;official&hs;=zLb&q;=site&#x3A;www.magentocommerce.com+modules+xml&btnG;=Cerca&meta;=

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top