News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove Vendor First and Last name from invoice

Started by batboiko, October 25, 2012, 17:50:23 PM

Previous topic - Next topic

batboiko

VM 2.0.12f - Joomla 2.5.7


How can i remove the vendor First and Last name from the Invoice shopper receives ? The Vendor name is our Company and is sound funny  Mr. Company :)

I know all the files are in here : components/com_virtuemart/views/invoice/tmpl/

I try to look for this in to mail_html_header.php but i didn't find it

Thanks

bytelord

#1
Hello,

As you see inside the mail_html_header.php arround line 29 it's echo'ing the vendorAddress, vendorAddress has all that information you saw and is created from the public function renderVendorAddress.

So, inside the template mail_html_header.php (i assume that you will create an override for that file) we could use the function renderVendorAddress to render it again and exclude some more information, so in line 29 we have

<?php echo $this->vendorAddress?>

Replace with the following 2 lines:

<?php $vendorAddressnewshopFunctions::renderVendorAddress($virtuemart_vendor_id,"<br />",array('name','username','email','agreed','first_name','last_name')); 
            echo 
$vendorAddressnew?>


and will work as you wish!

An other way to do this ... just saying :
Go to backend Shop->Shop-> Additional information and place one space to first name and one space to last name and press save ...

I prefer the first one, so good luck :)

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

batboiko

I use the second method and is working great

Thank you for the support

bytelord

Hello,

Great, i prefer the second one because each time you want to edit shop you have to place that spaces again :)
btw, you could use first, last name as a slogan ;)

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

ufo_hk

Hi,

For those who used the second option - spaces for blank names, how did you remove the title Mr/Mrs from the line in the invoice?

Thanks

Maxim Pishnyak

#5
Quote from: ufo_hk on July 30, 2013, 03:11:07 AM
For those who used the second option - spaces for blank names, how did you remove the title Mr/Mrs from the line in the invoice?
Did you look into shopper field with the name "Title"?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

fastpat27

Quote from: Maxim Pishnyak on July 30, 2013, 21:26:40 PM
Quote from: ufo_hk on July 30, 2013, 03:11:07 AM
For those who used the second option - spaces for blank names, how did you remove the title Mr/Mrs from the line in the invoice?
Did you looked into shopper field with the name "Title"?

Hi Maxim
What do you mean here? I looked in Control Panel > Shop > Shopper Information > where "Title" has 2 options, "Mr" or "Mrs", I couldn't see a way of not showing any?

Thanks
FP

ufo_hk

#7
Quote from: Maxim Pishnyak on July 30, 2013, 21:26:40 PM
Did you looked into shopper field with the name "Title"?

Yes - even added a blank line for an entry, tried to apply this to the "vendor" user and it did not work, because the "blank" field does not show up as an option to select, when trying to change this in either:
Vendor additional information or
via "shoppers" information.

The blank field does show in the "registration" form now but thats only good for new registrations.

ufo_hk

Quote from: fastpat27 on August 11, 2013, 20:58:21 PM
Quote from: Maxim Pishnyak on July 30, 2013, 21:26:40 PM
Quote from: ufo_hk on July 30, 2013, 03:11:07 AM
For those who used the second option - spaces for blank names, how did you remove the title Mr/Mrs from the line in the invoice?
Did you looked into shopper field with the name "Title"?

Hi Maxim
What do you mean here? I looked in Control Panel > Shop > Shopper Information > where "Title" has 2 options, "Mr" or "Mrs", I couldn't see a way of not showing any?

Thanks
FP

You can add additional titles under "title" including a blank field - however it didn't change my vendor title even thou I tried.

Maxim Pishnyak

#9
Did you try Bytelord's advices (see posts above) that could be applicable to a Title field also?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

fastpat27

