Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Customers list improved


SteveDallas

Recommended Posts

This contribution has been around for a long time but never had its own support topic. I have just uploaded version 1.5.2 with the following changes:

 

Rebuilt tables for correct structure

Many changes for HTML DTD conformance

Date of birth column in list is now displayed only if store configuration uses it

Regrouped contents of edit page for consistency

Company name (if used) is now part of the Address group

Address selector moved inside Address box

Icons for support of other contributions are only displayed if those modules are installed

- Admin Create Account #5388

- Manual Order Maker #4829

- Admin Change Customer Passwords #4469

Added 'Sort by newsletter subscription status' from v1.4.3

Functions tep_address_label() and tep_get_address_format_id do not exist in admin/includes/functions/general.php

so they are conditionally included in this version. (They are from the shop's version of general.php)

Fixed several typographical errors in the English language file

Added French language file (copied from earlier version with my feeble attempts to fill in the missing values.

Corrections are welcomed.)

 

http://addons.oscommerce.com/info/3463

Link to comment
Share on other sites

Glen, many thanks for this improved UI! The same changes could be made to the orders page and probably others in the admin UI.

I have one problem- When I click on a column title it does not react- I still have the last name descending sorting only.

I checked and my copy of general has a (different) copy of the function tep_get_address_format_id but not the tep_address_label function.

Apart from that I can't see any reason why the code shouldn't work. Any ideas?

Link to comment
Share on other sites

Glen, many thanks for this improved UI! The same changes could be made to the orders page and probably others in the admin UI.

I have one problem- When I click on a column title it does not react- I still have the last name descending sorting only.

I checked and my copy of general has a (different) copy of the function tep_get_address_format_id but not the tep_address_label function.

Apart from that I can't see any reason why the code shouldn't work. Any ideas?

 

Steve,

I can't take credit for the UI; that was created by others. I had an older version installed for several years and just recently came back to install the latest version. I worked out some of the bugs and added a support thread so that there is a place to ask and answer questions.

 

I just tested my installation; sorting works on all columns except Phone Number. However, sorting doesn't work with register_globals set to off. I will resolve this issue and post an update this evening. Thanks for pointing this out.

 

--Glen

Link to comment
Share on other sites

Glen, many thanks- It works for me now.

The obvious missing feature (IMO) is a country field. I could use a filter on this (ie drop down menu to select a country and only customers in that country would be listed) but being able to sort alphabetically by country is near enough. I am not a PHP coder really (Java is my cup) but if pushed I would have a go. Is it something you were thinking of? Actually sorting by preferred language would be useful but this is only in a cookie on the clients machine I think?

Link to comment
Share on other sites

Glen, many thanks- It works for me now.

The obvious missing feature (IMO) is a country field. I could use a filter on this (ie drop down menu to select a country and only customers in that country would be listed) but being able to sort alphabetically by country is near enough. I am not a PHP coder really (Java is my cup) but if pushed I would have a go. Is it something you were thinking of? Actually sorting by preferred language would be useful but this is only in a cookie on the clients machine I think?

 

The two letter ISO 3166 country code is already displayed in the State/Province field. Sorting this field sorts first by country, then by state or province, then by city.

 

It isn't exactly what you asked for, but it's close. It shouldn't be too difficult to display the country name instead of the two letter code, but it would make the column much wider.

Link to comment
Share on other sites

Glen, you are right of course- Its just me being fussy!

That said, the perfect solution would have a drop down option for each field to filter customers but thats a fair bit more work.

I have spotted the module entitled Orders List improved so hopefully similar improvements will be available there.

These modules deserve to make V3: Can't wait!

Link to comment
Share on other sites

Glen, you are right of course- Its just me being fussy!

That said, the perfect solution would have a drop down option for each field to filter customers but thats a fair bit more work.

I have spotted the module entitled Orders List improved so hopefully similar improvements will be available there.

These modules deserve to make V3: Can't wait!

 

You're right; extensive filters would be nice to have, but would take a lot of work to implement. I think that designing a good UI is the hard part; the implementation should be fairly trivial, as it is just mapping the selections to an SQL query.

 

I have also seen Orders List improved, and have flagged it for possible inclusion into my site, but I have several mods to my orders.php already, so will have to integrate.

 

[soapbox_mode]

As to V3, I don't know that the development team does much mining of the contribution library in coming up with features. I know that the RC2a PayPal Express Checkout ignores the work of others and offers a solution that doesn't work for hosts that require cURL proxy (notably, GoDaddy), or those who use API certificates rather than API signatures. It's probably an 80% solution. I added both features for a client in a few hours of work.

[/soapbox_mode]

 

--Glen

Link to comment
Share on other sites

Hey Guys, Ive just installed this contrib on my test server and all is ok except this.

If you sort by State/Province and then click the edit icon in the left, you get this error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in admin/includes/classes/object_info.php on line 15

Warning: Variable passed to each() is not an array or object in admin/includes/classes/object_info.php on line 16

 

Any thoughts on this?

 

Cheers

Peter

Link to comment
Share on other sites

Hey Guys, Ive just installed this contrib on my test server and all is ok except this.

If you sort by State/Province and then click the edit icon in the left, you get this error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in admin/includes/classes/object_info.php on line 15

Warning: Variable passed to each() is not an array or object in admin/includes/classes/object_info.php on line 16

 

Any thoughts on this?

 

Cheers

Peter

 

I cannot duplicate this here. What version of osCommerce are you using? What PHP version? HTTP server? (usually Apache, but could be IIS if hosting on Windows.)

 

--Glen

Link to comment
Share on other sites

  • 3 weeks later...

add referer column to Customer Admin page, change table # to table text

 

want to show Referred By.

Well, I'm 90% there in showing it...

However, I'm running into a problem trying to get the referred by as the text name. Somehow it is pulling up the table ID it has instead.

 

Any ideas on how to fix?

 

Picture of what it currently looks like.

customers.png

 

 

 

------------------

Code to where refer was added...

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country, c.customers_newsletter, ci.customers_info_source_id as entry_referral, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join " . TABLE_CUSTOMERS_INFO . " ci on c.customers_id = ci.customers_info_id left join " . TABLE_COUNTRIES . " ctry on a.entry_country_id = ctry.countries_id left join " . TABLE_ZONES . " z on a.entry_zone_id = z.zone_id " . $search . " order by " . $db_orderby . " " . $sort;

 

 

<td class="dataTableContent" align="center"><?php echo htmlspecialchars($customers['entry_referral']);

 

// old referral start code that I had in my old customer.php

// $source_query = tep_db_query("select customers_info_source_id from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");

// $source = tep_db_fetch_array($source_query);

// $entry_referral = tep_get_sources_name($source['customers_info_source_id'], $customers['customers_id']);

// old referral end

?></td>

 

http://addons.oscommerce.com/info/3463

Link to comment
Share on other sites

add referer column to Customer Admin page, change table # to table text

 

want to show Referred By.

Well, I'm 90% there in showing it...

However, I'm running into a problem trying to get the referred by as the text name. Somehow it is pulling up the table ID it has instead.

 

Any ideas on how to fix?

 

Picture of what it currently looks like.

customers.png

 

 

 

------------------

Code to where refer was added...

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country, c.customers_newsletter, ci.customers_info_source_id as entry_referral, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join " . TABLE_CUSTOMERS_INFO . " ci on c.customers_id = ci.customers_info_id left join " . TABLE_COUNTRIES . " ctry on a.entry_country_id = ctry.countries_id left join " . TABLE_ZONES . " z on a.entry_zone_id = z.zone_id " . $search . " order by " . $db_orderby . " " . $sort;

 

 

<td class="dataTableContent" align="center"><?php echo htmlspecialchars($customers['entry_referral']);

 

// old referral start code that I had in my old customer.php

// $source_query = tep_db_query("select customers_info_source_id from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");

// $source = tep_db_fetch_array($source_query);

// $entry_referral = tep_get_sources_name($source['customers_info_source_id'], $customers['customers_id']);

// old referral end

?></td>

 

http://addons.oscommerce.com/info/3463

 

The variable entry_referral is just the ID number of the source. To get the source's name, you need something like this:

<?php
if ($entry_referral != 0) {
 $source_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $entry_referral);
 $source = tep_db_fetch_array($source_query);
 $referrer_name = $source['customers_firstname'] . " " . $source['customers_lastname'];
?>
<td class="dataTableContent" align="center"><?php echo htmlspecialchars($referrer_name); ?></td>
<?php
} else {
?>
<td class="dataTableContent" align="center"> </td>
<?php
}
?>

 

