Add check for battery. #624

This commit is contained in:
Korina Cordero 2021-09-29 06:44:04 +00:00
parent 1db04374ec
commit 21cf667b47

View file

@ -2897,10 +2897,14 @@ class APIController extends Controller implements LoggedController
} }
} }
// add battery to items // check if batt is null
$sku = $batt->getSAPCode(); if ($batt != null)
if (!empty($sku)) {
$hub_criteria->addItem($batt->getSAPCode(), 1); // add battery to items
$sku = $batt->getSAPCode();
if (!empty($sku))
$hub_criteria->addItem($batt->getSAPCode(), 1);
}
// get customer id. No JO id at this point // get customer id. No JO id at this point
$customer_id = $cust->getID(); $customer_id = $cust->getID();