Post by kelemvor » Sat Dec 27, 2014 11:02 am

Thanks!! Also found one more:

find

Code: Select all

$this->data['filter_customer'] = $filter_customer;
add after

Code: Select all

$this->data['filter_group_customer'] = $filter_group_customer;
It's working great now.

Active Member

Posts

Joined
Fri Oct 12, 2012 6:58 am

Post by Matahari_169 » Sun May 24, 2015 11:21 pm

Thanks! I got it working in 1.5.6.4

But it displays customer group id in order list page.
How can I change the column contents to customer group name?

Newbie

Posts

Joined
Fri May 15, 2015 6:32 am

Post by straightlight » Sat Jun 27, 2015 7:04 am

Matahari_169 wrote:Thanks! I got it working in 1.5.6.4

But it displays customer group id in order list page.
How can I change the column contents to customer group name?
From my previous steps, replace this portion:

Code: Select all

$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, o.customer_group_id AS group_customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
with:

Code: Select all

$sql = "SELECT `o`.`order_id`, CONCAT(`o`.`firstname`, ' ', `o`.`lastname`) AS `customer`, (SELECT `gc`.`name` FROM `" . DB_PREFIX . "customer_group` `gc` WHERE `gc`.`customer_group_id` = `o`.`customer_group_id`) AS `group_customer`, (SELECT `os`.`name` FROM `" . DB_PREFIX . "order_status` `os` WHERE `os`.`order_status_id` = `o`.`order_status_id` AND `os`.`language_id` = '" . (int)$this->config->get('config_language_id') . "') AS `status`, `o`.`total`, `o`.`currency_code`, `o`.`currency_value`, `o`.`date_added`, `o`.`date_modified` FROM `" . DB_PREFIX . "order` `o`";

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 xiaohaizhi » Thu Aug 06, 2015 2:04 pm

straightlight wrote:
Matahari_169 wrote:Thanks! I got it working in 1.5.6.4

But it displays customer group id in order list page.
How can I change the column contents to customer group name?
From my previous steps, replace this portion:

Code: Select all

$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, o.customer_group_id AS group_customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
with:

Code: Select all

$sql = "SELECT `o`.`order_id`, CONCAT(`o`.`firstname`, ' ', `o`.`lastname`) AS `customer`, (SELECT `gc`.`name` FROM `" . DB_PREFIX . "customer_group` `gc` WHERE `gc`.`customer_group_id` = `o`.`customer_group_id`) AS `group_customer`, (SELECT `os`.`name` FROM `" . DB_PREFIX . "order_status` `os` WHERE `os`.`order_status_id` = `o`.`order_status_id` AND `os`.`language_id` = '" . (int)$this->config->get('config_language_id') . "') AS `status`, `o`.`total`, `o`.`currency_code`, `o`.`currency_value`, `o`.`date_added`, `o`.`date_modified` FROM `" . DB_PREFIX . "order` `o`";
Hi straightlight, thank you for your code. im using opencart 1.5.3.1 and had tried using the above code to achieve getting customer group name display on order list but i'm getting error from mysql saying table gc.name not exist.. I had successfully added a column "customer group" on sale page displaying customer group ID. I wish to get customer group name displayed.

Any help is appreciated. Thank you.

Newbie

Posts

Joined
Thu Aug 08, 2013 5:57 pm

Post by straightlight » Fri Aug 07, 2015 1:28 am

Verify in your customer_group table if the name field does exist. In the v2.x releases, the name field would rather be located in the customer_group_description table.

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 xiaohaizhi » Fri Aug 07, 2015 3:26 am

straightlight wrote:Verify in your customer_group table if the name field does exist. In the v2.x releases, the name field would rather be located in the customer_group_description table.

Thank you straightlight for your pointer. Solved.. Successfully display customer group name.

*For the benefit of others if anyone is having the same issue i face,

I'm using Opencart Version 1.5.3.1,

in <file name="admin/model/sale/order.php">

Code: Select all

		<search position="replace" error="log"><![CDATA[$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";]]></search>
		

Code: Select all

		<add><![CDATA[$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT gc.name FROM " . DB_PREFIX . "customer_group_description gc WHERE gc.customer_group_id = o.customer_group_id) AS group_customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";]]></add>
i had modified the customer_group_description

ps, i wanted to upload the vqmod file but i dont know why cloudflare is blocking me from uploading.

anyway theres always alternative way, here is the link to the VQMOD http://pastebin.com/fscQGAHh

Newbie

Posts

Joined
Thu Aug 08, 2013 5:57 pm

Post by straightlight » Fri Aug 07, 2015 4:08 am

Code: Select all

<add><![CDATA[$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT gc.name FROM " . DB_PREFIX . "customer_group_description gc WHERE gc.customer_group_id = o.customer_group_id) AS group_customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";]]></add>
for:

Code: Select all

<add><![CDATA[$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT gc.name FROM " . DB_PREFIX . "customer_group_description gc WHERE gc.customer_group_id = o.customer_group_id) AS group_customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND `gc`.`language_id` = `os`.`language_id` AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";]]></add>
This will match the customer group description language with the order status language table.

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 mgarg » Tue Dec 08, 2015 7:22 pm

I wanted to create two columns - "Shipping_address_2" and "comment" in this view. I made all the changes to the four files and uploaded the changed files to the server. However there was no change visible in the order list. Is there anything else that one needs to do for the changes to become active

Newbie

Posts

Joined
Tue Dec 08, 2015 7:19 pm

Post by mgarg » Wed Dec 09, 2015 3:58 pm

Hi
I am using V2.1.0.1. Would this work for this version. I have made all the suggested changes and uploaded the changed files (did not use vqMod). However there is no change in the order list.

I am adding two columns: Shipping_address_2 and Comment.

Newbie

Posts

Joined
Tue Dec 08, 2015 7:19 pm
Who is online

Users browsing this forum: No registered users and 22 guests