Registration Page...

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #536

Hi there,

Now first - don't laugh, but since my knowledge of PHP is well not yours and not even intermediate, I did my best...

I have modified the login_register.php file through the Views interface...

<?php
/**
 * @package		HikaShop for Joomla! 1.5
 * @version		1.2.0
 * @author		hikashop.com
 * @copyright	(C) 2010 HIKARI SOFTWARE. All rights reserved.
 * @license		http://www.hikashop.com/commercial_license.php
 */
defined('_JEXEC') or die('Restricted access');
?>
<table cellpadding="0" cellspacing="0" border="0" class="hikashop_contentpane">
<?php if(!$this->simplified_registration){ ?>
	<tr>
		<td class="key">
			<label id="namemsg" for="name">
				<?php echo JText::_( 'NAME' ); ?>:
			</label>
		</td>
	  	<td>
	  		<input type="text" name="data[register][name]" id="register_name" value="<?php echo $this->escape($this->mainUser->get( 'name' ));?>" class="inputbox required" maxlength="50" /> *
	  	</td>
	</tr>
	<tr>
		<td class="key">
			<label id="usernamemsg" for="username">
				<?php echo JText::_( 'USERNAME' ); ?>:
			</label>
		</td>
		<td>
			<input type="text" id="register_username" name="data[register][username]" value="<?php echo $this->escape($this->mainUser->get( 'username' ));?>" class="inputbox required validate-username" maxlength="25" /> *
		</td>
	</tr>
<?php }?>
<tr>
	<td class="key">
		<label id="emailmsg" for="email">
			<?php echo JText::_( 'EMAIL' ); ?>:
		</label>
	</td>
	<td>
		<input type="text" id="register_email" name="data[register][email]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" /> *
	</td>
</tr>
<?php if(!$this->simplified_registration){ ?>
<tr>
	<td class="key">
		<label id="pwmsg" for="password">
			<?php echo JText::_( 'PASSWORD' ); ?>:
		</label>
	</td>
  	<td>
  		<input class="inputbox required validate-password" type="password" id="register_password" name="data[register][password]" value="" /> *
  	</td>
</tr>
<tr>
	<td class="key">
		<label id="pw2msg" for="password2">
			<?php echo JText::_( 'VERIFY PASSWORD' ); ?>:
		</label>
	</td>
	<td>
		<input class="inputbox required validate-passverify" type="password" id="register_password2" name="data[register][password2]" value="" /> *
	</td>
</tr>


<?php }?>

	<?php 
		$this->setLayout('custom_fields');
		$this->type = 'user';
		echo $this->loadTemplate();
?>


<tr>
	<td colspan="2" height="40">
		<?php echo JText::_( 'ADDRESS_INFORMATION' ); ?>
	</td>
</tr>
<?php 
		$this->type = 'address';
		echo $this->loadTemplate();
	?>

<tr>
        <td class="key">
		<label id="address_title" for="address_title">
			<?php echo JText::_( 'TITLE' ); ?>
		</label>
	</td>

	<td>
		<select id="address_title" name="data[address][address_title]" size="1">
                <option value="Mr" id="address_title_Mr">
                <option value="Mrs" id="address_title_Mrs">
                <option value="Miss" id="address_title_Miss">
                <option value="Ms" id="address_title_Ms">
                <option value="Dr" id="address_title_Dr">
                </select>
                *
	</td>

</tr>
        <td class="key">
		<label id="firstname" for="firstname">
			<?php echo JText::_( 'FIRSTNAME' ); ?>
		</label>
	</td>
	<td>
		<input class="inputbox" id="address_firstname" type="text" name="data[address][address_firstname]" value=""/>
*
	</td>

        <td class="key">
		<label id="lastname" for="lastname">
			<?php echo JText::_( 'LASTNAME' ); ?>
		</label>
	</td>
	<td>
		<input class="inputbox" id="address_lastname" type="text" name="data[address][address_lastname]" value=""/>
*
	</td>
<tr>
        <td class="key">
		<label id="address_street" for="address_street">
			<?php echo JText::_( 'Street' ); ?>
		</label>
	</td>
	<td>
		<input class="inputbox" id="address_street" type="text" name="data[address][address_street]" value=""/>
