Turn off "Address is also a billing address" in new address creation

  • Posts: 103
  • Thank you received: 7
6 years 4 months ago #295869

-- url of the page with the problem -- : www.stutteringtherapyresources.com
-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.0.30
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no error message

Hello - I would like to hide / turn off the checkbox on the new address form for "Address is also a billing address" or "Address is also a shipping address."

The multiple addresses that this creates causes confusion or my customers, all of whom have only one shipping and one billing address (and most of the time, those are the same).

I've figured out how to have it default to the shipping and billing addresses being the same - that is great. But, in those cases where they do need to enter a different shipping address, I'd like it to not display that checkbox after the address entry.

I can't figure out what view that is on or what code I have to comment out, though.

Help? Thank you.

Scott

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 4 months ago #295871

Hi,

To check which view file it is, you can activate the "display view files" setting in the HikaShop configuration.
You'll see it's the view file "show_block_address".
There you have that code:

<input type="hidden" name="data[address_selecttype_<?php echo $this->step . '_' . $this->module_position; ?>]" value="1" />
			<label><input type="checkbox" checked="checked" name="data[address_bothtypes_<?php echo $this->step . '_' . $this->module_position; ?>]" value="1"> <?php
				$other = ($this->options['new_address_type'] == 'billing') ? 'shipping' : 'billing';
				echo JText::_('HIKASHOP_ALSO_'.strtoupper($other).'_ADDRESS');
			?></label>

The following user(s) said Thank You: jsyaruss

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

  • Posts: 103
  • Thank you received: 7
6 years 4 months ago #295899

EXCELLENT! Thanks for this. I was able to remove that bit of code and now it works exactly as I wanted...

EXCEPT for one minor thing.

When I return to the page with the billing and shipping addresses after entering a new address, the system requires me to press NEXT twice to move on to the shipping page.

If I don't enter a different billing/shipping address or if I select addresses from the drop-down menu, then it only requires me to press NEXT once (as it should).

I'm unable to figure out why it requires me to select NEXT twice when I enter a new address. Help?

Again, thanks.
Scott

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

  • Posts: 12953
  • Thank you received: 1778
6 years 3 months ago #295933

Hello Scott,

Thank you for your feedback, the solution will just be to edit the code of your "show_block_address" file of the "checkout" view of your front-end template, and change these lines :

echo $this->fieldClass->display(
				$field,
				@$this->edit_address->$fieldname,
				'data[address_'.$this->step . '_' . $this->module_position.']['.$fieldname.']',
				false,
				' class="hkform-control" ' . $onWhat . '="window.hikashop.toggleField(this.value,\''.$fieldname.'\',\'address_'.$this->step . '_'.$this->module_position.'\',0,\'hikashop_checkout_\');"',
				false,
				$this->cart_addresses['fields'],
				$this->edit_address,
				false
			);
?>
		</div>
	</div>
<?php

By :
echo $this->fieldClass->display(
				$field,
				@$this->edit_address->$fieldname,
				'data[address_'.$this->step . '_' . $this->module_position.']['.$fieldname.']',
				false,
				' class="hkform-control" ' . $onWhat . '="window.hikashop.toggleField(this.value,\''.$fieldname.'\',\'address_'.$this->step . '_'.$this->module_position.'\',0,\'hikashop_checkout_\');"',
				false,
				$this->cart_addresses['fields'],
				$this->edit_address,
				false
			);
?>
		</div>
	</div>
	<input type="hidden" name="data[address_selecttype_<?php echo $this->step . '_' . $this->module_position; ?>]" value="1" />
<?php

The following user(s) said Thank You: jsyaruss

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

  • Posts: 103
  • Thank you received: 7
6 years 3 months ago #295943

SUPERB! That did it exactly.

Thank you again for your excellent and quick service!

Scott

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
6 years 3 months ago #295954

Hello,

Happy to see your satisfaction !
If you want to support us other than simply being our customer, remember that you can express yourself on the Joomla Extensions Directory , this will help us a lot !

Best regards

Last edit: 6 years 3 months ago by Philip.

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

  • Posts: 103
  • Thank you received: 7
6 years 3 months ago #295965

oh, sure thing. will do! Thanks again.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum