Add product unit token

0
Hi,
I tried to modify one query in invoicemanager_virtuemart.php file in order to get the information about the product_unit field of a VirtueMart product. My purpose is to add a specific token about product unit, to be used in the template.
I tested my modified query in phpmyadmin panel and it works, so I assume query is correct. This query adds product_unit field to $orderitems variable.
Now, modifying $items array in the same file in order to consider this new token (I tried both to add this token in the end of the array and to replace one element already existing that it is not needed for my purposes), I cannot see any value for this token. Invoice lists always empty values for it. I tried also to modify something in /components/com_invoices/views/invoice/tmpl/default.php, with no success.
Is it possible for you to help me understanding where I am wrong, providing access to the files?

Thanks, Vittorio

Accepted Answer

Tuesday, September 13 2016, 11:06 AM - #Permalink
0
Thank you Germinal!
I added this column in invoices_items table, updated both default.php and invoicemanager_virtuemart.php files, run a test order in VirtueMart and now it works! I can see the values!

Regards
Vittorio
The reply is currently minimized Show
Responses (5)
  • Accepted Answer

    Tuesday, September 13 2016, 10:38 AM - #Permalink
    0
    .. but are you adding this new field to the DB?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 13 2016, 10:47 AM - #Permalink
    0
    No, it is a field already existent in the DB. It's product_unit field contained in virtuemart_products table.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 13 2016, 10:48 AM - #Permalink
    0
    yeah but it's not in Invoice Manager tables.. !! if it's not in IM, it's not stored and therefore it can't be rendered.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 13 2016, 10:52 AM - #Permalink
    0
    Ah ok, I thought it was just matter of code. So if I add a column in the table invoices_items could it work then?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 13 2016, 10:53 AM - #Permalink
    0
    well, I can't garantee it because I haven't seen your code. But yes, you DEFINITELY need to add the field .
    The reply is currently minimized Show
Your Reply