Shipping and billing address

  • Posts: 31
  • Thank you received: 0
12 years 4 months ago #57300

Hi

I am using business version and no registration.

I also only show the selected billing and shipping address in check out page.

After I completed one shopping transaction(done payment) and I return to shop more (without cleaning browser cache), all my details are still filled in the "detail form" which is great since I don't have to re enter, but when I go to the next step - the billing and shipping address details, my old shipping address was displayed as the billing address(selected), so the previous shipping address has suddenly become the billing address.

I know I have the edit button to re-enter the billing address back, but I thought that it shouldn't have changed like that. The billing address should stay the same as the previous transaction which is based on the address from the "detail form" that I first filled, not the old shipping address.

Any idea?

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

  • Posts: 82820
  • Thank you received: 13366
  • MODERATOR
12 years 4 months ago #57374

Hi,

That shouldn't be the case with the latest version. Could you check that you're using the latest version of HikaShop?

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

  • Posts: 31
  • Thank you received: 0
12 years 4 months ago #57442

Hi Nicolas,

I bought the business package a couple weeks ago. I checked the update/about and it says "You have the latest stable version : 1.5.8"

This is my current checkout/address_view.php. Maybe I did something wrong when I modified it to show selected address only.

<?php
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
$same_address = false;
if($this->shipping_address==$this->billing_address){
$same_address = true;
}
if(!empty($this->addresses)){
?>
<table>
<?php
$varname = $this->type.'_address';
if(empty($this->$varname) || !isset($this->addresses[$this->$varname])){
$first = reset($this->addresses);
$this->$varname = $first->address_id;
}
$done = false;
$nb_addresses = count($this->addresses);
$k=0;
foreach($this->addresses as $address){
$this->address =& $address;
$checked = '';
if(($this->$varname==$address->address_id)||(empty($address->address_id) && !$done)){
$checked = 'checked="checked"';
$done = true;
}
else{
continue;}

if($this->config->get('auto_submit_methods',1)&&empty($checked)){
$checked.=' onclick="this.form.submit(); return false;"';
}
?>

<tr class="<?php echo "row$k"; ?>">
<td>
<input id="hikashop_checkout_<?php echo $this->type;?>_address_radio_<?php echo $address->address_id;?>" class="hikashop_checkout_<?php echo $this->type;?>_address_radio" type="radio" name="hikashop_address_<?php echo $this->type;?>" value="<?php echo $address->address_id;?>" <?php echo $checked; ?> />
</td>
<td><label for="hikashop_checkout_<?php echo $this->type;?>_address_radio_<?php echo $address->address_id;?>" style="cursor:pointer;">
<span class="hikashop_checkout_<?php echo $this->type;?>_address_info">


<?php
$params = null;
$js = '';
$html = hikashop_getLayout('address','address_template',$params,$js);
foreach($this->fields as $field){
$fieldname = $field->field_namekey;
$html=str_replace('{'.$fieldname.'}',$this->fieldsClass->show($field,$address->$fieldname),$html);
}
echo str_replace("\n","<br/>\n",str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)));
?>
</span>
</label>
</td>
<td>
<span class="hikashop_checkout_<?php echo $this->type;?>_address_buttons">
<?php if($nb_addresses>1){ ?>

<?php }
?>

</span>
</td>
</tr>
<?php
$k = 1-$k;
}
?>
</table>
<?php
}else{
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('CREATE_OR_SELECT_ADDRESS') );
}
?>
<span id="hikashop_checkout_<?php echo $this->type;?>_address_new" class="hikashop_checkout_<?php echo $this->type;?>_address_new">
<?php $html = $this->cart->displayButton(JText::_('HIKA_NEW'),'new',$this->params,'','var link = document.getElementById(\'hikashop_checkout_'. $this->type.'_address_new_link\'); if(link) return hikashopEditAddress(link,'.(int)$same_address.',true); return false;');
if(strpos($html,'<a')!==false) echo $html; ?>
<a id="hikashop_checkout_<?php echo $this->type;?>_address_new_link" rel="{handler: 'iframe', size: {x: 450, y: 480}}" href="<?php echo hikashop_completeLink('address&redirect=checkout&task=add&step='.$this->step.'&type='.$this->type.$url_itemid,true);?>" onclick="return hikashopEditAddress(this,<?php echo (int)$same_address; ?>,true);">
<?php if(strpos($html,'<a')===false) echo $html; ?>
</a>
</span>

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

  • Posts: 31
  • Thank you received: 0
12 years 4 months ago #57586

Is there anything wrong with those codes that caused the problem? and any other solutions?

Many thanks,

Shanwell

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

  • Posts: 82820
  • Thank you received: 13366
  • MODERATOR
12 years 4 months ago #57657

I don't think that it comes from the code of that view.

Could you give a link to your shop (and maybe a back end access ?), so that we can try to reproduce the problem and understand what's going on ?

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

  • Posts: 82820
  • Thank you received: 13366
  • MODERATOR
12 years 4 months ago #57825

Ok, I think I understand why you're thinking that the problem is with the selection of the default address.

When I tested on your website, once I got back from the payment gateway and tried a second checkout, the checkout displayed the registration form with all the latest information prefilled. That's actually done by the browser based on the information you entered there previously. And since the latest address you entered is the shipping address, you get the shipping address information pre filled there.
Then, when you proceed, it uses that address for both the shipping and the billing address, like it does the first time. But you need to change the information in the form so that it uses your billing address.

So it's not a problem of default address.
In fact, since you don't have a user account created, the addresses cannot be reused by HikaShop. 0therwise anyone could come to your website and get the address of anyone else who already ordered, which is not something you want.

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

  • Posts: 31
  • Thank you received: 0
12 years 4 months ago #57903

Hi Nicolas,

thanks for clarifying that.

I notice every pop up window has the same background as my website background now. Did you do any CSS changes? It was white background before. It looks nice. I'd like to know how you changed that.

Many thanks,

Shanwell

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

  • Posts: 82820
  • Thank you received: 13366
  • MODERATOR
12 years 4 months ago #57969

I didn't change that. That's the CSS of your template. The popup is also displayed by your template and some templates do that automatically.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum