Add checking for promo tag for locationSupport. #613
This commit is contained in:
parent
13ee4c8e51
commit
13e28d8c47
1 changed files with 26 additions and 3 deletions
|
|
@ -2228,8 +2228,31 @@ class APIController extends Controller implements LoggedController
|
|||
$long = $req->query->get('longitude');
|
||||
$lat = $req->query->get('latitude');
|
||||
|
||||
// NOTE: had to add this for promo tag
|
||||
$cust = $this->session->getCustomer();
|
||||
if ($cust == null)
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('No customer information found');
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
|
||||
$is_covered = false;
|
||||
// check if customer still has promo
|
||||
if (($cust->getCustomerTag('TAG_CAR_CLUB_OFFICER_PROMO')) ||
|
||||
($cust->getCustomerTag('TAG_CAR_CLUB_MEMBER_PROMO')))
|
||||
{
|
||||
// if has customer tag, customer has not availed of promo
|
||||
$is_covered = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// geofence
|
||||
$is_covered = $geo->isCovered($long, $lat);
|
||||
}
|
||||
|
||||
// geofence
|
||||
// $is_covered = $geo->isCovered($long, $lat);
|
||||
|
||||
$data = [
|
||||
'longitude' => $long,
|
||||
|
|
|
|||
Loading…
Reference in a new issue