0
Hi Germinal,
I have a new question for you!
As far as I understand, only user billing data are available as tokens that I can add in my invoice template. Since the user can add/select a different shipment address during the order process, and considering that it can be retrieved in Virtuemart, I was wondering about adding this in the template.
Adding the proper fields in the template is not a problem: I should be able to do this. Real trouble is having shipment data fields as tokens! Is there any way to achieve this?
Regards!
Vittorio
I have a new question for you!
As far as I understand, only user billing data are available as tokens that I can add in my invoice template. Since the user can add/select a different shipment address during the order process, and considering that it can be retrieved in Virtuemart, I was wondering about adding this in the template.
Adding the proper fields in the template is not a problem: I should be able to do this. Real trouble is having shipment data fields as tokens! Is there any way to achieve this?
Regards!
Vittorio
Accepted Answer
0
Hello,
finally I solved the problem thanks to Germinal! Notes variable is filtered to allow HTML code in it, so the content I wanted to pass to it was filtered (ignored).
By commenting a particular row in the invoice model php file, notes token now works the way I want, "importing" the info I need.
Thanks!
finally I solved the problem thanks to Germinal! Notes variable is filtered to allow HTML code in it, so the content I wanted to pass to it was filtered (ignored).
By commenting a particular row in the invoice model php file, notes token now works the way I want, "importing" the info I need.
Thanks!
Responses (11)
-
Accepted Answer
0Hello Vittorio,
The thing here is that there is not "shipping address" fields in the invoice manager invoice form.. I mean, there's no "place" where this is imported. Since it's an "invoicing" system it does not have place for shippment info..
the "difficult" part of this is not to create the tokens for the template (this is relatively easy..), the hard part is that new fields in the invoice form should need to be created to actually store this info (taken from the VM order table, of course)
do you know what I mean? -
Accepted Answer
0Hello,
thanks for your feedback. My request comes from the fact that, invoicing to a company, it could happen that the destination of the goods (maybe a warehouse) could be different from the legal headquarters of the company itself. So I would like to take trace of both addresses even in the invoice.
I try to understand how hard could be the addition of these fields. In \components\com_invoices\views\invoice\tmpl\default.php file there are all the available tokens. Adding the new ones should be the easy part, right? The hard part is the "link" to VM order table, isn't it? Something dealing with \plugins\invoicessearch\virtuemart\virtuemart.php file, probably. I understood it in general, but I do not know how to change/customize them for my purpose.
If my understanding is correct, is there any way you can help me?
Regards
Vittorio -
Accepted Answer
0hello,
yes, adding tokens is made in that file, and it's quite straighforward. as you say, the "hard" part is linking to the VM table.
actually, not linking to the table, but the fact that this data NEEDS to be imported into the invoice when it is created.
yes, the invoice is created in that file \plugins\invoicessearch\virtuemart\virtuemart.php
the problem is that there's no place where to "store" this data in the INVOICE model.
the easiest way that I can see around this would be to import the data (the shipping info) into an UNUSED field of the invoice... probably the NOTES field.
then you can use the {notes} token to display the info.
but, again, the important part here would be to tell the plugin to take the VM shipping info from the order and put it in the NOTES field for the invoice. -
Accepted Answer
0Hi Germinal,
if using {notes} token is currently the easiest solution, then it's ok.
I tried to add my personal SQL query in virtuemart.php file, creating also $item->ship_address, self-explanatory, in addition to the others already existent. Now it's not clear to me how to have this information in {notes} token, since I did not find where the other fields are "linked" to the proper token. In default.php I found the $search and $replace arrays fields, but I cannot understand how to proceed. Is really this the file I have to change for my purpose?
Thanks -
Accepted Answer
0you don't need to modify anything there because the {notes} token is already created for you
all you need to do is make sure that in the virtuemart plugin.
but.. SORRY, I made a mistake in my previous post. the file is NOT \plugins\invoicessearch\virtuemart\virtuemart.php
the file you're looking for is: \plugins\system\invoicemanager_virtuemart\invoicemanager_virtuemart.php -
Accepted Answer
0Hi Germinal,
maybe it's too complicated for me. I saw the file you mentioned and tried to work on it. Adding a new sql query in order to get shipping information shall not be so hard...but then, I have no idea about saying "put this information into {notes} token"... could you give me any hint?
Thanks -
Accepted Answer
0Hello Vittorio,
I asumed you knew a bit of PHP and MySQL programming... otherwise it can be difficult to implement this. I was trying to "guide" you asuming you would have the skills.. in any case please remember we have a Custom Coding Service which you can hire to develop any custom coding that you may need (like this one or others).
What i meant is that in that file, all the info for the invoice is populated, in an array. in that case you would need to populate the "notes" field with the info from the Shipping address taken from the VM order... -
Accepted Answer
0Hi Germinal,
it seems I have some trouble here... I cannot understand what is wrong.
I worked on the file you told me, creating query for the addition of the information about shipping address.
Now, if I insert these data into "to_address" token, just substituting for example the billing infos, it works. If I use {to_zip}, {to_city}, {to_state}, {to_country} as shipment address tokens, it works too. So query should be ok.
It does not work if I assign the infos to {notes} token. First of all, it seems it does not exist in the original invoice_data array, so I manually added it: I tried both to put it in the end of the invoice_data array and between "invoice_date" and "template_id" fields, trying to respect the SQL table columns order... simply, there's no info when I create pdf invoice. Neither there is if I open MYSQL #__invoices_invoices table: "notes" field is always empty.
Am I missing something?
Regards -
Accepted Answer
-
Accepted Answer
0Can I share php file with you, attaching it here? Do you need other files, eventually?
Please let me know.-
Germinal Campsmore than a month agoif you want to send me a file at support@ joomlathat.com I'll be glad to take a look.. but again, I cannot "do development" on this unless is through our Custom Coding Service.. all I will be able to tell you is what I told you here, that is, if the code looks good from my point of view or you're missing something...
-
vittoriobrunomore than a month agoYes, for sure. I do not want you to solve my issue writing the code; I just want you to help me in understanding if I am missing something.. that is what you said.
I am sending you the file via email.
Thanks
PS. Sorry, but I first answered to you with another reply :(
-
-
Accepted Answer
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »