You do it in simillar way with isset function.
For the rest of the notices I have no idea.
Here is the code from line 497 to 500
$url = str_replace('{ITEM_ID}', osc_sanitizeString($item['pk_i_id']), $url);
$url = str_replace('{ITEM_CITY}', osc_sanitizeString($item['s_city']), $url);
$url = str_replace('{ITEM_TITLE}', osc_sanitizeString(str_replace(',', '-', $item['s_title'])), $url);
$url = str_replace('?', '', $url);
So what to replace with below code (Is it correct)
(For line 497)
if( isset($item['pk_i_id'])) { $url = Category::newInstance()->hierarchy($item['pk_i_id']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
(For line 498)
if( isset($item['s_city'])) { $url = Category::newInstance()->hierarchy($item['s_city']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
(For line 499)
if( isset($item['s_title'])) { $url = Category::newInstance()->hierarchy($item['s_title']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
Complete code below
if( isset($item['pk_i_id'])) { $url = Category::newInstance()->hierarchy($item['pk_i_id']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
if( isset($item['s_city'])) { $url = Category::newInstance()->hierarchy($item['s_city']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
if( isset($item['s_title'])) { $url = Category::newInstance()->hierarchy($item['s_title']);
for ($i = (count($url)); $i > 0; $i--) {
$sanitized_categories[] = $url[$i - 1]['s_slug'];
} }
Instead of
$url = str_replace('{ITEM_ID}', osc_sanitizeString($item['pk_i_id']), $url);
$url = str_replace('{ITEM_CITY}', osc_sanitizeString($item['s_city']), $url);
$url = str_replace('{ITEM_TITLE}', osc_sanitizeString(str_replace(',', '-', $item['s_title'])), $url);
$url = str_replace('?', '', $url);
Is it correctly created? Because I tried this but its not working giving more and more warnings