[Skip to main content](#vessel-content)

#   Hide Addresses

##

- **[Joomill](/forum/user/33738-joomill "View Joomill's Profile")**
- [![Joomill's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33738.jpg)](/forum/user/33738-joomill "View Joomill's Profile") Topic Author
- [ Offline](/forum/user/33738-joomill)

Less More

- Posts: 224
- Thank you received: 10
-
-
- [](http://www.joomill.nl)
-

9 years 9 months ago [\#259802](#259802) by [Joomill](/forum/user/33738-joomill "View Joomill's Profile")  *[Hide Addresses](/forum/31-development/888365-hide-addresses#259802 "-- HikaShop version -- : 2.6.4  On this forums i found the Hide Addresses plugin. It works great, but i would like to hide all addresses except the default address.  So would it be possible to add something like &quot;if address&#95;default != 1 &quot; in this code?")* was created by *[Joomill](/forum/user/33738-joomill "View Joomill's Profile")*

-- HikaShop version -- : 2.6.4

On this forums i found the Hide Addresses plugin.
It works great, but i would like to hide all addresses except the default address.

So would it be possible to add something like "if address_default != 1 " in this code?
Code:

&lt;?php class plgHikashopAddress extends JPlugin { function __construct(&amp;$subject, $config) { parent::__construct($subject, $config); } function onAfterOrderCreate(&amp;$order,&amp;$send_email) { if(empty($order-&gt;order_shipping_address_id) &amp;&amp; empty($order-&gt;order_billing_address_id)) return true; $address = hikashop_get('class.address'); if(!empty($order-&gt;order_shipping_address_id) &amp;&amp; $order-&gt;order_shipping_address_id != $order-&gt;order_billing_address_id) { $obj = new stdClass(); $obj-&gt;address_id = $order-&gt;order_shipping_address_id; $obj-&gt;address_published = 0; $address-&gt;save($obj); } if(!empty($order-&gt;order_billing_address_id)) { $obj = new stdClass(); $obj-&gt;address_id = $order-&gt;order_billing_address_id; $obj-&gt;address_published = 0; $address-&gt;save($obj); } return true; } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4ODM2NS1oaWRlLWFkZHJlc3Nlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 9 months ago [\#259816](#259816) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide Addresses](/forum/31-development/888365-hide-addresses#259816 "-- HikaShop version -- : 2.6.4  On this forums i found the Hide Addresses plugin. It works great, but i would like to hide all addresses except the default address.  So would it be possible to add something like &quot;if address&#95;default != 1 &quot; in this code?")*

Hi,

Yes. Before the lines:
$address-&gt;save($obj);

You can add such code: Code:

$data = $address-&gt;get($obj-&gt;address_id); if(!$data-&gt;address_default)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4ODM2NS1oaWRlLWFkZHJlc3Nlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Joomill](/forum/user/33738-joomill "View Joomill's Profile")**
- [![Joomill's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33738.jpg)](/forum/user/33738-joomill "View Joomill's Profile") Topic Author
- [ Offline](/forum/user/33738-joomill)

Less More

- Posts: 224
- Thank you received: 10
-
-
- [](http://www.joomill.nl)
-

9 years 9 months ago [\#260191](#260191) by [Joomill](/forum/user/33738-joomill "View Joomill's Profile")  Replied by *[Joomill](/forum/user/33738-joomill "View Joomill's Profile")* on topic *[Hide Addresses](/forum/31-development/888365-hide-addresses#260191 "-- HikaShop version -- : 2.6.4  On this forums i found the Hide Addresses plugin. It works great, but i would like to hide all addresses except the default address.  So would it be possible to add something like &quot;if address&#95;default != 1 &quot; in this code?")*

Thank you!

then another question:
When is an address a default?

I hoped it was the address what's used by registration, but sometimes it looks it's the shipping address.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4ODM2NS1oaWRlLWFkZHJlc3Nlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 9 months ago [\#260199](#260199) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide Addresses](/forum/31-development/888365-hide-addresses#260199 "-- HikaShop version -- : 2.6.4  On this forums i found the Hide Addresses plugin. It works great, but i would like to hide all addresses except the default address.  So would it be possible to add something like &quot;if address&#95;default != 1 &quot; in this code?")*

Hi,

The default address is the first one entered by the customer. And then he can change it in the My addresses area on his HikaShop user control panel.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4ODM2NS1oaWRlLWFkZHJlc3Nlcz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.055 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
