Recently I got an requirement to add multiple email ID’s seperated by comma(,) in Virtuemart 1.1.9 store setting (Edit Store), so that one vendor can get the purchasing intimation email on his different Email ID’s. But unluckily Virtuemart 1.1.9 do not allows adding multiple email ID’s in store setting.

So to fulfill the requirement I added some custom code in Virtuemart admin files. Here is the code and files to modify.
1. Locate – /administrator/components/com_virtuemart/classes/ps_vendor.php
2. Find the below code and comment it like this
/*if (!vmValidateEmail($d["contact_email"])) {
$vmLogger->err( 'Please provide a valide email address for the vendor contact.' );
return False;
}*/
By commenting the above code virtuemart will stops displaying the warning of invalid email address and now it allows you to add multiple email ID’s seperated with comma(,).
But story doesn’t end’s here, because still virtuemart will not shoots the purchasing email to any of the ID’s added.
3. Now locate – /administrator/components/com_virtuemart/classes/ps_checkout.php
4. Search for the below code
// Email Addresses for shopper and vendor
// **************************************
$shopper_email = $dbbt->f("user_email");
$shopper_name = $dbbt->f("first_name")." ".$dbbt->f("last_name");
$from_email = $dbv->f("contact_email");
5. Replace it with
// Email Addresses for shopper and vendor
// **************************************
$shopper_email = $dbbt->f("user_email");
$shopper_name = $dbbt->f("first_name")." ".$dbbt->f("last_name");
$email = explode(',',trim($dbv->f("contact_email"),','));
$from_email=$email[0];
Please note:- In the above code we assigned the very first email ID as a “from” email ID. So for example if you are going to enter abc@gmail.com,xyz@gmail.com then the receiving mail is going to display abc@gmail.com as a “from” email id.
6. Now in the same file search for
if ( !$shopper_mail || !$vendor_mail )
7. And just above searched code line add this code
if(count($email)>1)
{
for($j=1;count($email)>$j;$j++)
{
$vendor_mail = vmMail( $from_email, $mosConfig_fromname, $email[$j], $vendor_subject, $vendor_mail_Body, $vendor_mail_AltBody, true, null, null, $EmbeddedImages, null, $shopper_email);
}
}
So in the above code we added a loop to grab all email ID’s and shoot them email one by one.
Here you are done, now just go ahead and check the implemented functionality.