Hide address field for free or weightless products

  • Posts: 13
  • Thank you received: 1
4 years 5 months ago #320502

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.2

My shop has both virtual and physical products.
The virtual products are free and are weightless. so I don't want the user to fill address fields when checkout. (both billing and shipping address should not be shown)
But for physical products I want the user to fill address , zip code and telephone.
Is this possible in this version that for free or weightless product address level not be shown?
I don't have any shipping method.
The physical products weight is set to its value but virtual ones has zero with default settings.
the products has characteristics and the weight is set in variant.
Force shipping regardless of weight is set to no.
Ask address on registration is also set to no.
But in checkout I have address in my checkout process because if I don't have, the address part is totally removed.
The user registration is as a guest.
I know there are some posts in the forum for this question but I couldn't find for new versions.
Thanks.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320503

Hi,

The way you configured your shop, the "shipping address" area should disappear when the customer only has weightless products in his cart.
However, the billing address is always asked, regardless of the weight of the products.
That's because normally, you need to know the legal address of the customer, even for weightless products, so that you can collect the tax accordingly as required by law (as it is usually the case).
Now for free product, weightless products, if you don't need to collect anything, then if it's a download, you could edit the file and activate its "free download" setting. That way, it would be available directly on the product page, without the need for the user to go through the checkout.

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

  • Posts: 13
  • Thank you received: 1
4 years 5 months ago #320524

Thank you dear Nicolas for your reply. I have used your other replies in the forum before and all were useful.
The reason I want the user to go to checkout step for free weightless products is that I need their email address for marketing. Any idea?

I have tried to do as this link , but could not find the codes.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320548

Hi,

In that case, you can edit the custom address fields via the Display>Custom fields menu. There, set their address type to "shipping" so that they will only appear for shipping addresses.
That way, if the user has only weightless products in the cart, no address field will appear on the guest form, only the "email address" field. And if the user has products with weight, the address custom fields will appear on the guest form.
Then, you can remove the "address" view from your checkout workflow so that you only collect the address on the guest form.

I think this will allow you to achieve what you want.

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

  • Posts: 13
  • Thank you received: 1
4 years 5 months ago #320568

Unfortunately I don't find any part in add or edit custom fields to be able to set their address type to "shipping".
Can you explain more about it? I searched on the forum too and didn't find a way.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320571

Hi,

Go in the menu Display>Custom fields. There, you'll see the list of the custom address fields. Edit one. And you'll have the option there:
monosnap.com/file/mfM8zhoxwkkZkORXYXwcWxmCVE1JiD

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

  • Posts: 13
  • Thank you received: 1
4 years 5 months ago #320614

Thank you. I found that my hikashop is not updated. I had hikashop version 3.2 and updated to the last version but on check out page I had below error
syntax error, unexpected 'if' (T_IF)
and now I found that my hikashop is not updated.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320615

Hi,

Ah yes, that's a new option of custom address fields which isn't in the 3.2.
As you wrote that you had the 4.3 in your first message on this thread, I thought you had it.

Regarding the error with the update, I can say two things:
- first, after the update, make sure that the "checkout legacy" setting is turned off under the Advanced tab of the HikaShop configuration.
- if you still have the error, please activate the "debug mode" and "error reporting" settings of the Joomla configuration and access the page with the error again. In will display an error message with much more information on the issue, and that will help us understand what is going on and give you a solution

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

  • Posts: 13
  • Thank you received: 1
4 years 5 months ago #320677

Dear Nicolas it seems there is some thing wrong with my template because when I change error reporting level I see a blank page. So I install the new version and now I am setting my shop.
Just for others who sees this post I should say in 4.3.0 version with the setting told in this post, for the free and weightless products don't need any extra settings. Just in checkout workflow the address type should be shipping.

Last edit: 4 years 5 months ago by saraee.

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

Time to create page: 0.074 seconds
Powered by Kunena Forum