only one shipping and billing address

  • Posts: 141
  • Thank you received: 3
5 years 1 month ago #311343

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.2.14

Hello, I would like to use only one shipping and billing addresses for the clients. So I need to disable option to add new addresses. Thanks to forum thread link I found to remove new address button in checkout page using css:

.hikabtn.hikabtn-success.hikashop_checkout_address_new_button {
display:none;
}

However I can’t find the way how can I also remove add new address button on user addresses edition page (address/listing.php) and to not override the php view but only using css. I found that on user addresses edition page there is only a class hikabtn.hikabtn-success linked to the buttons, which I cannot disable because it will also impact on other hikashop buttons like next button on checkout page.

Is it possible to remove add new address buttons on user address edition page (address/listing.php) without overriding the php view file ?

Regards,
Greg

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #311344

Hi,

Note that for the checkout, you can just turn off the "Allow multiple addresses" setting of the Address view in the "checkout workflow" of the HikaShop configuration.

For the new address button on the address edition, you can use such CSS:
a[href="#newAddress"] { display:none; }
www.w3.org/TR/selectors-3/#attribute-selectors

The following user(s) said Thank You: Greg_C

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

  • Posts: 141
  • Thank you received: 3
5 years 1 month ago #311362

Hi Nicolas, great !
thank you for your help !

Regards,
Greg

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

  • Posts: 141
  • Thank you received: 3
5 years 1 month ago #312144

Hi Nicolas, I would like to back to this one address thread. I found a problem with the solution of disable possibility of adding new addresses in address edition by hiding display of the button “New address” - after this it is not possible to add first address (when no address was added before or when client delete existing one).

Is it possible to fully disable possibility to use multiply addresses ? Turning off the "Allow multiple addresses" setting of the Address view in the "checkout workflow" works fine but I need also to turn off such a possibility in Address Edition.

Regards,
Greg

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #312167

Hi,

Well, in that case, if that's a problem for you, you need to do a view override of address / listing.php via the menu Display>Views and modify a bit the code to only display the new address button if there are no addresses to list.
But what you describe doesn't seem like a big problem. Sure a user can't enter his address in the address manager with what I proposed before, but why would he do that ? The only goal of entering an address is to checkout, and he can enter his address on the checkout. So he'll have it in the address manager after going through the checkout once. And before goign through the checkout, the address of the user account serves no purpose. As a customer myself, I don't see a scenario where I would want to fill in something which I don't need to fill.

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

  • Posts: 141
  • Thank you received: 3
5 years 1 month ago #312198

Hi Nicolas, In address edition user can choose one of two icons: "pen" to edit address data and "trash" to delete address - there is a risk of usage of trash icon even accidentally. I would like to eliminate multiply addresses option because it makes forms/process more complex for users. Could you give me some advise how to disable trash icon from address/show.php ? or could you give me an example of code to be changed in address/listing.php to only display the new address button if there are no addresses to list ?

ps. During last tests I have found a risk in following situation related with addresses: when the Joomla user is deleted (the user has previously carried out transactions) and new user is registered in Joomla with same e-mail address as deleted one - then this new user has access to addresses data of deleted user - even if this is an unlikely situation but there is a risk of unauthorized access to the data.

Regards,
Greg

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #312199

Hi,

Yes, with the trash icon it could be problematic, but if you hide the new button with CSS, then you can also hide the trash icon with CSS.
You should be able to do that with such CSS:

.hikashop_address_listing .hika_edit a:nth-child(2){ display:none; }

There actually is a mechanism to delete the user addresses when the user account is being deleted.
However, looking into it, I can see that if the user had previous orders, then the user entry deletion in HikaShop is refused and in that case the address of the customer is still there.
In such case, the user entry is considered as a "guest" entry.
Now if there is a reregistration with the same email address, if it's done through HikaShop's registration, there is a check for that to remove the old addresses of the user entry before assigning the entry to the new Joomla user account.
But again, looking into it, if the registration is done through Joomla's registration, this won't be done.
So I guess there are some things to improve on what is already there to avoid that to happen.
We'll look into changing that. Thank you for your feedback.

Last edit: 5 years 1 month ago by nicolas.
The following user(s) said Thank You: Greg_C

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

  • Posts: 141
  • Thank you received: 3
5 years 1 month ago #312314

Hi Nicolas, ok, thank you for the information

I had to do a minor code change:

.hikashop_address_listing_div .hika_edit a:nth-child(2){ display:none; }


Regards,
Greg

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

Time to create page: 0.066 seconds
Powered by Kunena Forum