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
|
|
@ -2225,11 +2225,34 @@ class APIController extends Controller implements LoggedController
|
||||||
if ($res->isError())
|
if ($res->isError())
|
||||||
return $res->getReturnResponse();
|
return $res->getReturnResponse();
|
||||||
|
|
||||||
$long = $req->query->get('longitude');
|
$long = $req->query->get('longitude');
|
||||||
$lat = $req->query->get('latitude');
|
$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
|
// geofence
|
||||||
$is_covered = $geo->isCovered($long, $lat);
|
// $is_covered = $geo->isCovered($long, $lat);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'longitude' => $long,
|
'longitude' => $long,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue