Force NEW Shipping Address

  • Posts: 32
  • Thank you received: 0
7 years 5 months ago #253389

-- HikaShop version -- : 2.6.3

Due to nature of store, shipping address will always be different than billing.

Is there a way to force a new ship address instead of default to using billing?

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
7 years 5 months ago #253391

Hi,

You would have to turn off the option "Show shipping 'same address' checkbox" in the HikaShop configuration.
Then, you want to edit the file "address_select" in the menu Display>Views and change the code:

if(empty($this->addresses)) {
	$js = '';
	$params = new stdClass();
	$params->type = $this->type;
	$params->address_id = 0;
	$params->edit = true;
	$params->fieldset_id = 'hikashop_checkout_'.$this->type.'_address_zone';
	echo hikashop_getLayout('address', 'show', $params, $js);
}
to:
if(empty($this->addresses)) {
	$js = '';
	$params = new stdClass();
	$params->type = $this->type;
	$params->address_id = ($this->type=='billing' ? 0 :(int)$current);
	$params->edit = true;
	$params->fieldset_id = 'hikashop_checkout_'.$this->type.'_address_zone';
	echo hikashop_getLayout('address', 'show', $params, $js);
}
and that the code:
<?php if($this->type=='shipping') $this->addresses = null; ?>
at the top of the view file and that should do it.

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

Time to create page: 0.036 seconds
Powered by Kunena Forum