Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Vendor Locator Displayed by Distance


hobbzilla

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.

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

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 ;)

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
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.

Link to comment
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?

Link to comment
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

Link to comment
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

Link to comment
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... :)

Link to comment
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

Link to comment
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.

Link to comment
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());

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