Note that I have not tested this code, but it should do what you want. Your original query is fine; you just need this second one to grab the referrer's name based on his ID. This example leaves the column blank if there is no referrer. You could change it to display "None" instead.

 

--Glen

Link to comment
Share on other sites

Note that I have not tested this code, but it should do what you want. Your original query is fine; you just need this second one to grab the referrer's name based on his ID. This example leaves the column blank if there is no referrer. You could change it to display "None" instead.

--Glen

 

I spent few hours trying many different ways, rewording, moving code to different places, etc... nothing seems to works. I just keep getting the ID field numbers. I'm no programmer... but I am persistant in trying new ways... and I must say, I just can't get t it to work. Worse case scenario, i just remember which number corresponds to the referrer. Any other ideas... please let me know.

 

Cheers & Thx, Todd - Sky Lanterns

Link to comment
Share on other sites

  • 3 months later...

Ok... I know this is going to be a stupid question:

In the instructions it states:

"run the .sql file for your languages"

I can see the files: customer list improved english.sql

 

Ok... so where do I upload these to and how do I execute it?

 

Thanks

J-P

Link to comment
Share on other sites

Ok... I know this is going to be a stupid question:

In the instructions it states:

"run the .sql file for your languages"

I can see the files: customer list improved english.sql

 

