VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: cachupan on May 14, 2015, 20:55:45 PM

Title: Error: Confirmation order email only send with the main vendor email [SOLVED]
Post by: cachupan on May 14, 2015, 20:55:45 PM
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
Title: Re: Error: Confirmation order email only send with the main vendor email
Post by: jenkinhill on May 15, 2015, 16:11:14 PM
See http://forum.virtuemart.net/index.php?topic=79800

And http://forum.virtuemart.net/index.php?topic=104795.0
Title: Re: Error: Confirmation order email only send with the main vendor email
Post by: cachupan on May 15, 2015, 16:17:14 PM
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
Title: Re: Error: Confirmation order email only send with the main vendor email
Post by: cachupan on May 19, 2015, 22:23:06 PM
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.

Title: Re: Error: Confirmation order email only send with the main vendor email [SOLVED]
Post by: Milbo on May 20, 2015, 10:32:14 AM
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;