Jump to content
Sign in to follow this  
ShaGGy

Multi Vendor Feed Manager Importer

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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 by ShaGGy

Share this post


Link to post
Share on other sites

Sorry its line 114 that has the error

 

foreach($csv->data as $row => $lineArr){

Edited by ShaGGy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×