News:

Support the VirtueMart project and become a member

Main Menu

Remove Vendor First and Last name from invoice

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

Previous topic - Next topic

Maxim Pishnyak

So these rows don't do anything, right?<?php $vendorAddressnewshopFunctions::renderVendorAddress($virtuemart_vendor_id,"<br />",array('name','username','email','agreed','first_name','last_name')); 
echo 
$vendorAddressnew?>

Then these command must be deleted, if they don't help.
BTW in current versions there is a command
<?php echo VirtuemartViewInvoice::replaceVendorFields ($this->vendor->vendor_letter_header_html$this->vendor); ?>

Did you saw 'vendor_letter_header_html' in that row? Did you check file with corresponded name?
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

antonitus

#16
You don't  have to touch the code to do this, just in case you update the script and you will have to change the code again, so it is not a good idea in this case.

This is what you do (as of V2.0.24) To make the 'Title', 'First Name' and 'Last Name' fields empty for the invoices, notify email, etc.

To remove the 'Title' entry:
In the 'Shopper Fields' under 'Configuration', select the 'title' field, add an empty value (hopefully this should work for your version). Save.

Disable 'required' in both 'first_name' and 'last_name'.  Go back to the Shop's Vendor, select tab 'Shopper Information' and remove data values from the  First Name & Last Name.  Save

For the 'Title' field, you need to do something a little different.  Go to the front end and log the vendor's name in, place an item into your cart and edit the billing address info, there it will allow you to add the empty value entry you made earlier. Save.  (You can do this in various ways, for example, if you have set up a menu with the VM Account, then you can do it this way, it's up to you how you want to edit this).

Now go back to the admin page of the shop's vendor, Shopper Information and you should now see a value called 'Select Option' in the 'Title' field, do not touch this otherwise you'll lose that value. It seems to replicate an empty value.  For some strange reason, you cannot see an empty 'Title' field in the front end.

Now enable 'first_name' and 'last_name' to be 'required', just as before, if you want.

Any changes you make to the shop's vendor, Shopper Information, you will have to set all of this up again.

I hope this helps.

antonitus

P.S. I have to say this way of setting up a vendor is very terrible. Why can't it be easy to do, why should we first set up a user (or Shopper in this case) to be a vendor, why can't we just set a vendor without names and title. I'm very surprised after all these years that this way of setting up a vendor is still being implemented. I hope future versions will omit this way and make it more simpler.
Joomla V3.5.1
Virtuemart V3.0.16

WouterJ

Thank you so much antonitus! Your method worked for me after days of trying to get the code to work.

antonitus

You're welcomed WouterJ. It's nice to see it is working for you.

antonitus
Joomla V3.5.1
Virtuemart V3.0.16

AH

Antonitus and Wouterj

Agreed no need to touch code or to use the convuluted solution proposed

In vm 2.0.24 the team integrated a simple invoice template configuration that is pretty good!!

Use the invoice layout in admin/shop - Invoice - Tab

Letter Head
Remove this:-

{vm:vendorname}

Is a lot quicker !

+ You can do what you want in the header

e.g. untick vendor image to save space in PDF's
- Remove any palceholders you dont like
-Add your own custom header information.
etc
This also applies for the Letter Foot
Regards
A

Joomla 3.10.11
php 8.0

antonitus

Thanks Hutson, I missed that one and is much easier, quicker and less tedious to achieve.

Overall, I think we shouldn't have to create a vendor as a shopper, it doesn't really make sense. I'm assuming the vendor in my case is purely the shop name and all the information about the shop.  I also know that Virtuemart wanted a system to allow for various vendors, maybe this is why it is done like this, however this could be created differently and then apply the shopper to that vendor instead of the opposite way. This may need some more logic to make this work.
Joomla V3.5.1
Virtuemart V3.0.16

AH

Yes it might be an issue if multi vendor was ever used.  Not really a problem for me at this present time though.
Regards
A

Joomla 3.10.11
php 8.0

webtoonz

To get rid of Title, First Name and last name from Invoice and everywhere just change in the below file and that is done.

Administrator/components/com_virtuemart/helpers/shopfunctions.php

At line 694:

replace this :

static public function renderVendorAddress ($vendorId,$lineSeparator="<br />", $skips = array('name','username','email',))

with this code:
static public function renderVendorAddress ($vendorId,$lineSeparator="<br />", $skips = array('name','username','email','title','first_name','last_name'))

and around line 712:

replace this:
if ($field['name'] != 'title' and $field['name'] != 'first_name' and $field['name'] != 'middle_name' and $field['name'] != 'zip')

with this code:
if ($field['name'] != 'zip')

I have done this and it is working fine. Please keep a backup file before doing editing.


AH

webtoonz

This will be overwritten in every update!

I suggest we stick to using parameters available rather than hacking core code
Regards
A

Joomla 3.10.11
php 8.0