Change checkout field order

  • Posts: 48
  • Thank you received: 0
10 years 8 months ago #172993

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.4
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome

On checkout here:
suzy-godsey.com/digit/index.php/shop/checkout

Can we get email b/n Lastname and country?

How do we edit core files for?
suzy-godsey.com/digit/index.php/shop/checkout/step/step-1

We'd like to take out some <br/> tags and <tr> elements.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #173011

Hi,

You have to edit the view "user / registration".

To move the email between Lastname and country, you have to remove the part from that view and paste it in the view "address / form". You will have to use a simple php if condition to put it at the desired place.

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

  • Posts: 48
  • Thank you received: 0
10 years 8 months ago #174195

Hi Xavier,

Please advise on the following 2 attached files on what you mean.
I have backups of the original view on my machine.
Will you please make the changes you are talking about in the 2 attached .txt files?

thank you!

Attachments:

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

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
10 years 8 months ago #174365

Hi,

I am sorry but I don't see any modification in your views so I don't understand why you post them.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
10 years 8 months ago #174375

Hi!

I actually didn't modify them...I'm asking for your help to modify them.

I can take the code out of the view "address / form".

It's knowing where to paste the code that is giving me trouble.

Please advise.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #174485

Hi,

We have the same views, no need to post them if they are unchanged ;)

You have to take:

<tr class="hikashop_registration_email_line">
	<td class="key">
		<label id="emailmsg" for="register_email">
			<?php echo JText::_( 'HIKA_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>
from "user / registration" and potentially the mail confirm part too if you are using it.

And then paste it in the view "address / form" in the foreach and in a specific if condition to place it at the desired place.
For example use the following if:
if($fieldName == 'address_country'){
  ?>
   // paste the code here.
  <?php
}

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

  • Posts: 48
  • Thank you received: 0
10 years 8 months ago #174579

Thank you!

Looks like I had to take this out of the first file:
<?php }?>

...along with beginning <tr> tags.
Attached is final file change. Please advise.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #174612

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><h1 id="hikashop_address_form_header_iframe"><?php echo JText::_('ADDRESS_INFORMATION');?></h1>
<div id="hikashop_address_form_span_iframe">
	<form action="<?php echo hikashop_completeLink('address&task=save'); ?>" method="post" name="hikashop_address_form" enctype="multipart/form-data">
		<table>
<?php
	foreach($this->extraFields['address'] as $fieldName => $oneExtraField) {
		if($fieldName == 'address_country'){
?>
			<tr class="hikashop_registration_email_line">
				<td class="key">
					<label id="emailmsg" for="register_email">
						<?php echo JText::_( 'HIKA_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->config->get('show_email_confirmation_field',0)){
			?>
				<tr class="hikashop_registration_email_confirm_line">
					<td class="key">
						<label id="email_confirm_msg" for="register_email_confirm">
							<?php echo JText::_( 'HIKA_EMAIL_CONFIRM' ); ?>
						</label>
					</td>
					<td>
						<input type="text" id="register_email_confirm" name="data[register][email_confirm]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" onchange="if(this.value!=document.getElementById('register_email').value){alert('<?php echo JText::_('THE_CONFIRMATION_EMAIL_DIFFERS_FROM_THE_EMAIL_YOUR_ENTERED',true); ?>'); this.value = '';}" /> *
					</td>
				</tr>
<?php 
			}
		}
?>
		<tr class="hikashop_address_<?php echo $fieldName;?>_line" id="hikashop_address_<?php echo $oneExtraField->field_namekey; ?>">
			<td class="key"><?php
				echo $this->fieldsClass->getFieldName($oneExtraField);
			?></td>
			<td><?php
				$onWhat='onchange'; if($oneExtraField->field_type=='radio') $onWhat='onclick';
				echo $this->fieldsClass->display(
					$oneExtraField,
					@$this->address->$fieldName,
					'data[address]['.$fieldName.']',
					false,
					' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"',
					false,
					$this->extraFields['address'],
					@$this->address
				);
			?>
			</td>
		</tr>
<?php
	}
?>
	</table>
	<input type="hidden" name="Itemid" value="<?php global $Itemid; echo $Itemid; ?>"/>
	<input type="hidden" name="ctrl" value="address"/>
	<input type="hidden" name="tmpl" value="component"/>
	<input type="hidden" name="task" value="save"/>
	<input type="hidden" name="type" value="<?php echo JRequest::getVar('type',''); ?>"/>
	<input type="hidden" name="action" value="<?php echo JRequest::getVar('task',''); ?>"/>
	<input type="hidden" name="makenew" value="<?php echo JRequest::getInt('makenew'); ?>"/>
	<input type="hidden" name="redirect" value="<?php echo JRequest::getWord('redirect','');?>"/>
	<input type="hidden" name="step" value="<?php echo JRequest::getInt('step',-1);?>"/>
<?php
	if(!empty($address->address_user_id)){
		$id = $address->address_user_id;
	}else{
		$id = $this->user_id;
	}
?>
		<input type="hidden" name="data[address][address_user_id]" value="<?php echo $id;?>"/>
<?php
	if(!JRequest::getInt('makenew')){
?>
		<input type="hidden" name="data[address][address_id]" value="<?php echo (int)@$this->address->address_id;?>"/>
		<input type="hidden" name="address_id" value="<?php echo (int)@$this->address->address_id;?>"/>
<?php
	}
	echo JHTML::_( 'form.token' );
	echo $this->cart->displayButton(JText::_('OK'),'ok',$this->params,hikashop_completeLink('address&task=save'),'if(hikashopCheckChangeForm(\'address\',\'hikashop_address_form\')) document.forms[\'hikashop_address_form\'].submit(); return false;');
?>
	</form>
</div>
<div class="clear_both"></div>

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

  • Posts: 48
  • Thank you received: 0
10 years 8 months ago #174729

Hi!

I've tried your example (cut from one file and past into the second file).
Problem is the email address is now gone completely...and we have to have email address.

Please advise...thank you!

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #174748

Hi,

So that's maybe because there is an error in my "if" condition, the fieldName is not "address_country" but somthing else.
You can use var_dump() PHP function to see what is returned, etc.

As it's customization, it is normally not supported in this forum ;)

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

Time to create page: 0.092 seconds
Powered by Kunena Forum