*
	</td>

        <td class="key">
		<label id="address_city" for="address_city">
			<?php echo JText::_( 'City' ); ?>
		</label>
	</td>
	<td>
		<input class="inputbox" id="address_city" type="text" name="data[address][address_city]" value=""/>
*
	</td>

        <td class="key">
		<label id="address_state" for="address_state">
			<?php echo JText::_( 'State' ); ?>
		</label>
	</td>
	<td>

        <span id="state_dropdown">
        <select id="address_state" name="data[address][address_state]" size="1">
        </span>
        <input type="hidden" id="state_namekey" name="state_namekey" value="address_state"/>
        <input type="hidden" id="state_default_value" name="state_default_value" value="state_California_4265"/>

	</td>

        <td class="key">
		<label id="address_post_code" for="address_post_code">
			<?php echo JText::_( 'Zipcode' ); ?>
		</label>
	</td>
        <td>
		<input class="inputbox" id="address_post_code" type="text" name="data[address][address_post_code]" value=""/>

	</td>
<tr>
        <td class="key">
		<label id="address_telephone" for="address_telephone">
			<?php echo JText::_( 'Telephone' ); ?>
		</label>
	</td>
        <td>
		<input class="inputbox" id="address_telephone" type="text" name="data[address][address_telephone]" value=""/>
        *
	</td>

</tr>
</tr>
<tr>
	<td colspan="2" height="40">
		<?php echo JText::_( 'REGISTER_REQUIRED' ); ?>
	</td>
</tr>
</table>
<input type="hidden" name="data[register][id]" value="0" />
<input type="hidden" name="data[register][gid]" value="0" />
<input class="button validate" type="submit" onclick="if(hikashopCheckChangeForm('register','hikashop_checkout_form') && hikashopCheckChangeForm('user','hikashop_checkout_form') && hikashopCheckChangeForm('address','hikashop_checkout_form')) return true; return false;" name="register" value="<?php echo JText::_('REGISTER'); ?>"/>
the php code doesn't seem to show up so I've attached my login_register.php

OBVIOUSLY, the following fields don't work correctly:

Title data field and State data field.

[and how do I NOT show the Country field without breaking the country/state combination dependency]

I know I'm not too far, but it's beyond my knowledge :(


The reason that I am doing this is to have a page with a LOT shorter height for the registration section...

THANKS :)

Sorry that I'm such an idiot with PHP.

Cheers,

Emmanuel Lemor.

File Attachment:

File Name: login_register.txt
File Size:5 KB

Attachments:
Last edit: 14 years 1 month ago by exlemor.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
14 years 1 month ago #537

Hi,

You're almost there.

What you should do for both those dropdowns is copy the HTML code generated by the system and copy/paste it there.

For the title dropdown you would have:

				<select id="address_title" name="data[address][address_title]" size="1"><option value="Mr" id="address_title_Mr">Mr</option><option value="Mrs" id="address_title_Mrs">Mrs</option><option value="Miss" id="address_title_Miss">Miss</option><option value="Ms" id="address_title_Ms">Ms</option><option value="Dr" id="address_title_Dr">Dr</option></select> *

for the state dropdown you would have:
				<span id="state_dropdown">
