How to hide the Shipping address in: User Control Panel > Addresses

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
6 years 1 week ago #300369

-- HikaShop version -- : 4.0.0
-- Joomla version -- : 3.9

Hello.
I am selling digital products therefore the shipping address is not necessary in this type of business.

When the user clicks on "Addresses" in the User Control Panel, they see both the default billing and shipping addresses. They are also given the option to add/edit both.

How do I eliminate the shipping address completely, from the "Addresses" section of the user control panel?

Thank you.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 1 week ago #300384

Hi,

There is no easy option that you can just turn off for that.
You'll have to edit the file "listing" of the view "address" for your frontend template via the menu Display>Views and remove the pieces you don't want:

<dl class="hika_options large">
		<dt><label for="hikashop_default_shipping_address_selector"><?php echo JText::_('HIKASHOP_SELECT_DEFAULT_SHIPPING_ADDRESS'); ?></label></dt>
		<dd><?php
			$current = 0;
			$values = array();
			if(!empty($this->addresses)) {
				if(empty($this->addressClass))
					$this->addressClass = hikashop_get('class.address');

				foreach($this->addresses as $k => $address) {
					if(!in_array($address->address_type, array('shipping', 'both', '')))
						continue;

					$addr = $this->addressClass->miniFormat($address);
					$values[] = JHTML::_('select.option', $k, $addr);
					if(!empty($address->address_default))
						$current = $address->address_id;
				}
			}
			if(empty($values))
				$values = array(JHTML::_('select.option', '', JText::_('HIKA_NO_ADDRESS')));
			echo JHTML::_('select.genericlist', $values, 'data[user][default_shipping]', 'class="hikashop_default_address_dropdown" onchange="window.addressMgr.setDefault(this, \'shipping\');"', 'value', 'text', $current, 'hikashop_default_shipping_address_selector');
		?></dd>
	</dl>
<div class="hkc-md-6 hikashop_shipping_addresses">
		<h3><?php echo JText::_('HIKASHOP_SHIPPING_ADDRESSES'); ?></h3>
<?php
	foreach($this->addresses as $address) {
		if($address->address_type != 'shipping')
			continue;
?>
	<div class="hikashop_user_address address_selection" id="hikashop_user_address_<?php echo $address->address_id; ?>">
<?php
		$this->address_id = (int)$address->address_id;
		$this->address = $address;
		$this->setLayout('show');
		echo $this->loadTemplate();
?>
	</div>
<?php
	}
?>
		<div class="" style="margin-top:6px;">
			<a class="hikabtn hikabtn-success" href="#newAddress" onclick="return window.addressMgr.new('shipping');"><i class="fa fa-plus"></i> <?php echo JText::_('HIKASHOP_NEW_SHIPPING_ADDRESS'); ?></a>
		</div>
	</div>

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

  • Posts: 105
  • Thank you received: 6
  • Hikashop Business
6 years 1 week ago #300445

Thank you very much!

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

Time to create page: 0.062 seconds
Powered by Kunena Forum