Display limited to functionality

  • Posts: 95
  • Thank you received: 1
  • Hikashop Business
11 years 2 weeks ago #156530

Hi,
I would like to create a custom field (radio button- invoice or receipt) at the address table and when invoice is checked i would like some extra fields to appear in the form. I guess display limited to is the answer but i cannot get it to work. eg:
i check Firstname at display limited to but then i dont get a section on where to put the exact values of the firstname. what am i doing wrong? thank you.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 2 weeks ago #156547

Hello,
If you want to add a field to the address section of your invoice, the solution will be to edit the "address_template" file of the "order" view, of your back-end template through "Hikashop->Display->Views" and directly add what you want.

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

  • Posts: 95
  • Thank you received: 1
  • Hikashop Business
11 years 2 weeks ago #156694

Hi ,
thanks for the answer. But what if i want a condition in order to show a field or not at the invoice?
For example how can i show a field in the invoice if it has a specific value else not show it?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #156711

Hi,

I think that what you need will require some custom code.
You have to add a custom PHP check in the view "address / show" in:

		foreach($this->fields as $field){
			$fieldname = $field->field_namekey;
			$html = str_replace('{'.$fieldname.'}', $this->fieldsClass->show($field, @$this->address->$fieldname), $html);
		}
To display or not the custom field depending on another value.

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

  • Posts: 95
  • Thank you received: 1
  • Hikashop Business
11 years 2 weeks ago #156973

thank you for your reply it really helped!
i have customized address/show and order/show to my needs and they work fine. But wehn the email is sent after an order it uses the default template and it doesn;t take my customization into account. What file shall i hack in order to change the email after order and the order confirmed email? Thank you

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #156974

Hi,

You have to edit the email directly via the menu System > Emails. and add the if condition in the preload part.

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

  • Posts: 95
  • Thank you received: 1
  • Hikashop Business
11 years 2 weeks ago #157063

Thank you for yor reply i started looking into the email templates and i might have found a typo.
order notification email ->preload version ->line 240
$additionaltionnal i think should be $additional but i may be wrong.
anyway i just post it and you can see this.

The following user(s) said Thank You: Mohamed Thelji

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

Time to create page: 0.086 seconds
Powered by Kunena Forum