Price displayed based on proximity

By Dave - December 12, 2013

Hi Dan, 

Yes, using the "sample_search.php" example code referred to as "Proximity search with results sorted by distance" you could just do this:

<?php 
  if     (!$record['_distance'])     { print "Unknown, can't calculate distance!"; } 
  elseif ($record['_distance'] > 50) { print $record['price1']; }
  elseif ($record['_distance'] > 25) { print $record['price2']; }
  else                               { print $record['price3']; }
?>

Let me know if that will work for you.

Dave Edis - Senior Developer
interactivetools.com

Thanks Dave.  Where would I enter the default zip as point A and the user zip as point B. I submitted this also through the hire us portion incase it requires development costs.  Haven't heard back yet.

Dan Perez

By Dave - December 12, 2013

Hi Dan, 

Basically it would be exactly the same as a proximity search but instead of having the user enter a zipcode you'd use their lng/lat coordinates from their user profile, and you'd need those for all the products too.  There's probably a few steps involved.  If you've got a proximity form setup already, and are automatically geocoding users addresses, and users are logged in, and products are all geocoded already, it shouldn't take too much more.

If you've already sent a ticket in (with FTP/CMS details?) I'll ask Ross to take a look and follow up either directly or through this post.

Talk soon, cheers!

Dave Edis - Senior Developer
interactivetools.com

By ross - December 13, 2013

Hi Dan

Just a quick heads up to let you know I got your email and replied to it yesterday. We can continue the discussion through email. If you don't see my reply though, could you let me know here?

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/