<select id="address_state" name="data[address][address_state]" size="1"><option value="state_Alabama_4261" id="address_state_state_Alabama_4261">Alabama</option><option value="state_Alaska_4260" id="address_state_state_Alaska_4260">Alaska</option><option value="state_American_Samoa_4262" id="address_state_state_American_Samoa_4262">American Samoa</option><option value="state_Arizona_4264" id="address_state_state_Arizona_4264">Arizona</option><option value="state_Arkansas_4263" id="address_state_state_Arkansas_4263">Arkansas</option><option value="state_California_4265" id="address_state_state_California_4265">CA (California)</option><option value="state_Colorado_4266" id="address_state_state_Colorado_4266">Colorado</option><option value="state_Connecticut_4267" id="address_state_state_Connecticut_4267">Connecticut</option><option value="state_Delaware_4269" id="address_state_state_Delaware_4269">Delaware</option><option value="state_District_of_Columbia_4268" id="address_state_state_District_of_Columbia_4268">District of Columbia</option><option value="state_Florida_4270" id="address_state_state_Florida_4270">Florida</option><option value="state_Georgia_4271" id="address_state_state_Georgia_4271">Georgia</option><option value="state_Guam_4272" id="address_state_state_Guam_4272">Guam</option><option value="state_Hawaii_4273" id="address_state_state_Hawaii_4273">Hawaii</option><option value="state_Idaho_4275" id="address_state_state_Idaho_4275">Idaho</option><option value="state_Illinois_4276" id="address_state_state_Illinois_4276">Illinois</option><option value="state_Indiana_4277" id="address_state_state_Indiana_4277">Indiana</option><option value="state_Iowa_4274" id="address_state_state_Iowa_4274">Iowa</option><option value="state_Kansas_4278" id="address_state_state_Kansas_4278">Kansas</option><option value="state_Kentucky_4279" id="address_state_state_Kentucky_4279">Kentucky</option><option value="state_Louisiana_4280" id="address_state_state_Louisiana_4280">Louisiana</option><option value="state_Maine_4283" id="address_state_state_Maine_4283">Maine</option><option value="state_Maryland_4282" id="address_state_state_Maryland_4282">Maryland</option><option value="state_Massachusetts_4281" id="address_state_state_Massachusetts_4281">Massachusetts</option><option value="state_Michigan_4284" id="address_state_state_Michigan_4284">Michigan</option><option value="state_Minnesota_4285" id="address_state_state_Minnesota_4285">Minnesota</option><option value="state_Mississippi_4287" id="address_state_state_Mississippi_4287">Mississippi</option><option value="state_Missouri_4286" id="address_state_state_Missouri_4286">Missouri</option><option value="state_Montana_4288" id="address_state_state_Montana_4288">Montana</option><option value="state_Nebraska_4291" id="address_state_state_Nebraska_4291">Nebraska</option><option value="state_Nevada_4295" id="address_state_state_Nevada_4295">Nevada</option><option value="state_New_Hampshire_4292" id="address_state_state_New_Hampshire_4292">New Hampshire</option><option value="state_New_Jersey_4293" id="address_state_state_New_Jersey_4293">New Jersey</option><option value="state_New_Mexico_4294" id="address_state_state_New_Mexico_4294">New Mexico</option><option value="state_New_York_4296" id="address_state_state_New_York_4296">New York</option><option value="state_North_Carolina_4289" id="address_state_state_North_Carolina_4289">North Carolina</option><option value="state_North_Dakota_4290" id="address_state_state_North_Dakota_4290">North Dakota</option><option value="state_Northern_Mariana_Islands_4297" id="address_state_state_Northern_Mariana_Islands_4297">Northern Mariana Islands</option><option value="state_Ohio_4298" id="address_state_state_Ohio_4298">Ohio</option><option value="state_Oklahoma_4299" id="address_state_state_Oklahoma_4299">Oklahoma</option><option value="state_Oregon_4300" id="address_state_state_Oregon_4300">Oregon</option><option value="state_Pennsylvania_4301" id="address_state_state_Pennsylvania_4301">Pennsylvania</option><option value="state_Puerto_Rico_4302" id="address_state_state_Puerto_Rico_4302">Puerto Rico</option><option value="state_Rhode_Island_4303" id="address_state_state_Rhode_Island_4303">Rhode Island</option><option value="state_South_Carolina_4304" id="address_state_state_South_Carolina_4304">South Carolina</option><option value="state_South_Dakota_4305" id="address_state_state_South_Dakota_4305">South Dakota</option><option value="state_Tennessee_4306" id="address_state_state_Tennessee_4306">Tennessee</option><option value="state_Texas_4307" id="address_state_state_Texas_4307">Texas</option><option value="state_U_S__Minor_Outlying_Islands_4308" id="address_state_state_U_S__Minor_Outlying_Islands_4308">U.S. Minor Outlying Islands</option><option value="state_Utah_4309" id="address_state_state_Utah_4309">Utah</option><option value="state_Vermont_4312" id="address_state_state_Vermont_4312">Vermont</option><option value="state_Virgin_Islands_of_the_U_S__4311" id="address_state_state_Virgin_Islands_of_the_U_S__4311">Virgin Islands of the U.S.</option><option value="state_Virginia_4310" id="address_state_state_Virginia_4310">Virginia</option><option value="state_Washington_4313" id="address_state_state_Washington_4313">Washington</option><option value="state_West_Virginia_4315" id="address_state_state_West_Virginia_4315">West Virginia</option><option value="state_Wisconsin_4314" id="address_state_state_Wisconsin_4314">Wisconsin</option><option value="state_Wyoming_4316" id="address_state_state_Wyoming_4316">Wyoming</option></select></span> *

