Two create account forms: companies and individuals
Hello!
I'm configuring a shop for a friend and I'm stuck investigating how can I have two create account forms, one for companies and one for individuals.
because of the companies form have many compulsory fields I can't use the admin option to enable the company field of the form, so I think the ideal would be to have this two separate forms.
I'm using 1.3.6 zencart version.
Any clues on which way I should go?
thank you very much! :wink:
Re: Tow create account forms: companies and individuals
First, leave 1.3.6 for 1.3.8a with ALL security updates. A friend wouldn't let a friend use an older version.:P
Secondly, you might find Dual Pricing helpful. Of course, it is designed for 1.3.8a.
Re: Tow create account forms: companies and individuals
Thanks for your reply, dbltoe :smile:
Unfortunately, I can't upgrade because of my hosting only supports 1.3.6 version (there aren't many spanish zencart hosting) :(
I was thinking to work on the files involved on create_account to duplicate them and renaming them as xxxx_individuals, for instance, and redirect my individuals login box link to a index.php?main_page=login_individuals.
To do that, I think I need to know which are the flow of index.php?main_page=login, I mean which are the files that call it. But I'm not sure of what are these files.
Do you think is a good idea to work like this?
Another possibility I've been thinking of is creating the fields I need for the two types of customers in the default form, and hide the fields for one or other type of customers depending on what link (company login or singular login) is selected.
But I'm not sure what can be better.
thanks in advance!
regards
Re: Tow create account forms: companies and individuals
Hello again,
I created some custom forms on the create account page in order to differentiate wholesale from individuals.
I create a radio button that allows select if the customer is wholesale or individuals.
The fact is that I need to hide the wholesale custom fields in the create account form if the option "individuals" is cheked.
I add an onChange method that fires a javascript function in an option button input with a class="hide" in css. It seems that all is right but doesn't work. The problem is that zencart is unable to find the function. I have tried putting it in includes/modules/pages/create_account/jscript_addr_pulldowns.php and in includes/modules/pages/create_account/jscript_form_check without success, the mozilla firebug still says that the funtion is not defined.
The function is:
Code:
function update_screen(valor) {
var conjunto = document.getElementById('datos_empresa');
alert("pp");
if (valor == 'Tienda' {
conjunto.className='hide';
} else {
conjunto.className='';
}
}
This is the radio button code:
Code:
<fieldset>
<legend><?php echo TABLE_HEADING_TIPO_DETAILS; ?></legend>
<?php
if (TIPO_CLIENTE == 'true') {
?>
<?php echo zen_draw_radio_field('tipologia_cliente', 'Tienda', '', 'onChange="return update_screen(this.value);" id="tipologia_tienda"') . '<label class="radioButtonLabel" for="tipologia_tienda">' . TIENDA . '</label>' . zen_draw_radio_field('tipologia_cliente', 'Particular', '', 'onChange="return update_screen(this.value);" id="tipologia_particular"') . '<label class="radioButtonLabel" for="tipologia_particular">' . PARTICULAR . '</label>' . (zen_not_null(ENTRY_TIPO_TEXT) ? '<span class="alert">' . ENTRY_TIPO_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
Any clues of where do I have to put the function to make it work??
Thank you very much in advance!
Regards
Re: Tow create account forms: companies and individuals
no mather
finally I have solved the problem putting the code directly in the tpl_modules_create_account.php
:clap:
bye!
Re: Tow create account forms: companies and individuals
Now please spend your time looking for a host that allows 1.3.8a. Otherwise, you WILL be hacked eventually without the fixes in 1.3.8.:(
Re: Tow create account forms: companies and individuals
Quote:
Originally Posted by
Llama de Anor
no mather
finally I have solved the problem putting the code directly in the tpl_modules_create_account.php
:clap:
bye!
Hi Llama de Anor,
Where abouts in the file did you put the code? I'm looking for the same effect.