VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: mailblade on June 27, 2018, 15:51:40 PM

Title: Hide table generated on PDF upon confirmation?
Post by: mailblade 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:


<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?
Title: Re: Hide table generated on PDF upon confirmation?
Post by: Jörgen 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 (https://stackoverflow.com/questions/21286113/trying-to-find-list-of-supported-css-for-tcpdf)

regards

Jörgen @ Kreativ Fotografi
Title: Re: Hide table generated on PDF upon confirmation?
Post by: mailblade 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.
Title: Re: Hide table generated on PDF upon confirmation?
Post by: mailblade 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.