Jump to content
Sign in to follow this  
hobbzilla

Vendor Locator Displayed by Distance

Recommended Posts

This topic has been created to support my osCommerce Vendor Locator add-on. Please post your questions & suggestions.

 

Description:

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

Does your business rely on sales channel affiliates or have various

retail locations that you would like your customer to be able to search

for or be tied to?

 

These modifications allow you to create and maintain a list of vendors

in the admin section and present them to your customer. Vendors are

presented to the customer by distance (in miles) using a latitude &

longitude algorithm based upon the customers_default_address_id

entry_postcode in the address_book table and limited by a maximum

distance and/or maximum number of vendors.

 

CURRENTLY U.S.A. ZIPCODES ONLY

 

There are options in the admin side to control if a customer can

checkout based if they have a vendor account tied to their customer

account or not. Whereas if this setting is disabled the customer will be

in a continual loop until they select a vendor while attempting to

checkout.

Share this post


Link to post
Share on other sites

Curious if anyone will try out this mod and give me any feedback or suggestions or bug reports.

 

Thanks!

Share this post


Link to post
Share on other sites

Zilla-

Excellent idea. I have party consultants and I wanted a locator. I am having a problem. I loaded my database with all gazillion zipcode files,lol. I also added myself as a vendor. Then I go to the store and enter my zipcode and I get a database error.

 

***************

1146 - Table 'melissa_newlyn.zipdata' doesn't exist

 

select * from zipdata where zipcode='98503'

 

[TEP STOP]

*****************************

 

The only thing i can possibly think of is, since I am not a bis SQL person, is that it is case sensitive and my database is labeled melissa_newlyn.zipData and not **.zipdata . Do you know if this is the problem? I know the zipcode is in the database, I checked. I am going to try and rename it I think if it is possible and see if it works. If not then I'll beg you for the possible solution.

 

Thanks alot for this contrib though!!

 

Melissa ;)

Share this post


Link to post
Share on other sites

Problem Solved. It is the database file name. So maybe this is a little bug to fix. In the SQL file used to dump the data it is creating a table named zipData. BUT in the database_tables.php in the catalog/includes side it is named zipdata. It is like this in the admin side too. I changed it even though I hadnt gotten any errors in the admin side as of yet. So wither the SQL file needs to be changed to create a table named zipdata instead od zipData or the database_tables.php needs to be changed. HTH

 

Melissa

Share this post


Link to post
Share on other sites

Ok heres a question for you. In the install directions it makes it seem as if theres a configuration section in the admin which would allow me to make it so people can checkout without being asked about a local vendor or making it so they are forced to choose a vendor. I am not finding this.The only thing I find in the admin is the 'add a vendor' page. So if there is another section ,can you tell me where that is. Also since it appears as if this is what is supposed to happen I'll say that right now the only thing i can do with this (as a customer) is check for a vendor in my area. NOthing is happening in the create an account section, and when i check out as a customer with an account it makes no mention of vendors.I am hoping this is just because i have something 'turned off' in this msytery admin section.

 

Thanks!!

 

Am I getting on your nerves yet?

 

Melissa

Share this post


Link to post
Share on other sites

OK. so that works good. I have one suggestion and thats just my 2 cents. I will change it for my store but maybe others wouldn't want it. If you are a customer who hasnt chosen a vendor and you go to buy something, you are brought to a page asking for you to select a vendor. Once you choose one you are taken to the account.php when I think you should be taken to the checkout_shipping.php. When they go to the account page they may get confused and not know what to do next. They are expectig to finish checking out. Just my experience not everyone is as smart as the next. I hope this is making sense. This is for customers who already have an account and are now checking out for the first time since i installed this mod.

 

Also is there a place where either the admin or the customer can see who their vendor is? If not its a suggestion for future versions. There should be an admin screen with what customers are attached to what vendor and also on the account page they should be able to see their vendor and be able to change it. I am willing to help to the best of my abiliites to make these suggestions come to life :D

 

Melissa

Share this post


Link to post
Share on other sites

i found where the customer can view & change their consultant. I hadnt uploaded the new version of my account.php.DUH! I am looking for an admin feature to query the consultants and what customers have chosen them to be theirs .So I have either not found it or it doesnt exist. If it doesn't that would be awesome. It would help generate leads to send to the consultants.

 

Thanks!

 

Melissa

Share this post


Link to post
Share on other sites

Melissa,

 

Sorry I have been out of town for a few days.

 

Thanks for the feedback and bug report. Perhaps it is just because my test platform is win32 system, but mine works fine no matter what the table is declared as.. but I have updated the database_tables.php in both admin & catalog (thanks!)

 

In the install readme, there was a blurb about where to find those admin functions for checkout.

 

I totaly agree with you on the functionality. I will work on the "next_page" functionality so if they are sent from checkout to select their vendor, it will go back to checkout, if from account back to account, if from account create ... to create account success. Watch for it in a future release.

Share this post


Link to post
Share on other sites

No problem.This works great and I have another suggestion. I think it can be done. I think that there should be the following abilities.

 

1- Admin can see what customer has chosen what vendor. Perhaps an additional field on the vendors 'edit' page where it says the following cutomers have chosen vendor A. etc

 

