CS Cart v.4.3.4 -
Looking to add new column to profile customer table and as hook instructions in the
/design/backend/templates/views/profiles/manage.tpl at line code 33/67, but common field 'company' is unable to sort by company.
CS Cart v.4.3.4 -
Looking to add new column to profile customer table and as hook instructions in the
/design/backend/templates/views/profiles/manage.tpl at line code 33/67, but common field 'company' is unable to sort by company.
CS Cart v.4.3.4 -
Looking to add new column to profile customer table and as hook instructions in the
/design/backend/templates/views/profiles/manage.tpl at line code 33/67, but common field 'company' is unable to sort by company.
We used debug mode and found that the query changes the ORDER BY to company_name instead of company. This variable is really the store company name. It should be ordering by the cscart_users.company field. Any idea which script maps the URL parameters to the actual SQL query?
SELECT cscart_users.user_id, cscart_users.user_login, cscart_users.is_root, cscart_users.timestamp, cscart_users.user_type, cscart_users.status, cscart_users.firstname, cscart_users.lastname, cscart_users.email, cscart_users.company, cscart_users.company_id, cscart_companies.company as company_name FROM cscart_users LEFT JOIN cscart_user_profiles ON cscart_user_profiles.user_id = cscart_users.user_id LEFT JOIN cscart_companies ON cscart_companies.company_id = cscart_users.company_id WHERE 1 AND cscart_users.user_type = 'C' GROUP BY cscart_users.user_id ORDER BY company_name asc LIMIT 0, 110
We used debug mode and found that the query changes the ORDER BY to company_name instead of company. This variable is really the store company name. It should be ordering by the cscart_users.company field. Any idea which script maps the URL parameters to the actual SQL query?
SELECT cscart_users.user_id, cscart_users.user_login, cscart_users.is_root, cscart_users.timestamp, cscart_users.user_type, cscart_users.status, cscart_users.firstname, cscart_users.lastname, cscart_users.email, cscart_users.company, cscart_users.company_id, cscart_companies.company as company_name FROM cscart_users LEFT JOIN cscart_user_profiles ON cscart_user_profiles.user_id = cscart_users.user_id LEFT JOIN cscart_companies ON cscart_companies.company_id = cscart_users.company_id WHERE 1 AND cscart_users.user_type = 'C' GROUP BY cscart_users.user_id ORDER BY company_name asc LIMIT 0, 110
No, this causes is to sort on the STORE company name when it should be the CUSTOMER company name.
If we compare it to a sort on Name or sort on email the ORDER BY is cscart_users.lastname, cscart_users.firstname and cscart_users.email which are correct. What we expect is for the query to be ORDER BY cscart_users.company. What we are getting is ORDER BY company_name.
In the first part of the query it selects cscart_users.company, but there are multiple JOINS and I wonder if they are messing with the query.
SELECT cscart_users.user_id, cscart_users.user_login, cscart_users.is_root, cscart_users.timestamp, cscart_users.user_type, cscart_users.status, cscart_users.firstname, cscart_users.lastname, cscart_users.email, cscart_users.company, cscart_users.company_id, cscart_companies.company as company_name FROM cscart_users LEFT JOIN cscart_user_profiles ON cscart_user_profiles.user_id = cscart_users.user_id LEFT JOIN cscart_companies ON cscart_companies.company_id = cscart_users.company_id WHERE 1 AND cscart_users.user_type = 'C' GROUP BY cscart_users.user_id ORDER BY cscart_users.lastname asc, cscart_users.firstname asc LIMIT 0, 10
SELECT cscart_users.user_id, cscart_users.user_login, cscart_users.is_root, cscart_users.timestamp, cscart_users.user_type, cscart_users.status, cscart_users.firstname, cscart_users.lastname, cscart_users.email, cscart_users.company, cscart_users.company_id, cscart_companies.company as company_name FROM cscart_users LEFT JOIN cscart_user_profiles ON cscart_user_profiles.user_id = cscart_users.user_id LEFT JOIN cscart_companies ON cscart_companies.company_id = cscart_users.company_id WHERE 1 AND cscart_users.user_type = 'C' GROUP BY cscart_users.user_id ORDER BY cscart_users.email asc LIMIT 0, 10
Sorry for jumping on this thread, but it is the closest one I could find for what I need.
I added a custom profile field and I would like it to show up on the Customers view list and also be able to sort by it on this page. I have not tried using hooks and the my_changes add-on yet, but I have tried directly editing the /design/backend/templates/views/profiles/manage.tpl file. Nothing changes when I edit this file, even after I clear the cache in CS-cart and my server. This is the file that controls the Customers view correct?
Thank you in advance for any help you can provide.
Sorry for jumping on this thread, but it is the closest one I could find for what I need.
I added a custom profile field and I would like it to show up on the Customers view list and also be able to sort by it on this page. I have not tried using hooks and the my_changes add-on yet, but I have tried directly editing the /design/backend/templates/views/profiles/manage.tpl file. Nothing changes when I edit this file, even after I clear the cache in CS-cart and my server. This is the file that controls the Customers view correct?
Thank you in advance for any help you can provide.
Hello!
The file is correct. What did you change there? Do you have any add-ons related to users?