#10
Hi Maxim
I wouldn't be confident enough to hack the coding as Bytelord suggests. I could probably find the file to hack after a bit of searching but it's the array of fields (array('name','username','email','agreed','first_name','last_name') I'm not too sure about, as in where do I find them to know what to display, and is this what I need to be altering in the first place??

His second solution sounded easier but only replaces the name with a dot instead of removing it.

Thanks
FP

Maxim Pishnyak

com_virtuemart.2.0.20b\components\com_virtuemart\views\invoice\tmpl\mail_html_header.php

<tr>
<td align="top">
<img src="<?php  echo JURI::root () . $this->vendor->images[0]->file_url ?>" />
</td>
<td>
<?php echo $this->vendorAddress?>
</td>
</tr>

com_virtuemart.2.0.22\components\com_virtuemart\views\invoice\tmpl\mail_html_header.php
<tr>
<?php if ($this->vendor->vendor_letter_header_image>0) { ?>
<td class="vmdoc-header-image"><img src="<?php  echo JURI::root () . $this->vendor->images[0]->file_url ?>" style="width: <?php echo $this->vendor->vendor_letter_header_imagesize?>mm;" /></td>
<td colspan=1 class="vmdoc-header-vendor">
<?php } else { // no image ?>
<td colspan=2 width="100%" class="vmdoc-header-vendor">
<?php ?>
<div id="vmdoc-header" class="vmdoc-header" style="font-size: <?php echo $this->vendor->vendor_letter_header_font_size?>pt;">
<?php echo VirtuemartViewInvoice::replaceVendorFields ($this->vendor->vendor_letter_header_html$this->vendor); ?>
</div>
</td>
</tr>

What ideas do you have, Fastpat27?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

fastpat27

#12
Hi Maxim
VM 2.0.22a

I replaced:

<?php if ($this->vendor->vendor_letter_header>0) { ?>
<tr>
<?php if ($this->vendor->vendor_letter_header_image>0) { ?>
<td class="vmdoc-header-image"><img src="<?php  echo JURI::root () . $this->vendor->images[0]->file_url ?>" style="width: <?php echo $this->vendor->vendor_letter_header_imagesize?>mm;" /></td>
<td colspan=1 class="vmdoc-header-vendor">
<?php } else { // no image ?>
<td colspan=2 width="100%" class="vmdoc-header-vendor">
<?php ?>
<div id="vmdoc-header" class="vmdoc-header" style="font-size: <?php echo $this->vendor->vendor_letter_header_font_size?>pt;">
<?php echo VirtuemartViewInvoice::replaceVendorFields ($this->vendor->vendor_letter_header_html$this->vendor); ?>
</div>


with:

<?php $vendorAddressnewshopFunctions::renderVendorAddress($virtuemart_vendor_id,"<br />",array('name','username','email','agreed','first_name','last_name')); 
            echo 
$vendorAddressnew?>


I now get this error on payment:
Parse error: syntax error, unexpected '}' in /home/acc***here/public_html/components/com_virtuemart/views/invoice/tmpl/mail_html_header.php on line 33

and my invoices haven't changed (attached but edited out some details)

My idea would be to have:
Logo
Company name
Address
Town
Postcode


I hope this makes sense...

Regards
FP


[attachment cleanup by admin]

Maxim Pishnyak

Let's test with this
<?php if ($this->vendor->vendor_letter_header>0) { ?>
<tr>
<?php if ($this->vendor->vendor_letter_header_image>0) { ?>
<td class="vmdoc-header-image"><img src="<?php  echo JURI::root () . $this->vendor->images[0]->file_url ?>" style="width: <?php echo $this->vendor->vendor_letter_header_imagesize?>mm;" /></td>
<td colspan=1 class="vmdoc-header-vendor">
<?php } else { // no image ?>
<td colspan=2 width="100%" class="vmdoc-header-vendor">
<?php ?>
<div id="vmdoc-header" class="vmdoc-header" style="font-size: <?php echo $this->vendor->vendor_letter_header_font_size?>pt;">
<?php echo VirtuemartViewInvoice::replaceVendorFields ($this->vendor->vendor_letter_header_html$this->vendor); ?>
<?php $vendorAddressnewshopFunctions::renderVendorAddress($virtuemart_vendor_id,"<br />",array('name','username','email','agreed','first_name','last_name')); 
echo $vendorAddressnew?>

</div>
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

fastpat27

Thanks Maxim
I have replaced the code and no errors so all is good that end. If I view a PDF though, it still hasn't changed. Do I need to change any settings inside VM?

I'll PM your a copy of the invoice.

Regards
FP