Disable billing address for free products

  • Posts: 4
  • Thank you received: 0
8 years 3 months ago #246851

-- 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

$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:
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.

  • Posts: 4
  • Thank you received: 0
8 years 3 months ago #246853

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:

if($this->identified) {
bellow lines:
$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:
Message
Please create or select an address
Any better idea?

Last edit: 8 years 3 months ago by wbobteng.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 3 months ago #246858

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.054 seconds
Powered by Kunena Forum