Skip to main content

Disable billing address for free products

More
10 years 2 months ago #246851 by wbobteng
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.0
-- PHP version -- : 7.0.8

Hello,

Is there any way to disable billing address for free products only? I have tried like this:
components\com_hikashop\views\user\tmpl\registration.php
Code:
$cartClass = hikashop_get('class.cart'); $cart = $cartClass->loadFullCart(); if($cart->full_total->prices[0]->price_value == 0){ $this->config->set('address_on_registration',0); }
That code removing billing address parts from checkout page but when I am trying to get register it's showing this error:
Code:
Error Please complete the Title field Please complete the First name field Please complete the Last name field Please complete the Address field Please complete the City field Please complete the Telephone field
Looks like I haven't implement it correctly. Any suggestion please?

Thanks

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

More
10 years 2 months ago - 10 years 2 months ago #246853 by wbobteng
Tried this ways too. disable "Ask address on registration" from configuration. Edited this file: components\com_hikashop\views\checkout\tmpl\address.php
at very top before this line:
Code:
if($this->identified) {
bellow lines:
Code:
$cartClass = hikashop_get('class.cart'); $cart = $cartClass->loadFullCart(); if($cart->full_total->prices[0]->price_value == 0){ $this->identified = 0; }
but now giving this error:
Code:
Message Please create or select an address
Any better idea?
Last edit: 10 years 2 months ago by wbobteng.

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

More
10 years 2 months ago #246858 by nicolas
Hi,

I don't see a way to do it without having to hack the function "after_address" of the file components/com_hikashop/controllers/checkout.php which checks that you have an address entered if you have the "address" view in the "checkout workflow" setting of the HikaShop configuration.

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

Time to create page: 0.193 seconds
Powered by Kunena Forum