News:

Support the VirtueMart project and become a member

Main Menu

Hide table generated on PDF upon confirmation?

Started by mailblade, June 27, 2018, 15:51:40 PM

Previous topic - Next topic

mailblade

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:


<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

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

mailblade

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

I managed to get it working using groups and user ID's. That's how I hid the tables.