Also, since you put the HTML yourself, you should unpublish the country field, otherwise, the system will yell that you didn't fill the country. Finally, do not forget to remove the code generating automatically the fields as it might break the process. The code you should remove is this:
$this->type = 'address';
		echo $this->loadTemplate();

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #540

Hi Nicolas,

I RULE ! it works...

[ OK OK fine so you RULE but I still think it's awesome and it looks a lot better - nice and short height wise]


www.acewasabisf.com/index.php?option=com...=4&mailid=13&subid=1

[If you or anyone wants to check it out..]

My next challenge will be to figure out how to move the REGISTER button up and to the right.

but seriously,

THANK YOU I couldn't have done it without you.

Cheers,

Emmanuel.

P.S.: It would be so cool if in some very future version there was a WYSIWYG editor where you could drag and drop
your fields in place sort of like a grid system... [just food for thought ;)]

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
14 years 1 month ago #541

Good.

For the wysiwyg editor, it's a bit out of the league of HikaShop. The goal of HikaShop is not to have a wysiwyg editor built in whereas solutions for advanced form creation already exists in Joomla. What might be interesting however is to find an way to integrate with a form extension so that you can really build what you want for the form with the form extension powerfulness and easily add that form inside the checkout... We will see but that's more in the long run I think.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #555

Hi there,

I totally agree on the form extension integration - worse case I know a couple of borderline genius programmers that might be able to make a new form extension by the name of Adrien and Nicolas ;) which should integrate in Hikashop just perfectly ;)

Keep up the great work..

Cheers,

Emmanuel.

P.S.: My registration page is looking pretty good, just can't seem to effect the field names to put more spacing between the column but still pretty good.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #556

On more quick thing is there a way in a <select> statement such as the one we used for the States to have a default value [in my case California?], couldn't find a way to do that on the net.

Cheers,

Emmanuel.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
14 years 1 month ago #557

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #558

Thanks and don't I wish that worked :( because it doesn't... :(

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
14 years 1 month ago #559

Mmm, ok ok, after reading it again I must agree that the forum post wasn't really easy to understand but it wasn't wrong.

First, you need to put

selected="selected"
and not
selected="address_state_state_California_4265"
and second, you need to put that code in the option tag corresponding to your state and not in the main select tag of the dropdown.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
14 years 1 month ago #560

Hey there Nicolas,

Thanks.. well the not understanding part is called i'm not a good enough programmer [not even a programmer at all in PHP ;)]

Thanks... [the selected="address_state_state_California_4265" was my last attempt trying different things :p but if it is in the WRONG place well it doesn't matter what it is, it won't work anyways :)]

Merci,

Emmanuel.

Please Log in or Create an account to join the conversation.

  • Posts: 55
  • Thank you received: 0
13 years 4 months ago #20647

Hi there!
:cheer:
I would like to edit the values of the dropdown menu (Mr, Mrs,...) and put them in Italian...
I was trying to find the login_register.php file, as I read in this post...but I cannot find it!! :blink:

Where can I find it?

Thank you! ;)

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #20660

You don't need to edit a view. Just go in the menu Display->Custom fields and edit the field address_title and change the values.

Please Log in or Create an account to join the conversation.

  • Posts: 55
  • Thank you received: 0
13 years 4 months ago #20664

grrrrrrrrr! I could have seen it!
Sorry to waste your time! (and also my time!! eheh!)
I was In Display->Custom fields to edit the default country and didn't realize that also the title values were there!!
Thank you! ;)

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
13 years 3 months ago #23660

I am sorry, I have serched for over two hours now, first thing I did was check those pages in custom fields.
But I never found the Miss en Mr from the dropdown menu.

Now I found your post, and you are also directing me to the same direction, but still I cannot find them.
I looked in all the adress and login php files. (though the interface)
Do I need new glasses??

Wich one is it?
Thanks in advance.
Harold

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
13 years 3 months ago #23665

Found it, I was looking at the wrong place.
I found it in Display own fields,

Please Log in or Create an account to join the conversation.

Time to create page: 0.106 seconds
Powered by Kunena Forum