Magento 2 – report.CRITICAL: Notice: Undefined index

appcodeZeroStorelocatorRewriteAmastyStorelocatorLocation.php

public function getFrontendData(): array { $storeHours = $this->getDataByKey('attributes'); $result = [ 'id' => (int)$this->getDataByKey('id'), 'lat' => $this->getDataByKey('lat'), 'lng' => $this->getDataByKey('lng'), 'zip' => $this->getDataByKey('zip'), 'address'=>$this->getDataByKey('address'), 'state'=>$this->_storelocHelper->getRegionDataByName($this->getDataByKey('state')), 'popup_html' => $this->getDataByKey('popup_html'), 'phone'=>$this->getDataByKey('phone'), 'distance'=>round($this->getDataByKey('distance'),1), 'name' =>$this->getDataByKey('name'), 'city' =>$this->getDataByKey('city'), 'url_key' =>$this->getDataByKey('url_key') 'store_hours_weekdays' => $storeHours['store_hours'] ['option_title']['0'], 'store_hours_weekend_days' => $storeHours['store_hours'] ['option_title']['1'] ]; if ($this->getDataByKey('marker_url')) { $result['marker_url'] = $this->getDataByKey('marker_url'); } return $result; } 

How to solve the report.CRITICAL: Notice: Undefined index: store_hours in /app/app/code/Zero/Storelocator/Rewrite/Amasty/Storelocator/Location.php

submitted by /u/aveeva7
[link] [comments]