2- when a vendor is chosen and email goes to that vendor so they can contact the customers. Sort of a lead generator without the requirement of admin intervention.

 

I use this as a consultant locator. If someone in a particular conultants area chooses them then that consultant would be the contact for the customer to buy from on a "live and in person" basis. Also they can host a party as we are something like Tupperware. This is why this option would work out great for me!

 

Let me know if I can help or if you think this can be worked out. I think it would make your mod in high demand!

 

Melissa

Share this post


Link to post
Share on other sites

Hi,

 

I have install the contribution in my shop, but for some reason it is not working correctly. The catalog does show the infobox and but the administration side of the shop has this problem. If I take the code it works fine, but I still get an error on the configuration.php. Please have a look at it and I hope that this is fixable... BTW, nice contribution. :)

 

Here is the problem that shows up:

 

Fatal error: Call to undefined function: tep_get_languages() in /home/lglivart/public_html/catalog/admin/index.php on line 58

 

Code that I take out to make it work or basically the code on line 58:

 

$languages = tep_get_languages();
 $languages_array = array();
 $languages_selected = DEFAULT_LANGUAGE;
 for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
   $languages_array[] = array('id' => $languages[$i]['code'],
                              'text' => $languages[$i]['name']);
   if ($languages[$i]['directory'] == $language) {
     $languages_selected = $languages[$i]['code'];
   }
 }

 

Can someone help me with that?

Share this post


Link to post
Share on other sites

David,

The vendor contrib makes no changes whatsoever to the admin index.php page. However it does make aan addition to admin/includes/functions/general.php (where tep_get_languages() is declared). Please double check your install.

Share this post


Link to post
Share on other sites

Hobbzilla,

 

I have fixed the problem with the general.php, I think there was something missing in the code. Now the problem is that I don't see the distance that the contribution says it does. Where I type in the zip code, I only get the store that I have programmed it with, but no distance. Any idea?

Share this post


Link to post
Share on other sites
Hobbzilla,

 

I have fixed the problem with the general.php, I think there was something missing in the code. Now the problem is that I don't see the distance that the contribution says it does. Where I type in the zip code, I only get the store that I have programmed it with, but no distance. Any idea?

Okay for clarification, you have populated the vendor table with some data and are entering in a zipcode (within the miles radius defined in admin) and the result set displays the available vendors... BUT there is no distance displayed under each result list?

 

I.E. you are wanting the result to look like:

 

Vendor #1

101 W. Main Street

Somewhere, ST 12345

1-800-123-123-1234

 

Distance: 12.2 miles

Share this post


Link to post
Share on other sites

I would like that exactly as a result, but for some reason it doesn't show up that way..

 

How do I define the radius in the Admin? Any idea? I have all the zipdata in the sql, and the admin only has 2 options regarding the Vendor Contribution.

 

I guess little by little it will work. :) Thanks for the support,

 

Dark

Share this post


Link to post
Share on other sites

Hi

I Like this mod a lot, could any one point me in the right direction to obtain the correct data for UK postcodes / distances?

Thanks to all who work so hard and give to this project.

regards

Ian

Share this post


Link to post
Share on other sites

Ian,

 

I am not sure that this contribution is available for UK, at the moment it is only available for US only. What you could do is search if there is a .sql that will have zipcodes for UK in the link provided by the contribution to download the file.

 

I am not sure if it is completely working since I am still having trouble showing the distance of a store.

 

A WHOOPY for the creator of this contribution... :)

Share this post


Link to post
Share on other sites
Hobzilla,

 

Okay for clarification, you have populated the vendor table with some data and are entering in a zipcode (within the miles radius defined in admin) and the result set displays the available vendors... BUT there is no distance displayed under each result list?

I.E. you are wanting the result to look like:

Vendor #1

101 W. Main Street

Somewhere, ST 12345

1-800-123-123-1234

Distance: 12.2 miles

 

I was wondering if that is possible for the distance. You refer to the radius in the admin, but I don't see anything like that. Is it possible to say were I could find that in the admin and what are the values? if any

 

Thanks

Share this post


Link to post
Share on other sites

darkangel,

I am sorry for the delay, I have been pretty busy of late. I will try and get some work done on this tomorrow. I guess I didn't include the distance being output by the program, but will look at that tomorrow and add that functionality for the next release. I will post some code that will allow for that display.

Share this post


Link to post
Share on other sites

Add this to vendor.php around line 257

 

          if (DISPLAY_VENDOR_DISTANCE == 'true') {
           $string_vendor .= '<BR>' . TEXT_DISTANCE . number_format($vendors_array[$i]['distance'], 1) . TEXT_MILES;
         }

 

And run this against the db

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Vendor Distance', 'DISPLAY_VENDOR_DISTANCE', 'true', 'Include vendor distance display in the search results', '1', '24', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now());

Share this post


Link to post
Share on other sites

Thanks you for the help Hobbzilla,

 

I understand being under a lot of work, don't stress your self... Thanks for everything... I will set this up and see if everything works...

 

Once Again Thanks...

 

:) Dark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×