- Posts: 190
- Thank you received: 9
Hide same address checkbox if weight is zero
6 years 11 months ago #313643
by joris85
Hide same address checkbox if weight is zero was created by joris85
-- 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.
-- 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.
Please Log in or Create an account to join the conversation.
6 years 11 months ago #313644
by joris85
Replied by joris85 on topic Hide same address checkbox if weight is zero
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?
So is it possible to create an other checkout for virtual products?
Please Log in or Create an account to join the conversation.
6 years 11 months ago #313671
by nicolas
Replied by nicolas on topic Hide same address checkbox if weight is zero
Hi,
On the new address creation form, to avoid that, you can change the line:
to:
in the file show_block_address via the menu Display>Views.
For the registration form, you can add the code:
after the code:
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.
On the new address creation form, to avoid that, you can change the line:
Code:
if(!empty($this->options['same_address']) && !empty($this->options['new_address_type'])) {
Code:
if(!empty($this->options['same_address']) && !empty($this->options['new_address_type']) && ($this->options['new_address_type'] == 'shipping' || $this->options['show_shipping'])) {
For the registration form, you can add the code:
Code:
$checkoutHelper = hikashopCheckoutHelper::get();
if(!$checkoutHelper->isShipping()) {
$params['same_address'] = 0;
}
Code:
if(!isset($params['same_address_pre_checked']))
$params['same_address_pre_checked'] = 1;
We'll add both changes on our end for the next version of HikaShop.
Please Log in or Create an account to join the conversation.
6 years 11 months ago #313677
by joris85
Replied by joris85 on topic Hide same address checkbox if weight is zero
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
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
Please Log in or Create an account to join the conversation.
6 years 11 months ago #313678
by nicolas
Replied by nicolas on topic Hide same address checkbox if weight is zero
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
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
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds