VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Vivi_2018 on October 16, 2018, 14:51:38 PM

Title: Url in invoice per product
Post by: Vivi_2018 on October 16, 2018, 14:51:38 PM
Hello,
I am trying to build an e shop that sells videos in vimeo.
I want every user when he is buying a video(product) to see in his invoice a url of the video. All this process i want it to be automated.What i thought is  to override the invoice file in the components/com_virtuemart/views/invoice/tmpl/invoice.php in order to read a field of the product(I have seen that in the creation of a product there is a URL field maybe to read that field) that is not visible in the front end and display it in the invoice.

Do you know any other way to do this? A shipment method maybe?
Thank you in advance
Title: Re: Url in invoice per product
Post by: GJC Web Design on October 16, 2018, 15:44:01 PM
product custom text field?

hide in site but show in the invoice?
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 16, 2018, 16:06:51 PM
This is just a thought. Basically the product is a url. I thought that may there is a way to send this url in  the invoice to the buyer. This is what i am trying to do. I don't want the administrator to send the url himself when the order is done. I am trying to find a way to send this url automatically when the purchase is done.

Title: Re: Url in invoice per product
Post by: GJC Web Design on October 16, 2018, 16:26:50 PM
thats what I mean .. if it is a product custom field just fill in the url per product

hide it in all FE pages

but this will be available in the invoice template

components\com_virtuemart\views\invoice\tmpl\invoice_items.php

over ride

$product_attribute = VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE');
            echo $product_attribute;

you may find a better customfields function to display/get it
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 17, 2018, 09:14:00 AM
I just found out that there is a field "URL" in the admin panel of the product that isn't visible in the description of the product in the fron end.  Can i take the value of that field and show it in the invoice?
Also the product details aren't visible in the invoice. If i have understand it correctly the product details are  in the invoice_item.php and if i want them to show them in the invoice i have to load this file in the mail_html.php i have wrote this in the mail_html.php 
echo $this->loadTemplate('invoice_items');

but it doesn't work.
Title: Re: Url in invoice per product
Post by: GJC Web Design on October 17, 2018, 10:26:45 AM
???

are u discussing the invoice (pdf) or the confirmation email?
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 17, 2018, 11:10:24 AM
As confirmation email you mean the email that the user gets as an invoice when he is buying a product ( i have attached an image )? This  invoice i can download it as  a pdf when the status is 'confirmed'. I want to be in the pdf too.
Also i found this :
http://forum.virtuemart.net/index.php?topic=138734.0 
and i wrote this code in the file :mail_html_pricelist.php.

<?php   $productModel = VmModel::getModel('product'); //should be inserted before the $item foreach loop
foreach($this->orderDetails['items'] as $item) {
   $p = $productModel->getProduct($item->virtuemart_product_id);
   $product_link = $p->product_url;
} ?>
<?php echo $product_link; ?>

And it worked.

But  i  don't want to show the url in pricelist table. I want to have a table in the invoice with the details of the products and there to show the product_url. The invoice_items.php isn't the file that show the details of the product in the invoice?
(http://invoice_li.jpg)
Title: Re: Url in invoice per product
Post by: GJC Web Design on October 17, 2018, 11:31:30 AM
the email is an email -- the invoice is a pdf

two separate things and dealt with in completely separate but similar files in the invoice template folder

QuoteBut  i  don't want to show the url in pricelist table. I want to have a table in the invoice with the details of the products and there to show the product_url. The invoice_items.php isn't the file that show the details of the product in the invoice?

then u need to create the display for it .. u have the data  -- just move it
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 17, 2018, 11:39:17 AM
The pdf of the invoice the buyer gets it, whenever  i change the status of the order to status " Confirmed "  Is this  the way get it?
Also with the changes that i made whenever i change the status to "confirmed" i get this error :TCPDF ERROR: Unable to create output file: vminvoice_181017FJIG01.pdf.

Can you tell me which files do i have to change in order to change  the email and pdf that the user gets?
Title: Re: Url in invoice per product
Post by: GJC Web Design on October 17, 2018, 12:01:05 PM
Quotetwo separate things and dealt with in completely separate but similar files in the invoice template folder

components\com_virtuemart\views\invoice\tmpl\invoice.php

over ride!
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 17, 2018, 13:10:19 PM
Thank you for your help. I have a different problem now and i hope that you can help me.
After installing virtuemart the registration form of my site changed and it uses the registration form of virtuemart. I don't want that.
How can i bring back my own registration form?
Title: Re: Url in invoice per product
Post by: GJC Web Design on October 17, 2018, 14:27:07 PM
system plugin

VM Framework Loader during Plugin Updates
Title: Re: Url in invoice per product
Post by: Vivi_2018 on October 17, 2018, 14:51:30 PM
Ok i found it  in the admin panel ..It worked.. thank you very much