Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1054 - Unknown column 'cg.customers_group_name' in 'field list' Seperate Pricing w/ Access with level account


Relative0

Recommended Posts

Posted

Hello,

 

Here is the problem that I am having….. I installed “Separate Pricing Per Customer 4.2.0” and am trying to get it to work with “Access with Level Account (v. 2.2a) for the Administration Area of osCommerce (MS2)” While I can get the “Separate Pricing module to work (at least to some extent as there seems to be interference from the “Access with Level Account” module), I get the error when pressing the “Customers” link while in the Admin panel. Here is the error that I get:

 

1054 - Unknown column 'cg.customers_group_name' in 'field list'

 

select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join products_groups cg on c.customers_group_id = cg.customers_group_id order by c.customers_id DESC limit 0, 20

 

 

This “cg.customers_group_name” error seems to come up also the link “Catalog ->Product Attributes”. I looked at the database and there is a table for customers as well as customer_groups. Also this “customer_groups” the field ‘customes_group_name’. Here are the field parameters:

 

SELECT COUNT( * ) AS `Rows` , `customers_group_name`

FROM `customers_groups`

GROUP BY `customers_group_name`

ORDER BY `customers_group_name`

LIMIT 0 , 30

 

 

I don’t know if 'field list' is supposed to be a table or some error message. I wonder though that there might be an error due to the needing to edit the “Access with Level Account” module but there being edits already done to the exact same lines already done with the “Separate Pricing Per Customer” module. I also don’t know what “cg” is, (in cg.customers). Here is the customers.php file in catalog/admin/includes/boxes/customers.php (where the tentative problem lies):

 

 

// BOF Separate Pricing Per Customer

if ($selected_box == 'customers') {

 

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a><br>' .

'<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');

// EOF Separate Pricing Per Customer

}

 

 

 

 

Then I am told to do the following edit in the “Access with Level Account” module, also in the

catalog/admin/includes/boxes/customers.php file

 

 

 

FIND on or about line 24

 

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a>');

 

REPLACE WITH

 

// BOE Access with Level Account (v. 2.2a) for the Admin Area of osCommerce (MS2) 1 of 1

// reverse comments to below lines to disable

// $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .

// '<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a>');

$contents[] = array('text' => tep_admin_files_boxes(FILENAME_CUSTOMERS, BOX_CUSTOMERS_CUSTOMERS) .

tep_admin_files_boxes(FILENAME_ORDERS, BOX_CUSTOMERS_ORDERS));

// EOE Access with Level Account (v. 2.2a) for the Admin Area of osCommerce (MS2) 1 of 1

 

 

 

 

 

Notice how the “Access with Level Account” it tells me to replace the code ending in “BOX_CUSTOMERS_ORDERS . '</a>');” However in the “Separate Pricing per Customer”, it does not end at “BOX_CUSTOMERS_ORDERS . '</a>');” but it continues on with a whole:

 

'<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');

 

 

 

This came from not editing the “customers.php” from scratch. So I wonder if my error has to do with this different left over piece, but I don’t think I can just delete it, (the link would be gone for one thing). I don’t even know if my error “1054 - Unknown column 'cg.customers_group_name' in 'field list' is due to this.

 

 

Any ideas,?

 

Thanks,

 

Brian

Posted
This “cg.customers_group_name” error seems to come up also the link “Catalog ->Product Attributes”.

Well, that is not a miracle if you add the define for the TABLE_CUSTOMERS_GROUPS in the admin/includes/database_tables.php as products_groups instead of customers_groups.

The instructions tells you to add this:

// BOF Separate Pricing Per Customer
 define('TABLE_PRODUCTS_GROUPS', 'products_groups');
 define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
 define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');
 define('TABLE_PRODUCTS_ATTRIBUTES_GROUPS', 'products_attributes_groups');
// EOF Separate Pricing Per Customer

 

Probably best to add this code to the Access with Level Account code instead:

 

'<a href="' . tep_href_link('customers_groups.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_GROUPS . '</a>');

Posted

1054 - Unknown column 'cg.customers_group_name' in 'field list'

 

select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join products_groups cg on c.customers_group_id = cg.customers_group_id order by c.customers_id DESC limit 0, 20

 

 

first chek Your Mysql version.

if its 5 or above then it might be that You need to change Your sql query.

As there is some change related to "join" in mysql5.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Posted
Probably best to add this code to the Access with Level Account code instead:

 

Thanks for the help, I am trying to update the catalog/admin/includes/database_tables.php right now. I am however confused about what you said about adding the code to the Access with Level Account code instead. Could you clarify a little?

 

Thanks very much.

 

Brian

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...