Error: Confirmation order email only send with the main vendor email [SOLVED]

Started by cachupan, May 14, 2015, 20:55:45 PM

Previous topic - Next topic

cachupan

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

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

cachupan

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

cachupan

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.


Milbo

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;
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/