how to appearing some custom field front-end?

  • Posts: 13
  • Thank you received: 0
13 years 5 months ago #1497

Hi There..
I've use hikashop starter and it helps me a lot.. But i have some problem.
How can i modify address information in front-end? I want to call a field value from address information in back-end, make it appear in addresses front-end but make it unlisted in address information in front-end.
Please help me.. I've been stuck for 3 days and couldn't found the way..
Thanks.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
13 years 5 months ago #1498

Hi,

You can personalize the address form by going to Display->Custom fields. There you will be able to publish/unpublish fields and create new ones if needed.

Also, if you want to change the address display, you will have to go to Display->Views and search for address_template. You will be able to change the way the address is displayed on the front end and the back end.

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

  • Posts: 13
  • Thank you received: 0
13 years 5 months ago #1500

Thanks for your quick reply.
i've been changed published property into unpublished, but it makes the field value didn't appear in both of front-end and back-end. I've been customized front-end address_template and entering {field} value in front-end address_template that unpublished or front-end unchecked in hikashop->display->custom value, but it didn't work. The value can't appear in front-end. I need to make it appeared in address front-end but not appeared in address information form front-end. Could you give me the solutions? Thanks before.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
13 years 5 months ago #1502

Ah ok. I see what you mean. you want to disable the edit of a field on the front end form but still have it displayed.

You should edit the file form.php of the view address and change the code

echo $this->fieldsClass->display($oneExtraField,$this->address->$fieldName,'data[address]['.$fieldName.']');
to the code
if($fieldName=='YOUR_CUSTOM_FIELD_REALNAME'){ echo $this->address->$fieldName;}else{echo $this->fieldsClass->display($oneExtraField,$this->address->$fieldName,'data[address]['.$fieldName.']');}
And replace YOUR_CUSTOM_FIELD_REALNAME by the realname of your field.

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

  • Posts: 13
  • Thank you received: 0
13 years 5 months ago #1509

Yap. That's what i mean.
I'm sorry, but your code didn't work. I've been checked it many times.
I had made 'paket_berlaku' in my custom field. I've been trying on other field too. But it still displayed in address information

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

  • Posts: 13
  • Thank you received: 0
13 years 5 months ago #1512

I'm truly sorry. It works. :P
Thanks for your help Nicholas. :cheer: :cheer:

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

Time to create page: 0.066 seconds
Powered by Kunena Forum