ShaGGy Posted November 26, 2011 Share Posted November 26, 2011 Looking for a bit of help with this add on Multi Vendor Feed Manager Importer I have got it installed and it is downloading the file from the FTP and placing it within the feeds dir but then I get an error Warning: Invalid argument supplied for foreach() in /home/xxxxxxxx/public_html/feed_import.php on line 118 DONE ::Row Count:: 0 ::Redirects:: 0 But line 118 in feed_import.php is a blank line ? any suggestions as I really could do with getting this add on working. thanks for any help in advance. Quote Link to comment Share on other sites More sharing options...
ShaGGy Posted November 29, 2011 Author Share Posted November 29, 2011 (edited) After loading the file into a proper PHP editor it hightlights line 118 which says switch($dbCol){ any ideas what is causin this error I am desperate to get this working. is there some genius out there who can help me? $csv = new parseCSV(); if ($this->config['throttle'] > 0){ $csv->limit = $this->config['throttle']; } $csv->offset = max($this->startRow, 1); $csv->delimiter = $this->config['delimiter']; $file = file($this->config['url']); $fileRows = (sizeof($file) - 1); $fileHeaders = array(); $lineArr = $this->pregSplit($file[0]); foreach($lineArr as $col => $text){ $colCheck = strtolower(trim($text)); if (isset($this->fields[$colCheck])){ $fileHeaders[$col] = $this->fields[$colCheck]; } } unset($file[0]); $csv->fields = $fileHeaders; $csv->parse($this->config['url']); } foreach($csv->data as $row => $lineArr){ $this->dataArray[$row] = array(); foreach($lineArr as $dbCol => $val){ $colCheck = strtolower($val); switch($dbCol){ case 'products_id': break; case 'categories_id': if (isset($this->categories[$colCheck])){ $refArr = $this->categories[$colCheck]; }else{ $refArr = $this->parseCategory($colCheck); } $this->dataArray[$row][$dbCol] = explode('_', $refArr['ref']); break; case 'products_attributes': $arr = explode($this->config['attrib_sep'], $colCheck); foreach($arr as $attribute){ if (tep_not_null($attribute)){ $att = explode($this->config['attrib_price_sep'], $attribute); $attribName = $att[0]; $attribPrice = $att[1]; if (isset($this->attributes[$attribName])){ $this->dataArray[$row][$dbCol][] = array( 'id' => explode('_', $this->attributes[$attribName]), 'price' => $attribPrice ); }else{ $this->dataArray[$row][$dbCol][] = array( 'name' => $attribName, 'price' => $attribPrice, ); } } } break; case 'manufacturers_id': if (isset($this->manufacturers[$colCheck])){ $this->dataArray[$row][$dbCol] = $this->manufacturers[$colCheck]; }else{ $this->dataArray[$row][$dbCol] = str_replace('"', '', $colCheck); } break; default: $this->dataArray[$row][$dbCol] = str_replace('""', '\"', trim($val, '"')); break; } } $row++; $this->rowCount++; } if ($csv->totalProducts > 0){ $this->needsRedirect = true; }else{ $this->needsRedirect = false; } } Edited November 29, 2011 by ShaGGy Quote Link to comment Share on other sites More sharing options...
ShaGGy Posted November 29, 2011 Author Share Posted November 29, 2011 (edited) Sorry its line 114 that has the error foreach($csv->data as $row => $lineArr){ Edited November 29, 2011 by ShaGGy Quote Link to comment Share on other sites More sharing options...
alexiscruz007 Posted November 15, 2013 Share Posted November 15, 2013 which version I installed using either the 2.2 what is not good is to use and configure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.