Post by straightlight » Fri Nov 24, 2017 6:31 am

Followed is the solution on how to resolve the %s sign in the catalog/language/<your_language_code>/extension/total/credit.php and reward.php file: viewtopic.php?f=190&t=199901&p=704468#p704465

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by straightlight » Fri Nov 24, 2017 7:07 am

In addition to the mentioned fix, since it will affect something else during the customer's transaction for credits and rewards:

- In catalog/model/extension/total/credit.php file,

find:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "customer_transaction SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', amount = '" . (float)$order_total['value'] . "', date_added = NOW()");
replace with:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "customer_transaction SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id_total'), (int)$order_info['order_id'])) . "', amount = '" . (float)$order_total['value'] . "', date_added = NOW()");
In catalog/model/extension/total/reward.php file,

find:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()");
replace with:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id_total'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()");
Then, in catalog/language/<your_language_code>/extension/total/credit.php and reward.php file, at the bottom of each files, add:

Code: Select all

$_['text_order_id_total'] = 'Order ID: # %s';
This should fully rectify the issue on both reported cases.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: No registered users and 9 guests