Ok... so where do I upload these to and how do I execute it?

 

Thanks

J-P

 

I got it.. with a little direction for my host.

Went to the phpMyAdmin section:

**didn't know that OsCommerce database was named: osc1 found that

Went to the SQL tab and cut and past the .sql file out from note pad.

Clicked the GO button and everything seemed to turn out.

 

Now just got to test out the app :)

Link to comment
Share on other sites

I spent few hours trying many different ways, rewording, moving code to different places, etc... nothing seems to works. I just keep getting the ID field numbers. I'm no programmer... but I am persistant in trying new ways... and I must say, I just can't get t it to work. Worse case scenario, i just remember which number corresponds to the referrer. Any other ideas... please let me know.

 

Cheers & Thx, Todd - Sky Lanterns

 

Steve's code is almost right i think, just missing a tiny piece.

 

Replace

<td class="dataTableContent" align="center"><?php echo htmlspecialchars($customers['entry_referral']);

With

<?php
if ($entry_referral != 0) {
 $source_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $customers['entry_referral']);
 $source = tep_db_fetch_array($source_query);
 $referrer_name = $source['customers_firstname'] . " " . $source['customers_lastname'];
?>
<td class="dataTableContent" align="center"><?php echo htmlspecialchars($referrer_name); ?></td>
<?php
} else {
?>
<td class="dataTableContent" align="center"> </td>
<?php
}
?>

Link to comment
Share on other sites

  • 1 month later...

Many of my customers only give me a company name for their account (multiple people ordering, same company). Is there a way to get the Company Name to show up in the customer list instead of say, the two dates columns?

 

Thanks in advance!

Link to comment
Share on other sites

  • 3 weeks later...

Hi i need to add the customers IP in this list , any one know how or can you post this ? i dont really need date of birth so if someone could post how i can changed it or add it that would be great thanks

Link to comment
Share on other sites

  • 2 months later...

I have been using this contribution for a long time without a hitch.

 

today however I am not sure what I changed but the sorting of the columns no longer works. It stays stuck on Last name Descending no matter which column title I click.

 

The url does change to reflect the click. however nothing changes. Any ideas on what I may have done to cause this??

Link to comment
Share on other sites

  • 3 months later...

today however I am not sure what I changed but the sorting of the columns no longer works. It stays stuck on Last name Descending no matter which column title I click.

 

The url does change to reflect the click. however nothing changes. Any ideas on what I may have done to cause this??

The same question. More over, the exactly same file correctly works under denwer, but not works on real server.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Used this contrib for a long time. Nice contrib. But I'm using the "Group Discount" contrib as well, and I don't know how to and ekstra this field.

Another ting. When using the seach box it seach and find e-mail adresses, but not telephonenumbers?? Anyone could tell me what could be the reason?

Then original customers.php would work on all type of seach inputs both works and number across all fields in the custemer database.

Could anyone help?

 

Regards

Lars

Edited by dinmc
Link to comment
Share on other sites

  • 5 years later...
  • 1 month later...

I don't - but may be i should, as i don't like the current list ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@deansmar

i had a quick look, i don't see any particular issue in using it in an 2.3.4 admin environment.

why don't you try it ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...