provide shipping address during registration

  • Posts: 26
  • Thank you received: 0
8 years 6 months ago #239085

-- HikaShop version -- : 2.6.2
-- Joomla version -- : 3.4.8

Hi , I would like to simplify guest checkout by dispalying both billing and shipping address(in case the product is shippable of course) initially,
I guessed that I should update the view registration_bootstrap to check for shippment requirement and then display the view of shipping address, but how I am going to direct the system to save the address when the user press "register".
this will require - as far as I know- a modification to some controller function,
can you please assist me on that ?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #239126

Hi,

Yes, the system doesn't support the saving of the extra fields you would add. So you'll have to edit the file components/com_hikashop/controllers/checkout.php in the _doRegister function which handles the registration.
It actually calls the function "register" of administrator/components/com_hikashop/classes/user.php so you'll want to look there as well. While you might not need to modify that second file, that's where the address fields are saved so it will be interesting to you to see how it's done by default.

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

  • Posts: 26
  • Thank you received: 0
8 years 6 months ago #239259

thanks for your guidance, I have managed to store the address , however the next step(address) is displayed yet it contains the previously entered address, how can I make the checkout jumps over the address step,
I thought I can delete the step "address" from the checkout, but that disables displaying it altogether (even during the registration )
can you please assist me ?
I think I need to load checkout/ address view during registration, but I can't load the view from another controller(registration is part of "user" while "address" is part of checkout)

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #239271

Hi,

To set the billing or shipping address you can do like that:

$app = JFactory::getApplication();
$app->setUserState(HIKASHOP_COMPONENT.'.shipping_address', $address_id);
$app->setUserState(HIKASHOP_COMPONENT.'.billing_address', $address_id);
It will then be used automatically by the address view.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum