警告:搜索产品时非法字符串偏移

时间:2017-10-16 19:01:31

标签: php wordpress

您好我正在使用woocomerce wordpress网站。

所以我试图在搜索栏中搜索产品,它给了我这个错误:

Warning: Illegal string offset 'LargeImage' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

Warning: Illegal string offset 'URL' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

Warning: Illegal string offset 'LargeImage' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

Warning: Illegal string offset 'URL' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

Warning: Illegal string offset 'LargeImage' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

Warning: Illegal string offset 'URL' in /home3/curtis22/public_html/shopnowshoplater.com/wp-content/themes/shopnowshoplater/search.php on line 31

这是我正在寻找的产品:" westinghouse igen2500便携式逆变器发电机"



$id = get_the_ID();
$array = $_GET;
$key = array_keys($array);
$cat = $key[0];

$page_n = $key[2];
$keyword = $array[$cat];
$searchkeyword = $array['s'];

$row = 1;
if (isset($page_n)) {
    $row = $array[$page_n];
}

$data = get_category_products($keyword, $searchkeyword, $row);
//print_r($data); exit;
$itemPerPage = 10;
$totalItems = $data['totalItems'];
$totalPages = $data['totalPages'];

$items = $data['items'];
foreach ($items as $item) {
	$image = $item['LargeImage']['URL'];
	
	if( (!isset($image)) && $image=='' ){
		unset($item);
	}
}
$page_url = '';
get_header();
$page_urlbrd = $page_url;
?>




0 个答案:

没有答案