Zen Cart Logo
Forums / General Questions / Is this possible? Search products by distance from a postcode

Is this possible? Search products by distance from a postcode

Locked

Views: 938

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
31 Jan 2010, 11:36 PM
#1
omerhanif avatar

omerhanif

Zen Follower

Join Date:
Aug 2009
Location:
London
Posts:
106
Plugin Contributions:
0

Is this possible? Search products by distance from a postcode

Hi

I need some guidance, how can i do following with help of zencart? or if it is possible at all in zencart?

Let say project in question is selling cars, can i have option of

  1. Seller creating there acounts, adding images of car they are selling and descriptionand option to edit add and advert expires after certain days

  2. Customer searching for cars can search through postcode distance/price range/ key word or manufacturer etc

example is similar features like autotrader, though i am not planning to build site for cars but just to give example.

Or if this is not possible with zencart, can some one suggest any other platform please?

Regards

31 Jan 2010, 11:47 PM
#2
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Is this possible? Search products by distance from a postcode

Put on your programming hat and grab one of the free zipcode databases that includes lat-lon data and then use something like:

function getDistance($latitude1, $longitude1, $latitude2, $longitude2, $unit = 'Mi') {
    $theta = $longitude1 - $longitude2;
    $distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) +
    (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) *
    cos(deg2rad($theta)));
    $distance = acos($distance);
    $distance = rad2deg($distance);
    $distance = $distance * 60 * 1.1515;
    switch($unit)
        {
        case 'Mi': break;
        case 'Km' : $distance = $distance * 1.609344;
        }
    return (round($distance,2));

to calculate the distance between two geodetic points.

2 Feb 2010, 3:32 PM
#3
omerhanif avatar

omerhanif

Zen Follower

Join Date:
Aug 2009
Location:
London
Posts:
106
Plugin Contributions:
0

Re: Is this possible? Search products by distance from a postcode

Thanks for guidance , can some one help me iwth point please?
"1) Seller creating there accounts, adding images of car they are selling and description and option to edit add and advert expires after certain days"

Regards

2 Feb 2010, 4:06 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: Is this possible? Search products by distance from a postcode

What you are describing is a "classified ads" program, not a shopping cart.

2 Feb 2010, 5:37 PM
#5
omerhanif avatar

omerhanif

Zen Follower

Join Date:
Aug 2009
Location:
London
Posts:
106
Plugin Contributions:
0

Re: Is this possible? Search products by distance from a postcode

perhaps your are right Kim, can suggest any platform i can use to build such project or any starting point to develop skills in this area?

Regards

2 Feb 2010, 6:04 PM
#6
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: Is this possible? Search products by distance from a postcode

I do not have any direct experience with a classifieds program, I would suggest a Google search search.