Post by hotvb » Sun Jul 22, 2012 9:56 pm

My case:

1. store demo (store email: main@mystore.com) - default store
2. store demo1 (store email: demo1@mystore.com)
3. store demo2 (store email: demo2@mystore.com)

when John made order from Store Demo1, he received email from demo1@mystore.com
when Alice made order from store Demo2, she received email from demo2@mystore.com

but when update order status, all notification are from main@mystore.com which is default store.

does anyone know what extension can do fix this problem, thanks in advance

*** Sales-Mail-Newsletter***
when email all customer news letter, we can choose from which store
no matter we choose which store, all the email are from default store email address
just the names are different

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by straightlight » Sun Jul 22, 2012 11:56 pm

Good point.

A quick solution would be to edit your catalog/model/checkout/order.php file.

Find:

Code: Select all

if ($notify) {
add above:

Code: Select all

$this->load->model('setting/setting');

$store_info = $this->model_setting_setting->getSetting('config', $order_info['store_id']);
				
				if ($store_info) {
                                        $store_name = $store_info['config_name'];
					$store_address = $store_info['config_address'];
					$store_email = $store_info['config_email'];
					$store_telephone = $store_info['config_telephone'];
					$store_fax = $store_info['config_fax'];
				} else {
                                        $store_name = $this->config->get('config_name');
					$store_address = $this->config->get('config_address');
					$store_email = $this->config->get('config_email');
					$store_telephone = $this->config->get('config_telephone');
					$store_fax = $this->config->get('config_fax');
				}
Then, replace:

Code: Select all

$subject = sprintf($language->get('text_update_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
with:

Code: Select all

$subject = sprintf($language->get('text_update_subject'), html_entity_decode($store_name, ENT_QUOTES, 'UTF-8'), $order_id);
Then, at the very last one in the file,

replace:

Code: Select all

$mail->setSender($order_info['store_name']);
with:

Code: Select all

$mail->setSender($store_name);
Also on the very last one:

replace:

Code: Select all

$mail->setFrom($this->config->get('config_email'));
with:

Code: Select all

$mail->setFrom($store_email);
This should do it.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hotvb » Mon Jul 23, 2012 10:21 am

1. thank you very much for reply and give a solution

2. I did change by following your instruction

A: first error, after new order customer didn't receive order email
B: went back to admin back end update order status, the still from the default store email address.

3. I thought maybe need change code in root/admin/model/sale/order.php about line 683
original code: $mail->setFrom($this->config->get('config_email'));
replace by code: $mail->setFrom($store_email);
didn't get work, got error message when update order status

error message:
Notice: Undefined variable: store_email in ***/httpdocs/vqmod/vqcache/vq2-admin_model_sale_order.php on line 722
Notice: Error: E-Mail from required! in ***/httpdocs/system/library/mail.php on line 56

4. should I change any code in admin section to make it work, thanks
Last edited by hotvb on Mon Jul 23, 2012 11:10 pm, edited 1 time in total.

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by straightlight » Mon Jul 23, 2012 8:43 pm

As stated from my previous post, these modifications are for the store-front end, not for the admin end. Although, since you're using a contribution or multiple contributions that involves the admin/model/sale/order.php file to be used from VQMod, you'll need to post your XML as an attachment so for me to see how this could be integrated in your case in order to avoid errorneous.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hotvb » Mon Jul 23, 2012 10:48 pm

straightlight wrote:As stated from my previous post, these modifications are for the store-front end, not for the admin end. Although, since you're using a contribution or multiple contributions that involves the admin/model/sale/order.php file to be used from VQMod, you'll need to post your XML as an attachment so for me to see how this could be integrated in your case in order to avoid errorneous.
I found problem for the email
extension has been installed
1. multivendordropshipper
2. emailtemplate-4.1.11
because installed emailtemplate-4.1.11 caused email didn't go to customer and vender email.

that wasn't code problem

sorry for didn't mention correctly, it wasn't for front end, it is for the admin end
from admin end update order status and newsletter
email address are all from the default store email address
the front end is from the each store email address, there's no problem with OC original file

Should I make change to admin/model/sale/order.php, thanks again and sorry for the confusing.

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by straightlight » Mon Jul 23, 2012 10:52 pm

Yes. However, you will need to make the changes where the email only implies from that specific method in admin/model/sale/order.php file.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hotvb » Mon Jul 23, 2012 11:09 pm

I tried to change code admin/model/sale/order.php
under: [ function addOrderHistory] section
original code:
$mail->setFrom($this->config->get('config_email'));
replace with: $mail->setFrom($store_email);

didn't work, got error message:
Notice: Error: E-Mail from required! in ********/httpdocs/system/library/mail.php on line 56

is there any right way to change it to make from the 2nd store email address instead of the default? thanks

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by straightlight » Mon Jul 23, 2012 11:28 pm

Just changing this line won't be sufficient, of course. You need to apply all steps from my previous post.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hotvb » Tue Jul 24, 2012 12:53 am

admin/model/sale/order.php is different as catalog/model/checkout/order.php
I can't find those code to be replaced

Professional HTML Email Template & Editor for Opencart Email
http://www.opencart.com/index.php?route ... on_id=2221
they upgrade to LATEST: Email template: 4.1.12
which mention
Changelog

Version 4.1.12

Added: option to display Order picture in Customer Order emails.

Added: header text, for added small text above the header.

Fixed bug in Order Status History and Newsletter with a multi-store setup ensure that the email is sent From the correct store email.-------------but this one still no success

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by straightlight » Tue Jul 24, 2012 1:02 am

Since this request is about a specific contribution from the market, please contact the author.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by hotvb » Thu Jul 26, 2012 2:49 pm

straightlight wrote:Since this request is about a specific contribution from the market, please contact the author.
it is on the market, still need something to figure out, such as mail function, default store has mail setting tab, any additional store won't have a mail tab, also default OC 1.5.3.1 smtp is not working if using google apps.

Newbie

Posts

Joined
Sun Jul 22, 2012 9:43 pm

Post by mediaindustries » Sat Feb 16, 2013 4:19 am

Hi Straightlight,

I have exactly the same problem as topicstarter. I followed the instructions you gave in your first post. Found al the lines and replaced them or added lines etc. Did everything and uploaded the file.

I just tested it but it doens't work for me. I ordered and the order e-mail is okay (it already was okay) but the notification email is still from info@maindomain.com where the main store is installed.

I'm running a multistore setup with opencart 1.5.4.1. I don't use any vqmod modifications for e-mail updates or something. I attached my order.php file from catalog/model/checkout.

Thanks in advance!

User avatar
New member

Posts

Joined
Mon Mar 05, 2012 10:36 pm
Location - The Netherlands

Post by opencart-templates » Tue Mar 05, 2013 6:16 am

The other suggestion would never work because you need to edit the actual admin files.
You need to find the store_id from the order in the database, so that the store email address settings can be found.

You can do this by editing the: admin/model/sale/order.php
Adding:

Code: Select all

$store_settings = $this->model_setting_setting->getSetting("config", $order_info['store_id']);
$mail->setFrom($store_settings['config_email']);
Our extension fixes this issue, voucher, inserting new customer and many more as default.
hotvb wrote:admin/model/sale/order.php is different as catalog/model/checkout/order.php
I can't find those code to be replaced

Professional HTML Email Template & Editor for Opencart Email
http://www.opencart.com/index.php?route ... on_id=2221
they upgrade to LATEST: Email template: 4.1.12
which mention
Changelog

Version 4.1.12

Added: option to display Order picture in Customer Order emails.

Added: header text, for added small text above the header.

Fixed bug in Order Status History and Newsletter with a multi-store setup ensure that the email is sent From the correct store email.-------------but this one still no success

Image Image Image Image
Advanced Professional Email Template


User avatar
Active Member

Posts

Joined
Mon May 16, 2011 7:24 pm
Location - UK

Post by mediaindustries » Tue Mar 05, 2013 5:35 pm

Hi opencart-templates,

I tried your solution (in combination with the straightlight solution for the front-end) but it didn't work for me.

Can you release a vqmod solution which only fixes this?
Fixed bug in Order Status History and Newsletter with a multi-store setup ensure that the email is sent From the correct store email.

I don't need the pdf invoice etcetera. No problem to pay for it.

Thanks in advance.

User avatar
New member

Posts

Joined
Mon Mar 05, 2012 10:36 pm
Location - The Netherlands

Post by Cue4cheap » Sat Dec 28, 2013 10:37 am

Edited.... Found a basic solution but not 100%. I may release it as a VQmod if I get things worked out.
Thanks.
Mike

www.cuesplus.com


Active Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by guidone » Mon May 28, 2018 1:45 am

Same problem after all these years, i'm on OC 2.2, any solution?

User avatar
New member

Posts

Joined
Thu Mar 28, 2013 7:39 pm
Who is online

Users browsing this forum: No registered users and 14 guests