Custom field missin in invoice

  • Posts: 46
  • Thank you received: 3
7 years 3 weeks ago #268342

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.4

Dear support team,

I have upgraded Hikashop to new version and there is one custom field missing in invoice now (I have a customization of invoice view - please, see attached). Custom field is called "fa"and contains custom invoice number
There were multiple issues with various custom fields after upgrade (they disappeared from frontend and backend), but I managed to solved everything except this one
There are other custom fields in invoice displaying correctly. I can find no differences in the options/settings for this custom field.
I can see the custom field value in order details and order listings, but it dissapeared from invoice.
Display > Custom fields > I have tried set to Yes everywhere, no difference.
Display custom item fields under System>Config>Display set to Yes.
I have tried to click on Check database - no difference.
Please advise. What else should I chceck?
Thanks!

Attachments:
Last edit: 7 years 3 weeks ago by montemama.
The following user(s) said Thank You: OA

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 3 weeks ago #268383

Hi,

Well, the issue is that you're missing the whole code to display custom order fields on the invoice:

$fieldsClass = hikashop_get('class.field');
			$fields = $fieldsClass->getFields('display:invoice=1',$this->order,'order');
			if(!empty($fields)){ ?>
		<tr>
			<td>
				<fieldset class="hikashop_order_custom_fields_fieldset">
					<legend><?php echo JText::_('ADDITIONAL_INFORMATION'); ?></legend>
					<table class="hikashop_order_custom_fields_table adminlist" cellpadding="1" width="100%">
						<?php foreach($fields as $fieldName => $oneExtraField) {
						?>
							<tr class="hikashop_order_custom_field_<?php echo $fieldName;?>_line">
								<td class="key">
									<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
								</td>
								<td>
									<?php echo $this->fieldsClass->show($oneExtraField,@$this->order->$fieldName); ?>
								</td>
							</tr>
						<?php
					}?>
					</table>
				</fieldset>
			</td>
		</tr>
				<?php
			}
You apparently removed it form the view file at one point.

The following user(s) said Thank You: montemama, OA

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

  • Posts: 46
  • Thank you received: 3
7 years 3 weeks ago #268422

Hi Nicolas,
I would appreciate some hint - where should I insert this piece of code? Which part of php?
I tried several possibilities, but without result - I get just a white page when I try to create invoice.
Thanks in advance for your help!

The following user(s) said Thank You: OA

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

  • Posts: 14
  • Thank you received: 1
7 years 3 weeks ago #268428

Hello,

I had the same problem I fixed this with te given code. maybe its a bug?

Well I placed the code in in the main if statement of : if($this->invoice_type=='full'){ ...... } after the first check: if(!empty($fields)){ ?>.... <?php> }
I added a screenshot for better view. It helped in my case.

Attachments:
Last edit: 7 years 3 weeks ago by OA.
The following user(s) said Thank You: montemama

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

  • Posts: 46
  • Thank you received: 3
7 years 3 weeks ago #268432

Thank you for your effort Nicolas and OA, but I am completely lost :(
My code is customized and I really do not know where to insert it. I tried again, but no result.
My php code is attached to first post (txt). I would be sooo happy and thankfull if you could send me my corrected php.

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 2 weeks ago #268423

Hi,

You can put it before or after that code:
JPluginHelper::importPlugin('hikashop');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onAfterOrderProductsListingDisplay', array(&$this->order, 'order_back_invoice'));

Please understand that this is customization work. Please contact the developer who made the changes to the view if you can't do it yourself.

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

  • Posts: 46
  • Thank you received: 3
7 years 2 weeks ago #268471

YES! I did it! I am so happy that I fixed it! :)
Thank you for your help, Nicolas and OA!

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

  • Posts: 209
  • Thank you received: 18
  • Hikashop Business
6 years 10 months ago #273758

Using Hikashop 3.0.1 / Joomla 3.7.3

I have several custom fields that are in the "item" table. In their setup, under the heading "DISPLAY", I have set the parameters on each to "Invoice=YES". Following a HS upgrade, these fields are not showing on the invoice.

I did have a customization in the invoice.php file (to include the customer's email address), however I removed it. My invoice.php now is per the attachment. I thought that removing customization reverted the code back to the core hikashop code. Is that not the case?

I tried to insert the code mentioned above into invoice.php but it made no difference.

What exactly should the invoice.php code have such that the item custom fields show on the invoice?

Thanks.

Attachments:

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
6 years 10 months ago #273760

Hi,

There were some bugs with custom item fields in HikaShop 3.0.1.
Updating to HikaShop 3.1.1 with the invoice.php view file of the 3.1.1 would fix that.
The line:
$itemFields = $this->fieldsClass->getFields($item_type,$product,'item');
in your invoice.php should actually be:
$itemFields = $this->fieldsClass->getFields($type,$product,'item');
like it is on our end with the 3.1.1 but another change might be required (there were several patches added for custom item fields).

The following user(s) said Thank You: JIK

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

  • Posts: 70
  • Thank you received: 2
  • Hikashop Business
6 years 10 months ago #274182

Hi

when i go to invoice on orders my Custom field missin in invoice.

I am ringing - HikaShop 3.1.1 - Joomla 3.7.2...

Where do i find the invoice .php file so i can insert the above code so when i show invoice the custom fields are there...

Thanks for you help :)

Last edit: 6 years 10 months ago by Uniweb.

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
6 years 10 months ago #274188

Hi,

You can edit all the view files of HikaShop in the menu Display>Views.
So go there and add that change to your custom view file if it has been customized.
Otherwise, change that the display settings of your custom field are configured properly in the menu Display>Custom fields.

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

  • Posts: 70
  • Thank you received: 2
  • Hikashop Business
6 years 9 months ago #274486

Hi Nicolas

Thanks for your help that fixed my problem...

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

Time to create page: 0.107 seconds
Powered by Kunena Forum