Hello,
i have a problem, as I have multi-store so also multi-language store. The problem is that when I click "Add reward points" in admin/orders . The mail comes out in the ADMIN LANGUAGE and not in the default store language. I use OC 1.5.1.3, any solution to this problem would be really apreciated. Thanks.
i have a problem, as I have multi-store so also multi-language store. The problem is that when I click "Add reward points" in admin/orders . The mail comes out in the ADMIN LANGUAGE and not in the default store language. I use OC 1.5.1.3, any solution to this problem would be really apreciated. Thanks.
My fragrance parfum site profumi
Hi,
I have the same problem.
I have two languages installed.
I use the Admin section in English.
When I update an order status, the customer receives the e-mail in the language he placed the order.
When I press "Add Reward Points" he receives an e-mail in the Admin language, and not the language he placed the order.
Im running version 1541
I have the same problem.
I have two languages installed.
I use the Admin section in English.
When I update an order status, the customer receives the e-mail in the language he placed the order.
When I press "Add Reward Points" he receives an e-mail in the Admin language, and not the language he placed the order.
Im running version 1541
Hello,
I had the same problem and I solved it this way.
I hope this helps everyone.
Should go to the next file and edit it:
admin/model/sale/customer.php
search the line:
"public function addReward"
after few lines (about 6), remove the line: " $this->language->load('mail/customer'); "
after following lines insert this code:
---------------------------------------after following lines-----------------------------------
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
----------------------------------------------insert (add) this code------------------------------------
// ---------ADD---------------
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
// ---------END ADDING---------------
-------------------------------------------END---------------------------------
On the following lines
CHANGE this code: $this->language
TO this: $language
-----------------------------------CHANGE $this->language TO $language --------------------------
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
--------------------------------------------------------END CHANGE---------------------------------------------
And now the customer will recived mail by his order language.
Now we need to change the comment line in the rewards customer area.
I did it will record only the order number.
go up few lines to:
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" .$this->db->escape($description) . "', date_added = NOW()");
change this code:
description = '" . $this->db->escape($description) . "'
to this code:
description = '" . (int)$order_id . "'
The new code should look like this:
-----------------------------------------------NEW CODE------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0) {
$customer_info = $this->getCustomer($customer_id);
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . (int)$order_id . "', date_added = NOW()");
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
---------------------------------------------------END----------------------------------------------------
Thats is all.
I hope I help someone. Good luck.
I had the same problem and I solved it this way.
I hope this helps everyone.
Should go to the next file and edit it:
admin/model/sale/customer.php
search the line:
"public function addReward"
after few lines (about 6), remove the line: " $this->language->load('mail/customer'); "
after following lines insert this code:
---------------------------------------after following lines-----------------------------------
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
----------------------------------------------insert (add) this code------------------------------------
// ---------ADD---------------
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
// ---------END ADDING---------------
-------------------------------------------END---------------------------------
On the following lines
CHANGE this code: $this->language
TO this: $language
-----------------------------------CHANGE $this->language TO $language --------------------------
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
--------------------------------------------------------END CHANGE---------------------------------------------
And now the customer will recived mail by his order language.
Now we need to change the comment line in the rewards customer area.
I did it will record only the order number.
go up few lines to:
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" .$this->db->escape($description) . "', date_added = NOW()");
change this code:
description = '" . $this->db->escape($description) . "'
to this code:
description = '" . (int)$order_id . "'
The new code should look like this:
-----------------------------------------------NEW CODE------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0) {
$customer_info = $this->getCustomer($customer_id);
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . (int)$order_id . "', date_added = NOW()");
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
---------------------------------------------------END----------------------------------------------------
Thats is all.
I hope I help someone. Good luck.
Why don't you create the vQmod yourself? Rinapharm already gave you the code. Creating the vQmod is the easy part and shouldn't take very long. You can help everybody else out in return for Rinapharm helping you;-)
artisantool.co
Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.
Hi ase618
I think there is no harm in asking no offence there.
If there is a vqmod made already, maybe rinapharm would share it, if not of course I would try and make it.
I'm not a programmer, but still, I feel I help everyone else once in a while how I can.
In fact, I have shared a couple of things including vqmods on other topics and threads.
Once again, thank you rinapharm for sharing.
I think there is no harm in asking no offence there.
If there is a vqmod made already, maybe rinapharm would share it, if not of course I would try and make it.
I'm not a programmer, but still, I feel I help everyone else once in a while how I can.
In fact, I have shared a couple of things including vqmods on other topics and threads.
Once again, thank you rinapharm for sharing.
ok!
i dont know why i dont sucsesfull so -> delete the following code and copy the other code...
i found when i put my code (previous code I wrote here) i cant sent reward without order (if i want to add a reward to customer from the admin panel without an order) so now we have other fix code:
admin/model/sale/customer.php
find this code and delete:
------------------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0) {
$customer_info = $this->getCustomer($customer_id);
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . $this->db->escape($description) . "', date_added = NOW()");
$this->language->load('mail/customer');
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
$message = sprintf($this->language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($this->language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
------------------------------------------------------------
add this code:
------------------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0)
{
$customer_info = $this->getCustomer($customer_id);
if ($customer_info)
{
if ($order_id)
{
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . (int)$order_id . "', date_added = NOW()");
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info)
{
$store_name = $order_info['store_name'];
}
else
{
$store_name = $this->config->get('config_name');
}
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id)) . "\n\n";
$message .= $language->get('text_reward_end');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
else
{
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . $this->db->escape($description) . "', date_added = NOW()");
$store_name = $this->config->get('config_name');
$this->load->language('mail/customer');
$message = sprintf($this->language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($this->language->get('text_reward_total'), $this->getRewardTotal($customer_id)) . "\n\n";
$message .= $this->language->get('text_reward_end');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
}
------------------------------------------------------------
i dont know why i dont sucsesfull so -> delete the following code and copy the other code...
i found when i put my code (previous code I wrote here) i cant sent reward without order (if i want to add a reward to customer from the admin panel without an order) so now we have other fix code:
admin/model/sale/customer.php
find this code and delete:
------------------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0) {
$customer_info = $this->getCustomer($customer_id);
if ($customer_info) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . $this->db->escape($description) . "', date_added = NOW()");
$this->language->load('mail/customer');
if ($order_id) {
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info) {
$store_name = $order_info['store_name'];
} else {
$store_name = $this->config->get('config_name');
}
} else {
$store_name = $this->config->get('config_name');
}
$message = sprintf($this->language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($this->language->get('text_reward_total'), $this->getRewardTotal($customer_id));
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
------------------------------------------------------------
add this code:
------------------------------------------------------------
public function addReward($customer_id, $description = '', $points = '', $order_id = 0)
{
$customer_info = $this->getCustomer($customer_id);
if ($customer_info)
{
if ($order_id)
{
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . (int)$order_id . "', date_added = NOW()");
$this->load->model('sale/order');
$order_info = $this->model_sale_order->getOrder($order_id);
if ($order_info)
{
$store_name = $order_info['store_name'];
}
else
{
$store_name = $this->config->get('config_name');
}
$this->load->model('localisation/language');
$language = new Language($order_info['language_directory']);
$language->load($order_info['language_filename']);
$language->load('mail/customer');
$message = sprintf($language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($language->get('text_reward_total'), $this->getRewardTotal($customer_id)) . "\n\n";
$message .= $language->get('text_reward_end');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
else
{
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . $this->db->escape($description) . "', date_added = NOW()");
$store_name = $this->config->get('config_name');
$this->load->language('mail/customer');
$message = sprintf($this->language->get('text_reward_received'), $points) . "\n\n";
$message .= sprintf($this->language->get('text_reward_total'), $this->getRewardTotal($customer_id)) . "\n\n";
$message .= $this->language->get('text_reward_end');
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
}
}
}
------------------------------------------------------------
Who is online
Users browsing this forum: No registered users and 332 guests