Print Button Doesn't Work With Custom Invoice

  • Posts: 37
  • Thank you received: 3
9 years 5 months ago #204002

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.40
-- Browser(s) name and version -- : Firefox 38.0.5
-- Error-message(debug-mod must be tuned on) -- : no errors generated

I have tested this several times: Every time I customize the invoice layout, the print button no longer works for either the 'Invoice' or 'Shipping Invoice' popups.

To recreate the issue:
1. Go to Display > Views and choose the Backend Order Invoice.
2. You don't even have to do any actual customization. Just open the file and save it.
3. Go to Orders and click on any order.
4. Click the 'Invoice' button or the 'Shipping Invoice' button.
5. Click the printer icon at the top right. Nothing happens.
6. Go back to the 'Invoice' view file and remove customization.
7. Repeat steps 3-5. The print buttons works.

At first I thought there was something wrong with my code. But there isn't. I can put the same code in the core file in administrator > components > com_hikashop > views > order > tmpl > invoice.php -- and it works! Prints just fine. The only problem is that the next update will overwrite it so I want to get the Layout Customization working.

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

  • Posts: 82866
  • Thank you received: 13373
  • MODERATOR
9 years 5 months ago #204011

Hi,

We don't have that issue.
It looks like something to do with your web server messing up the saving of the customized view.
I suppose that if you do it manually, you won't have the problem.
So copy the file administrator > components > com_hikashop > views > order > tmpl > invoice.php to administrator > templates > YOUR_TEMPLATE > html > com_hikashop > order > invoice.php and then edit the copy in the template folder.
It will do the same as a view override but it will circumvent the issue with your web server messing up the file when saving it via the interface.

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

  • Posts: 37
  • Thank you received: 3
9 years 5 months ago #204067

Thanks for the feedback! Based on what you said, I suspected RSFirewall. I turned off the scanner and sure enough, it saved properly and the print button works.

The following user(s) said Thank You: Jerome

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

  • Posts: 18
  • Thank you received: 0
7 years 9 months ago #261692

I have got exaclty the same problem.
I tried the solutions you mentioned above but without success. The problem remains.

Joomla 3.6.2 & Hikashop Business 3.0.0

Last edit: 7 years 9 months ago by mxcom.

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

  • Posts: 82866
  • Thank you received: 13373
  • MODERATOR
7 years 9 months ago #261695

Hi,

I highly suspect that the cause is different from efocus' problem.
So we'll need more information to be able to help.
Are you using HikaInvoice or the HikaShop PDF invoice plugin which override the display of the invoice ?
Could you do some screenshots of what happens ?
Do you get an error in your browser's error console when that happens ?
If you turn on the error reporting and debug mode of the Joomla configuration do you get an error message ?

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

  • Posts: 18
  • Thank you received: 0
7 years 9 months ago #261771

Hi,
i dont use Hikashop PDF invoice plugin. I use Hikashop invoice from backend.
When the invoice is customized (i added logo and extra information) then the print icon does not function at all. I can sse the print icon but when i click it nothing happens.
When i erase the customization then it works fine and i can print the invoice.
I do not get any errors with error reporting on and debug mode.

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

  • Posts: 12953
  • Thank you received: 1778
7 years 9 months ago #261780

Hello,

When the invoice is customized (i added logo and extra information) then the print icon does not function at all. I can sse the print icon but when i click it nothing happens.

That's actually weird, when I customize the code of my invoice by adding for example a logo, the print is still working, so the problem must be coming from the way you customized it.

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

  • Posts: 18
  • Thank you received: 0
7 years 9 months ago #261893

Hi,
i found the problem.
The code was the following:
<a href="#" on-click="document.getElementById('print').style.visibility='hidden';window.focus();window.print();return false;">

I changed it to:
<a href="#" onclick="document.getElementById('print').style.visibility='hidden';window.focus();window.print();return false;">

and now it works. it seems that the problem was the "-" in the words on-click

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

  • Posts: 82866
  • Thank you received: 13373
  • MODERATOR
7 years 9 months ago #261898

Hi,

There is no dash like that by default in HikaShop. Here is a screenshot of the default code:
monosnap.com/file/ggZDhYNv2wc4PJfjhk1JUjqAWM2Gic
So that means that when you save the modification of the invoice view file, something on your website add that dash.
It's probably coming from a security extension.

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

Time to create page: 0.098 seconds
Powered by Kunena Forum