Author Topic: Hide table generated on PDF upon confirmation?  (Read 175 times)

mailblade

  • Jr. Member
  • **
  • Posts: 85
  • A beginner
Hide table generated on PDF upon confirmation?
« on: June 27, 2018, 15:51:40 pm »
VM: Latest version
Joomla: 3.6

Hello.

I need some help with one issue: I have two tables displaying on my PDF invoice and on my "Order Details" page.

My products are still loading correctly and all is well with the PDF invoice and order display on the website.

Now, I can hide one table based on the items that are loaded (basically, I have a table for each of the categories I have, just as a means to split the items based on category)

Here is how I hide the relevant table in the web, when you view your "Order Details" after you have successfully confirmed your order:

Code: [Select]
<script type="text/javascript">
$(document).ready(function () {
if($("#frozenicos").text().trim() == ''){
       $("#frozentable").css('display', 'none');
        }
});
</script>

However, when I try and add this code on the "invoice_items.php" file, it is only appearing as normal text, and the script is not running. Does anyone know of a way to hide certain tables/fields on the PDF generated?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1539
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Hide table generated on PDF upon confirmation?
« Reply #1 on: June 27, 2018, 21:32:44 pm »
TCPDF is sensitive to scripts and fancy HTML, You have to keep it simple if You want TCPDF to convert the HTML. This can be a starter:
https://stackoverflow.com/questions/21286113/trying-to-find-list-of-supported-css-for-tcpdf

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

mailblade

  • Jr. Member
  • **
  • Posts: 85
  • A beginner
Re: Hide table generated on PDF upon confirmation?
« Reply #2 on: June 28, 2018, 07:26:09 am »
Thank you for the reply Jorgen, I appreciate it.

Yes I read through the link you sent and I can see now. However, I did manage to figure out a way how to hide it based on the current logged in user, using PHP. So I will test it with multiple logins and see if it's still working as it did yesterday when I tested it for the first time.

I'll post the solution once I am 100% sure it works.

mailblade

  • Jr. Member
  • **
  • Posts: 85
  • A beginner
Re: Hide table generated on PDF upon confirmation?
« Reply #3 on: July 16, 2018, 15:17:51 pm »
I managed to get it working using groups and user ID's. That's how I hid the tables.