Hello.
I have a VM3 (Edit: VirtueMart 3.0.6.4 - Joomla! 3.4.0) shop with multivendor configuration. I've set the vendors emails correctly in the configuration. But when the order confirmation email is send to the vendor or the costumer, only appear the main vendor's email, not the correct vendor, althought the name of the vendor appears correctly in both emails. In this way, the order email notify only is sent to the vendor 1, not to the others.
I don't know if it's a bug or a configuration mistake, but I'll be graceful if someone help me with this problem.
Thanks in advance.
Edit: VirtueMart 3.0.6.4 - Joomla! 3.4.0
See http://forum.virtuemart.net/index.php?topic=79800
And http://forum.virtuemart.net/index.php?topic=104795.0
Ok, thanks for your advice, I've edited with the exact version I'm using.
Using: VirtueMart 3.0.6.4 - Joomla! 3.4.0
I have found the solution!!
I've modified the file orders.php in administrator\components\com_virtuemart\models
Line 1554
Change the code:
$virtuemart_vendor_id=1
For:
$virtuemart_vendor_id = $order['details']['BT']->virtuemart_vendor_id;
I think this an important bug.
Yes, as you know, we added anywhere the vendorId and set it first always to 1, and now peu a peu we set the right ids.
But you use here the vendorId of the BT address, which I thought is wrong, but it is correct. $order['details']['BT']->virtuemart_vendor_id is the vendorId of the order table (not of the userinfo)
$virtuemart_vendor_id = $order['details']['BT']->virtuemart_vendor_id;
$vendorModel = VmModel::getModel('vendor');
$vendor = $vendorModel->getVendor($virtuemart_vendor_id);
$vars['vendor'] = $vendor;
$vendorEmail = $vendorModel->getVendorEmail($virtuemart_vendor_id);
$vars['vendorEmail'] = $vendorEmail;