Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi,

 

I can't find, so I'll ask for help please.....

 

Is there a contrib that I can use to search the customers details for;

surname,

postcode (zip code)

various address lines

email address

telephone number

 

If you know of anything to o the above, please let me know.

 

Thanks in advance for any help and guidence :)

____________________________________________________________________

____________________________________________________________________

Posted

In customers.php under your admin directory, around line 766...

 

Search for this code:

	$search = '';
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {

 

Now replace the line under it where the variable $search:

  
$search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords  . "%' or c.customers_telephone like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
}

 

That will add the ability to search through telephone numbers and e-mail. I was thinking of working on having it search the addressbook for zip, company name, etc. but have not had the time. I am acuatlly planning on doing that next week then also showing that also in the list.

Posted

This looks good :) I'll give it a try this evening.

 

Thanks for your reply :D

 

Steve

____________________________________________________________________

____________________________________________________________________

Posted
This looks good :) I'll give it a try this evening.

 

Thanks for your reply :D

 

Steve

 

No prob, when I add the feature to search through the addressbook table, ill package it up into a contrib and post a link here for ya.

-Jon

Posted

My line starting at 714 and 715 matches the line you say to search for, however my lines 716 is more or less the same as the code you say to insert.

LINE 713<?php
LINE 714	$search = '';
LINE 715	if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
LINE 716	  $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
LINE 717	  $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
LINE 718	}

 

I've just checked my code above with a clean install of osc and they're the same. Have I gone wrong, or should I be looking for extra buttons to carry out a search?

 

If your busy, I can sit back and wait for the full tested version if that helps you out?

 

Thanks

 

Steve

____________________________________________________________________

____________________________________________________________________

Posted (edited)

Well on line 717 is where I added the

"%' or c.customers_telephone like '%"

so it searches also for the phone numbers. I did this a mod a while back and forgot the e-mail came stock in there already, so you can add the phone line in there to get that to work.

 

As far as the address zip code and all that, that would be more code to add which I have not created yet. So go ahead and the telephone number line in there and that should do it for ya.

 

Ofcoarse my line is different (I did not show that) because I also added username support search for, as the site that uses this has the username contrib installed.

Edited by central50

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...