Order custom fields to be printed on an Invoice

  • Posts: 80
  • Thank you received: 1
12 years 11 months ago #40292

Hello,

May I have a sample of code which would allow me to have Order Custom Fields to be printed on an Invoice available at the backend within the Order details view.

Thank you

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

  • Posts: 83103
  • Thank you received: 13416
  • MODERATOR
12 years 10 months ago #40492

You can do something like that (in the file invoice of the view order via the menu Display->Views):

$fieldsClass = hikashop_get('class.field');
						$fields = $fieldsClass->getFields('backend',$this->order,'order');
						if(!empty($fields)){
							foreach($fields as $fieldName => $oneExtraField) {
							?>
								<tr>
									<td class="key">
										<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
									</td>
									<td>
										<?php echo $this->fieldsClass->show($oneExtraField,@$this->order->$fieldName); ?>
									</td>
								</tr>
							<?php
							}?>
							<?php
						}

The following user(s) said Thank You: seoweb

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

  • Posts: 80
  • Thank you received: 1
12 years 10 months ago #40590

Nikolas,

With a little modification to meet the requirements of the layout your code has been successfully implemented.
I think this could also be included in a standard version of HikaShop.

Thanx a lot!

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

  • Posts: 83103
  • Thank you received: 13416
  • MODERATOR
12 years 10 months ago #40767

Why not yes.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum