Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi Vendor Feed Manager Importer


ShaGGy

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.

Link to comment
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
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...