Price column width in PDF invoice

  • Posts: 5
  • Thank you received: 0
  • Hikashop Essential
5 months 6 days ago #356966

-- HikaShop version -- : 5.0.1
-- Joomla version -- : 4.4.0
-- PHP version -- : 8.2
-- Browser(s) name and version -- : Firefox 120.0
-- Error-message(debug-mod must be tuned on) -- : No errror message

]I started using HikaShop for the first time. Installed the latest version (ESSENTIAL) on a Joomla! 4.4.0.
There is a problem with the width of the price column in the PDF invoice. The € sign is above the price (see image).

I am searching for a solution for a couple of hours without any luck.
Can someone give me a suggestion in which file I have to change code?

Any help is appreciated!
Bert

Attachments:

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
5 months 6 days ago #356967

Hi,

One easy solution you could try is to change your currency format settings via the System>Currencies menu. You could either remove the space between the symbol and the price, or change it to

 
which is a HTML code space.

Now, you could also set the width of the column, in the invoice template file. In the files of the folder plugins/hikashop/attachinvoice/attachinvoice/ you can find a line like this:
<th style="width:100px" class="price">
which defines the width of the total price column on your screenshot.
So you could copy the file to media/com_hikashop/plugins/ via FTP and modify your copy so that it becomes an override of the default invoice template file. Then, you can modify your template and you're done.

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

  • Posts: 5
  • Thank you received: 0
  • Hikashop Essential
5 months 5 days ago #356979

Hello,

If I remove the space the column is fine but the correct way is with the space.
To accomplish this I have to make the width of the column bigger.

I can not find the template invoice file.

In the plugins/hikashop/ folder is no folder or file with the name: attachinvoice.
same for the folder media/com_hikashop/ there in no plugins folder.

Can you give me a suggestion where this invoice template file could be located?

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
5 months 5 days ago #356983

Hi,

It's not possible you don't have the attachinvoice folder there if you're using the PDF invoice plugin:
www.hikashop.com/marketplace/product/18-plugin-pdf.html
So please double check.

Or maybe you're actually not using this plugin ? But in that case the invoice generated by HikaShop is not a PDF. it's an HTML page. In that case, you can use some simple CSS to tweak the look.
Here is a documentation on how to add custom CSS to HikaShop:
www.hikashop.com/support/documentation/1...ize-the-display.html
With the developer tools of your browser, you should be able to find the class/id to use to customize this column to your needs.
You could also create a view override to change the HTML. This documentation also covers this, but I think it's better to add custom CSS than view overrides as it will be easier to maintain for you in the future.

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

  • Posts: 5
  • Thank you received: 0
  • Hikashop Essential
5 months 4 days ago #357035

I realize now that I do not have a PDF plugin.
The invoice Popup is HTML. In the HTML the column is to small and I was using the PDF printer on my computer.

I have to find the CSS file and find out which code I have to change.
Is it correct that if I know which line I have to change that I can write the new code in backand_custom.css?

Bert

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

  • Posts: 5
  • Thank you received: 0
  • Hikashop Essential
5 months 4 days ago #357038

I got it fixed.
In the folder administrator-components-com_hikashop-views-order-tmpl made a change in invoice.php

Added:
<style>
table.adminlist.table.table-striped td {
min-width: 80px; // Or more as value for your command;
}
</style>

Thanks for the patience and support.

Bert

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
5 months 4 days ago #357044

Hi,

I would rather recommend you add CSS like this:
www.youtube.com/watch?v=ccwzg_F76tk
That way, you keep using the default backend CSS and the default view of HikaShop so that when we add CSS or we change the invoice view in the HikaShop backend, you get the modifications.

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

  • Posts: 5
  • Thank you received: 0
  • Hikashop Essential
5 months 3 days ago #357060

Yes I understand what you say. I should not modify the core files because I can loose changes if the shop is getting updates.
I will watch the instructions, If I can not figure it out I will get back to you.

Thanks,
Bert

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
5 months 3 days ago #357072

Hi,

You won't loose your changes with HikaShop updates since you made it as an override. However, even an override is not the best because it means that you'll keep using your override and not the default view of HikaShop. So in the future, when we change the code in the view (to add extra features, or fix bugs with future versions of Joomla or PHP) you won't get these changes in your override.

If you add your CSS as I recommend, you get the best result as you won't have to worry about missing out on code changes in the view.

Last edit: 5 months 3 days ago by nicolas.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum