PDF Invoice - Missing Custom Fields

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 7 months ago #248056

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- Browser(s) name and version -- : Chrome 52.0.2743.116 (64-bit)

I have installed the PDF Invoice plugin. For some products, it correctly displays all custom fields. For other products, it does not display all of the custom fields only some custom fields. I can find no differences in the options/settings for these custom fields. This happens across multiple products.

I have attached examples of the standard invoice with ALL custom fields and the PDF invoice with only some custom fields.

Please advise.

Attachments:

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #248062

Hi,

Try changing the code:

if(!empty($fields['item'])){
	foreach($fields['item'] as $field){
		$namekey = $field->field_namekey;
		if(empty($product->$namekey)) continue;
		echo '<p>'.$fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$product->$namekey).'</p>';
	}
}
to:
$itemFields = $fieldsClass->getFields('display:field_item_invoice=1',$product,'item');
if(!empty($itemFields)){
	foreach($itemFields as $field){
		$namekey = $field->field_namekey;
		if(!empty($product->$namekey) && strlen($product->$namekey)) {
			echo '<p>'.$fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$product->$namekey).'</p>';
		}
	}
}
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php and that should hopefully behave similarily.

Last edit: 7 years 7 months ago by Jerome. Reason: fix code

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 7 months ago #248098

Is there a marker or code missing in the replacement you provided? I am not familiar with PHP and did a direct copy/replace. It seemed to break everything.

Attachments:
Last edit: 7 years 7 months ago by leitzdesign.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 7 months ago #248105

Hi,

There was an code error in the Nicolas' post ; I fixed it.
Please re-do the copy-paste.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 7 months ago #248109

That took care of some of the orders, but not all. Here is another example.

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 7 months ago #248111

Hi,

Can you please check the custom item field configuration for the "display" settings ?
The modification that Nicolas proposed you should only get the field set for display "field_item_invoice".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 7 months ago #248153

I believe you are referring to the first screenshot "configuration-display-products.png" but I have included the second screenshot in case I am wrong.

Attachments:

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #248168

Hi,

I don't see why that wouldn't work with all the display options set to yes.
Could you provide a backend access and a FTP access for your website via our contact form (along with a link to this thread) ?
www.hikashop.com/support/contact-us.html

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 7 months ago #248313

Information submitted.

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 7 months ago #248352

Hi,

Thanks. Ok, let's try this:
Download again the install package on our website via the menu My account>My subscriptions and install it on your website. Then, edit the custom field and save its settings.
Then, try again. It should hopefully display fine for the PDF invoice too after that.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 4 months ago #256471

I apologize for the delay. I could not continue the edits while our event was in session.

Do you mean for me to reinstall the PDF invoice plugin or HikaShop?

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

  • Posts: 4502
  • Thank you received: 610
  • MODERATOR
7 years 4 months ago #256494

Hello,

Nicolas meant reinstall HikaShop install package, and not just the PDF invoice plugin.

Regards

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 4 months ago #256677

Will a reinstall delete all of my products and overall setup?

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 4 months ago #256704

No it won't.

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 4 months ago #256977

I have updated to the HikaShop 2.6.4 and reinstalled PDF Invoice, updating the custom field code (plugins/hikashop/attachinvoice/attachinvoice/invoice.php) as instructed previously.

However, the problems still exist.

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 4 months ago #257012

Hi,

Did you edit the custom field setting and save the settings after updating the HikaShop package as well ?

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 4 months ago #257069

Yes, I double-checked to be sure the custom item field configuration for the "display" settings is set to Yes.

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 4 months ago #257254

Hi,

I've activated the PDF invoice for the backend in the plugin and I did get all the fields for the order of your example:
take.ms/hwcVf
So to me it looks like it's working.
If not, could you provide instructions as to reproduce the problem ?

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

  • Posts: 31
  • Thank you received: 0
  • Hikashop Business
7 years 4 months ago #257473

Those fields had already been restored with your code adjustment from post
www.hikashop.com/forum/install-update/88...m-fields.html#248062

The standing issues with screenshots can be found in post
www.hikashop.com/forum/install-update/88...m-fields.html#248109

Other examples can be found in order numbers such as KS-00204 and KS-00061.

In addition, the installation of the PDF Invoice on the back end forces me to bring up another issue. Please refer to order number KS-00024, KS-00038, etc. The table blows off the page. The original HikaShop invoice does not have this display problem, but it is a consistent problem with the PDF Invoice plugin across multiple browsers. That's why I hadn't installed it on the backend. I needed a way to print what was missing when the PDF Invoice table blows out.

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

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
7 years 4 months ago #257525

Hi,

1. Thanks, I'm able to see the problem with that KS-00039 order.
So I tried to access your FTP server in order to debug the issue but I wasn't able to connect to it:
take.ms/n0hyo
Maybe the host should be different than the domain name, but you didn't provide the host for the FTP access.

2. Try changing the line:

echo '<p>'.$fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$product->$namekey).'</p>';
to:
echo '<p>'.$this->str_split_unicode(strip_tags($fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$product->$namekey)),50).'</p>';
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php and that should prevent that.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum