User register override - variables not stored

Author Message

Nuno Portugal

Sunday 26 November 2006 10:23:20 am

Im overriding user register for a shop user that buys a subscription to the website and for that he must register has a "normal user" but i dont want him to fill again the all form, so im using information of his shop account to pass this information to the user register. I solved it copying some code from user register.tpl into orderview.tpl wich is the final step of any buy. Had to include register.php in orderview.php so the functionas are called correctly.

Has the loop woldnt solve my problem took this code from documentation and made some alteration so it may suite my conditions. Login Password and email are stored in database and the user is created but all other information never reaches the database, but i can see it's there for the line {$order.account_information.first_name} displays the correct information

{$content_attributes[13].contentclass_attribute.name} {attribute_edit_gui attribute=$content_attributes[13]}<br>
{$content_attributes[14].contentclass_attribute.name} {attribute_edit_gui attribute=$content_attributes[14]}<br>

{$order.account_information.first_name}
<input type="text" name="ContentObjectAttribute_id[]" value="{$order.account_information.first_name}" />
<input type="text" name="ContentObjectAttribute_id[]" value="{$order.account_information.street2}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$order.account_information.zip}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$order.account_information.place}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$content_attributes[13].id}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$content_attributes[14].id}" />

Can anybody tell me wat is wrong ? I'm not a programmer but the code seems to be correct and it shows all the informations...

Nuno Portugal

Wednesday 06 December 2006 4:13:38 am

Solved it

In orderview.tpl just added this code to make possible user register after payment. The user chosses is password and login, every other atributes are taken from userregister(shop) from that was asked in confirmorder.

{$content_attributes[13].contentclass_attribute.name} {attribute_edit_gui attribute=$content_attributes[13]}<br>
{$content_attributes[14].contentclass_attribute.name} {attribute_edit_gui attribute=$content_attributes[14]}<br>

<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[0].id}" value="{$order.account_information.first_name} {$order.account_information.last_name}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[1].id}" value="{$order.account_information.street2}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[2].id}" value="{$order.account_information.zip}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[3].id}" value="{$order.account_information.place}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[4].id}" value="{$order.account_information.datanasc}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[5].id}" value="{$order.account_information.naturalidade}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[6].id}" value="{$order.account_information.bi}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[7].id}" value="{$order.account_information.contribuinte}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[8].id}" value="{$order.account_information.telefone}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[9].id}" value="{$order.account_information.telemovel}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[10].id}" value="{$order.account_information.localtrabalho}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[11].id}" value="{$order.account_information.habprofissional}"/>
<input type="hidden" name="{$attribute_base}_ezstring_data_text_{$content_attributes[12].id}" value="{$order.account_information.catprofissional}"/>
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$content_attributes[13].id}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$content_attributes[14].id}" />
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$content_attributes[15].id}" />

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.