Resolve "Warranty changes for sku" #1477

Open
korina.cordero wants to merge 2 commits from 562-warranty-changes-for-sku into master-fix
Showing only changes of commit 3488d5f9a9 - Show all commits

View file

@ -244,8 +244,14 @@ class CustomerWarrantyController extends APIController
$sku = $warr_serial->getSKU();
// check if sku is null
$batt = null;
$cat_name = '';
if ($sku != null)
$batt = $em->getRepository(SAPBattery::class)->find($sku);
else
{
// get the category name of the serial
$cat_name = $warr_serial->getMetaInfo('category_name');
}
// TODO: put this in a config file
$image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png';
@ -260,7 +266,7 @@ class CustomerWarrantyController extends APIController
else
{
$battery = [
'brand' => '',
'brand' => $cat_name,
'size' => '',
'image_url' => '',
];