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

#   Hide same address checkbox if weight is zero

##

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

Less More

- Posts: 190
- Thank you received: 9
-
-

6 years 11 months ago [\#313643](#313643) by [joris85](/forum/user/28344-joris85 "View joris85's Profile")  *[Hide same address checkbox if weight is zero](/forum/27-checkout/898779-hide-same-address-checkbox-if-weight-is-zero#313643 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.13 -- PHP version -- : 7.2  Hi there,  I have books and ebooks. I want to remove the shipping for ebooks. So i set force shipping to no Added weight to the real book.  Now i have no shipping option if i set the address but the checkbox is still there. I want that checkbox for the book but not the ebook.   www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0  Love to know how to disable it.")* was created by *[joris85](/forum/user/28344-joris85 "View joris85's Profile")*

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.13
-- PHP version -- : 7.2

Hi there,

I have books and ebooks.
I want to remove the shipping for ebooks.
So i set force shipping to no
Added weight to the real book.

Now i have no shipping option if i set the address but the checkbox is still there.
I want that checkbox for the book but not the ebook.
[ www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0](https://www.dropbox.com/s/hfmubgst7iafetq/Schermafdruk%202019-12-01%2011.37.43.png?dl=0)

Love to know how to disable it.

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

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

Less More

- Posts: 190
- Thank you received: 9
-
-

6 years 11 months ago [\#313644](#313644) by [joris85](/forum/user/28344-joris85 "View joris85's Profile")  Replied by *[joris85](/forum/user/28344-joris85 "View joris85's Profile")* on topic *[Hide same address checkbox if weight is zero](/forum/27-checkout/898779-hide-same-address-checkbox-if-weight-is-zero#313644 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.13 -- PHP version -- : 7.2  Hi there,  I have books and ebooks. I want to remove the shipping for ebooks. So i set force shipping to no Added weight to the real book.  Now i have no shipping option if i set the address but the checkbox is still there. I want that checkbox for the book but not the ebook.   www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0  Love to know how to disable it.")*

Also i can imagine that the full address of the invoice could be gone.
So is it possible to create an other checkout for virtual products?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5ODc3OS1oaWRlLXNhbWUtYWRkcmVzcy1jaGVja2JveC1pZi13ZWlnaHQtaXMtemVybz90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

6 years 11 months ago [\#313671](#313671) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide same address checkbox if weight is zero](/forum/27-checkout/898779-hide-same-address-checkbox-if-weight-is-zero#313671 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.13 -- PHP version -- : 7.2  Hi there,  I have books and ebooks. I want to remove the shipping for ebooks. So i set force shipping to no Added weight to the real book.  Now i have no shipping option if i set the address but the checkbox is still there. I want that checkbox for the book but not the ebook.   www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0  Love to know how to disable it.")*

Hi,

On the new address creation form, to avoid that, you can change the line: Code:

if(!empty($this-&gt;options['same_address']) &amp;&amp; !empty($this-&gt;options['new_address_type'])) {

to:
Code:

if(!empty($this-&gt;options['same_address']) &amp;&amp; !empty($this-&gt;options['new_address_type']) &amp;&amp; ($this-&gt;options['new_address_type'] == 'shipping' &#124;&#124; $this-&gt;options['show_shipping'])) {

in the file show_block_address via the menu Display&gt;Views.
For the registration form, you can add the code: Code:

$checkoutHelper = hikashopCheckoutHelper::get(); if(!$checkoutHelper-&gt;isShipping()) { $params['same_address'] = 0; }

after the code: Code:

if(!isset($params['same_address_pre_checked'])) $params['same_address_pre_checked'] = 1;

in the file administrator/components/com_hikashop/helpers/checkout/login.php
We'll add both changes on our end for the next version of HikaShop.

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

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

Less More

- Posts: 190
- Thank you received: 9
-
-

6 years 11 months ago [\#313677](#313677) by [joris85](/forum/user/28344-joris85 "View joris85's Profile")  Replied by *[joris85](/forum/user/28344-joris85 "View joris85's Profile")* on topic *[Hide same address checkbox if weight is zero](/forum/27-checkout/898779-hide-same-address-checkbox-if-weight-is-zero#313677 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.13 -- PHP version -- : 7.2  Hi there,  I have books and ebooks. I want to remove the shipping for ebooks. So i set force shipping to no Added weight to the real book.  Now i have no shipping option if i set the address but the checkbox is still there. I want that checkbox for the book but not the ebook.   www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0  Love to know how to disable it.")*

Awesome!

One thing is if somebody has hardcover and eBook and deletes the hardcover it does not disappear.
Not big issue and that is not ajax of course ![:-D](/bigsmile.gif ":-D")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5ODc3OS1oaWRlLXNhbWUtYWRkcmVzcy1jaGVja2JveC1pZi13ZWlnaHQtaXMtemVybz90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

6 years 11 months ago [\#313678](#313678) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide same address checkbox if weight is zero](/forum/27-checkout/898779-hide-same-address-checkbox-if-weight-is-zero#313678 "-- HikaShop version -- : 4.2.2 -- Joomla version -- : 3.9.13 -- PHP version -- : 7.2  Hi there,  I have books and ebooks. I want to remove the shipping for ebooks. So i set force shipping to no Added weight to the real book.  Now i have no shipping option if i set the address but the checkbox is still there. I want that checkbox for the book but not the ebook.   www.dropbox.com/s/hfmubgst7iafetq/Scherm...%2011.37.43.png?dl=0  Love to know how to disable it.")*

Hi,

Yes, I see what you mean. We could add something for that. But I would say that it doesn't help much and it adds refreshing ajax requests for something that's almost never needed. So let's reduce CO2 for the planet and not do it, at least for now ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5ODc3OS1oaWRlLXNhbWUtYWRkcmVzcy1jaGVja2JveC1pZi13ZWlnaHQtaXMtemVybz90bXBsPW1hcmtkb3du) 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.056 seconds

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