Skip to main content

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

More
7 years 10 months ago #300369 by panefs
-- 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.

More
7 years 10 months ago #300384 by nicolas
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:
Code:
<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>
Code:
<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.

More
7 years 10 months ago #300445 by panefs

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

Time to create page: 0.180 seconds
Powered by Kunena Forum