how to disable billing address

  • Posts: 107
  • Thank you received: 1
10 years 11 months ago #159373

Hi,

I would like to disable billing address and leave delivery address only on my checkout as well as remove it from all the email templates & order information pages, could you help me with that?

Is there inbuilt functionality for that or do I have to edit the views?

Thanks,
Kashka

-- url of the page with the problem -- : hammockology.ie/hammocks/

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 11 months ago #159388

Hi,

There is no built-in function for that.
You'll have to edit all the views and emails where the billing address area is displayed in order to remove/hide it.

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

  • Posts: 107
  • Thank you received: 1
10 years 11 months ago #159513

Hi,

Thanks for that, when I try to make the changes to the email templates I get the below error, I literally deleted 2 TDs with the billing address information? any ideas?

"Not Acceptable
An appropriate representation of the requested resource /hammocks/administrator/index.php could not be found on this server."

Thanks,
Kashka

Attachments:
Last edit: 10 years 11 months ago by oilibear.

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 11 months ago #159519

Hi,

This is probably the server security module which is refusing the request to modify the email because of all the HTML/PHP code in it.
You'll have to directly edit the email files in the folder media/com_hikashop/mail or see with your hosting company if the security system can be configured to not refuse the request.

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

  • Posts: 107
  • Thank you received: 1
10 years 11 months ago #160398

Hi Nicolas,

Could you advice how to modyfy the file view > checkout>address to disable the billing address and leave delivery address only, I tried to just delete the div, but it breaks the page. Code below.

Thanks,
Kashka

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.0
 * @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');
?><?php
if($this->identified){
	$config = hikashop_config();
	$address_selector = (int)$config->get('checkout_address_selector', 0);

	$mainId = 'hikashop_checkout_address_billing_only';
	$leftId = 'hikashop_checkout_billing_address';
	$mainClass = 'hikashop_checkout_address_billing_only';
	$leftClass = 'hikashop_checkout_billing_address';
	if($this->has_shipping) {
		$mainId = 'hikashop_checkout_address';
		$leftId = 'hikashop_checkout_address_left_part';
		$mainClass = 'hikashop_checkout_address';
		$leftClass = 'hikashop_checkout_address_left_part';
	}
	if(HIKASHOP_RESPONSIVE) {
		$mainClass .= ' row-fluid';
		$leftClass .= ' span6';
	}
?>
<div id="<?php echo $mainId; ?>" class="<?php echo $mainClass; ?>">
	<div id="<?php echo $leftId; ?>" class="<?php echo $leftClass; ?>">
		<fieldset class="hika_address_field" id="hikashop_checkout_billing_address">
			<legend><?php echo JText::_('HIKASHOP_BILLING_ADDRESS'); ?></legend>
<?php
	if(empty($address_selector) || $address_selector == 0) {
		$this->type = 'billing';
		echo $this->loadTemplate('view');
	} else {
		$this->type = 'billing';
		echo $this->loadTemplate('select');
	}

	if($this->has_shipping) {
?>
		</fieldset>
	</div>
	<div id="hikashop_checkout_address_right_part" class="hikashop_checkout_address_right_part<?php if(HIKASHOP_RESPONSIVE){ echo ' span6';} ?>">
		<fieldset class="hika_address_field" id="hikashop_checkout_shipping_address">
			<legend><?php echo JText::_('HIKASHOP_SHIPPING_ADDRESS'); ?></legend>
<?php
		$checked = '';
		$style = '';

		$override = false;
		foreach($this->currentShipping as $selectedMethod){
			if(!empty($selectedMethod) && method_exists($selectedMethod, 'getShippingAddress')) {
				$override = $selectedMethod->getShippingAddress();
			}
		}

		if(!empty($override)) {
?>				<span class="hikashop_checkout_billing_address_info"><?php
					echo $override;
				?></span>
<?php
		} else if(!empty($address_selector)) {
			$this->type = 'shipping';
			echo $this->loadTemplate('select');
		} else {
			if($config->get('shipping_address_same_checkbox', 1)) {
				$onclick = 'return hikashopSameAddress(this.checked);';
				if($this->shipping_address==$this->billing_address){
					$checked = 'checked="checked" ';
					$style = ' style="display:none"';
					$nb_addresses = count(@$this->addresses);
					if($nb_addresses==1){
						$address = reset($this->addresses);
						$onclick='if(!this.checked) { hikashopEditAddress(document.getElementById(\'hikashop_checkout_shipping_address_edit_'.$address->address_id.'\'),1,false); } '.$onclick;
					}
				}
?>
				<label for="same_address">
					<input class="hikashop_checkout_shipping_same_address inputbox" <?php echo $checked; ?>type="checkbox" id="same_address" name="same_address" value="yes" alt="Same address" onclick="<?php echo $onclick; ?>" />
					<?php echo JText::_('SAME_AS_BILLING');?>
				</label>
<?php
			} else {
				$style = '';
			}
?>
				<div class="hikashop_checkout_shipping_div" id="hikashop_checkout_shipping_div" <?php echo $style;?>>
<?php

			$this->type = 'shipping';
			echo $this->loadTemplate('view');
?>
				</div>
<?php
		}
	}
?>
		</fieldset>
	</div>
</div>
<div style="clear:both"></div>
<?php
}else{
}

Last edit: 10 years 11 months ago by Xavier. Reason: Use of [code] tag

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #160439

Hi,

I think that the easiest way is to set the div with the id "hikashop_checkout_address_right_part" to "display:none;".
and make a translation override on the key "HIKASHOP_BILLING_ADDRESS" to display shipping address instead of billing.

This way you will not broke the save of the addresses, etc.

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

  • Posts: 107
  • Thank you received: 1
10 years 11 months ago #160532

Hi Xavier,

Can you advice how to make a translation override on the key "HIKASHOP_BILLING_ADDRESS" to display shipping address instead of billing, please?

Thanks,
kashka

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

  • Posts: 107
  • Thank you received: 1
10 years 11 months ago #160540

I tied to just disable (display:none;) the div and it broke the layout.
Kashka

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #160545

Hi,

For the translation:
hikashop.com/support/faq.html#tran

For the customisation:
hikashop.com/support/support/documentati...ize-the-display.html

Adding the display none force the view to go from two columns to only one, so there is some CSS properties which could be required.

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

  • Posts: 107
  • Thank you received: 1
10 years 6 months ago #179869

Hi,

it's been 4 months since I post that query but I finally got to implement it and I just want to say thank you for the solution, it worked magic, much appreciated.

Thanks,
Kashka

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

Time to create page: 0.082 seconds
Powered by Kunena Forum