Jump to content
VJ

Easy Populate & Products Attributes

Recommended Posts

also in the url box for the product image it put the url http://vliegeruit.com/ocs in front of it

so it looks like http://vliegeruit.com/ocs/http://www.otherurl.com

the second quistion is when we import most productdecriptions are cut of after around 250 characters

only not the first and last one as far as i can see , any body an idea , how that possible or can be avoided or changed

 

 

 

i think i found out about the problem of the import limit to 250 characters its has to to with our text file csv

i t did cut off there somewere to max 250 charcters so that was not a problem of EP as far as i can see now

 

but i hope some one has an answer on the other questions about the quotes and url stuff

 

Arthur

Share this post


Link to post
Share on other sites
here are the settings

yes we are using 2.76d

Settings

 

Temp Dir:

/home/vliegeru/public_html/osc/catalog/temp/

 

Split files on: 300 records

 

Model Num Size: 25

 

Price with tax: true

 

Replace quotes: false

 

Field seperator: tab

 

Excel safe output: false

 

Preserve tab/cr/lf: false

 

Category depth: 7

 

Enable attributes: true

 

SEF Froogle URLS: false

thanks for your time Arthur

 

in the easypopulate.php there is this part about

the replacing of the quotes maybe something must change here?

 

 

function walk( $item1 ) {

global $filelayout, $filelayout_count, $modelsize;

global $active, $inactive, $langcode, $default_these, $deleteit, $zero_qty_inactive;

global $epdlanguage_id, $price_with_tax, $replace_quotes;

global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category;

global $separator, $max_categories;

global $excel_safe_output;

// first we clean up the row of data

 

 

if ($excel_safe_output == true) {

$items = $item1;

} else {

// chop blanks from each end

$item1 = ltrim(rtrim($item1));

 

// blow it into an array, splitting on the tabs

$items = explode($separator, $item1);

}

 

// make sure all non-set things are set to '';

// and strip the quotes from the start and end of the stings.

// escape any special chars for the database.

foreach( $filelayout as $key=> $value){

$i = $filelayout[$key];

if (isset($items[$i]) == false) {

$items[$i]='';

} else {

// Check to see if either of the magic_quotes are turned on or off;

// And apply filtering accordingly.

if (function_exists('ini_get')) {

//echo "Getting ready to check magic quotes<br>";

if (ini_get('magic_quotes_runtime') == 1){

// The magic_quotes_runtime are on, so lets account for them

// check if the last character is a quote;

// if it is, chop off the quotes.

if (substr($items[$i],-1) == '"'){

$items[$i] = substr($items[$i],2,strlen($items[$i])-4);

}

// now any remaining doubled double quotes should be converted to one doublequote

$items[$i] = str_replace('\"\"',""",$items[$i]);

if ($replace_quotes){

$items[$i] = str_replace('\"',""",$items[$i]);

$items[$i] = str_replace("\'","'",$items[$i]);

}

} else { // no magic_quotes are on

// check if the last character is a quote;

// if it is, chop off the 1st and last character of the string.

if (substr($items[$i],-1) == '"'){

$items[$i] = substr($items[$i],1,strlen($items[$i])-2);

}

// now any remaining doubled double quotes should be converted to one doublequote

$items[$i] = str_replace('""',""",$items[$i]);

if ($replace_quotes){

$items[$i] = str_replace('"',""",$items[$i]);

$items[$i] = str_replace("'","'",$items[$i]);

}

}

}

}

}

Share this post


Link to post
Share on other sites

nevermind, I solved the problem with the Excel-safe csv-file.

I needed to change the separator to ;

if ($excel_safe_output == true) { $separator = ";"; }

now it works fine :)

 

I'll probably write a Multilanguage version of EP 2.76d-MS2 if I can find the time doing it and if anyone is

interested...

Share this post


Link to post
Share on other sites

Can someone guide me to some documentation or a thread about adding additional fields to EP I have a couple custom fields in my products database I would like to be able to download/populate.

 

Thanks!

Matt

Share this post


Link to post
Share on other sites

Hi,

 

I'm about to make an online book shop with over 17000 books. Will this contribution allow me upload and delete 1000's of products at a time

 

Thanks in advance

dave

Share this post


Link to post
Share on other sites
Well.... After installing the latest version I have found that easypopulate doesn't export/import the fields filename, expiry days and maximum download count under product attributes. Is there a quick way to add this fields to be exported/imported into the code?????

>_< drag. since those fields are in the original osC code, I'll take a look at adding that in a future work.

Share this post


Link to post
Share on other sites

save the file, then right click and open with and select excel

 

hi,

 

i've been using Easy Populate for a long time now and just updated from 2.74-MS2 to the newest 2.76d-MS2 by surfalot because of the Excel-safe output.

With regular output as a tab-delimited txt-file surfalot's version works fine, but the Excel-safe output doesn't

seem to create properly formatted files.

When I open the csv-file with a double click Excel reads all the columns in one column like this:

v_products_model,v_products_name_2,v_products_description_2,v_products_image,v_c
ategories_name_1,v_categories_name_2,v_categories_name_3,v_categories_name_4,EORE
OR

It doesn't separate the columns.

Any ideas?


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites
hi,

 

i've been using Easy Populate for a long time now and just updated from 2.74-MS2 to the newest 2.76d-MS2 by surfalot because of the Excel-safe output.

With regular output as a tab-delimited txt-file surfalot's version works fine, but the Excel-safe output doesn't

seem to create properly formatted files.

When I open the csv-file with a double click Excel reads all the columns in one column like this:

v_products_model,v_products_name_2,v_products_description_2,v_products_image,v_c
ategories_name_1,v_categories_name_2,v_categories_name_3,v_categories_name_4,EORE
OR

It doesn't separate the columns.

Any ideas?

I would like to see that failing output so I can understand what data was causing you trouble.

I can't believe excel imports it correctly with semicolons.

Share this post


Link to post
Share on other sites
>_< drag. since those fields are in the original osC code, I'll take a look at adding that in a future work.

 

Thanks... Can you at least post an edited code in the meantime while you update the entire code with other added features???? (I have like 1000 entries which I do not want to do manually one-by-one). :blush:

Share this post


Link to post
Share on other sites
Hi

 

I have installed Easy Populate 2.76d-MS2 - Default Language : English(1) with the following

 

PHP Version: 5.0.4 (Zend: 2.0.4-dev)

 

Database: MySQL 5.0.21-standard-log

 

Temp Dir:

/websites/symlinks/de/ca/ls/xxxxxxxx/public_html/catalog/temp/

 

Split files on: 300 records

 

Model Num Size: 12

 

Price with tax: true

 

Replace quotes: false

 

Field seperator: comma

 

Excel safe output: true

 

Preserve tab/cr/lf: false

 

Category depth: 3

 

Enable attributes: true

 

SEF Froogle URLS: false

 

I have changed easypopulate.php with the php 5 update. I have tried every combination suggested in this topic for the settings to the temp dir. I have even tried "nothing" to try and get an error message.

 

All it does when you try to create a .csv file is refresh the page, I have search through this topic and read eveything I think is of relevence but nothing seems to work. I have not got any contributions installed that should cause a conflict.

 

Any suggestions please

 

Regards

 

Mike

can you also try the v2.76c version? if that doesn't work either (like another yesterday), there is some pre-existing bug, or newer php bug maybe.

Share this post


Link to post
Share on other sites
Hi,

 

I'm about to make an online book shop with over 17000 books. Will this contribution allow me upload and delete 1000's of products at a time

 

Thanks in advance

dave

sorry, no delete feature at the moment

Share this post


Link to post
Share on other sites
in the easypopulate.php there is this part about

the replacing of the quotes maybe something must change here?

yes, if replacing quotes with the html equivalent when importing, comment this code out (2 locations). that should stop that.

1679-1683

					$items[$i] = str_replace('\"\"',""",$items[$i]);
				if ($replace_quotes){
					$items[$i] = str_replace('\"',""",$items[$i]);
					$items[$i] = str_replace("\'","'",$items[$i]);
				}

 

 

 

1691-1695

					$items[$i] = str_replace('""',""",$items[$i]);
				if ($replace_quotes){
					$items[$i] = str_replace('"',""",$items[$i]);
					$items[$i] = str_replace("'","'",$items[$i]);
				}

Edited by surfalot

Share this post


Link to post
Share on other sites
I would like to see that failing output so I can understand what data was causing you trouble.

I can't believe excel imports it correctly with semicolons.

 

Actually I found out, that it depends on your regional settings in WindowsXP.

As I have a German WinXP the list separator is set to a semicolon. I would guess that an English XP has

the list separator set to a comma... And that is what Excel expects when opening a csv-file

 

Now I just need to add an option on the Easy Populate admin page to choose the separator on a case

by case basis, because my brother is working on the same shop from the US and he has an American XP.

 

Maybe the whole separator thing should be explained in the source code where you set the separator?

Share this post


Link to post
Share on other sites
Actually I found out, that it depends on your regional settings in WindowsXP.

As I have a German WinXP the list separator is set to a semicolon. I would guess that an English XP has

the list separator set to a comma... And that is what Excel expects when opening a csv-file

 

Now I just need to add an option on the Easy Populate admin page to choose the separator on a case

by case basis, because my brother is working on the same shop from the US and he has an American XP.

 

Maybe the whole separator thing should be explained in the source code where you set the separator?

great, that's good information. it is this issue: http://support.microsoft.com/kb/266200

I can write code to set the list separator according to the browser language for the export, then have the import determine what is being used based on the list separator it finds in the column header row.

that should allow you and your brother to work off the same shop.

I have looked around and I don't see any way to get the list separator from windows itself in PHP or apache system, so this will only work for each country code I know the list separator setting in advance.

 

find this in easypopulate.php:

if ($excel_safe_output == true) { $separator = ","; }

replace with:

if ($excel_safe_output == true) { 
 if ($language == 'english') { 
$separator = ","; 
 } elseif ($language == 'german') {
$separator = ";";
 } else {
$separator = ","; // default for all others.
 }
}

then find this in easypopulate.php:

	  while($line = fgetcsv($fp,32768,$separator))   // read new line (max 32K bytes)

add just before it:

	  $header_line = fgets($fp);
  if (strpos($header_line,',') !== false) {$separator = ',';}
  if (strpos($header_line,';') !== false) {$separator = ';';}
  if (strpos($header_line,"\t") !== false) {$separator = "\t";}
  if (strpos($header_line,"~") !== false) {$separator = "~";}
  if (strpos($header_line,"-") !== false) {$separator = "-";}
  if (strpos($header_line,"*") !== false) {$separator = "*";}
  rewind($fp);

hope this helps... feedback is always appreciated!

Share this post


Link to post
Share on other sites

Hmm I am getting the same error as Mike listed above. All it does is refresh the page when I click anything. For some reason the script isnt running. I see the page and buttons just fine. When I click a download txt file button or any other button it just refreshes..

 

PLEASE HELP!!!

 

Thanks,

 

Jerry

Share this post


Link to post
Share on other sites
Hmm I am getting the same error as Mike listed above. All it does is refresh the page when I click anything. For some reason the script isnt running. I see the page and buttons just fine. When I click a download txt file button or any other button it just refreshes..

 

PLEASE HELP!!!

 

Thanks,

 

Jerry

still looking for someone with this problem to help narrow down the issue for us...

Make absolutely sure your temp dir is set correctly.

can you also try the v2.76c version? same problem or no?

see post 4919 and please report the last line number that code was on when you could see the "I'm Here" displayed.

Edited by surfalot

Share this post


Link to post
Share on other sites

i am using Easy Populate 2.76d-MS2 - Default Language : English(1)

 

Im not sure what you mean by last line number that code was on..

 

Is there a function somewhere that will step through the code or something?

 

The link you posted was to the top of the page 247.. Am I missing something more??

 

I REALLY appreciate your quick response...

Share this post


Link to post
Share on other sites

please reread, I edited the post after I saw the post specific links aren't working.

Share this post


Link to post
Share on other sites
I out of general ideas, the next step I would take on that box (if you are really determined to find the problem), is to start at line 311 of easypopulate.php. Add this in the blank space there:

echo "I'm here";
exit;

the upload, open easypopulate in your browser, try a download. You should see "I'm Here" be displayed. Then move that 2 line block of code down to another break in the code and try again. when you stop seeing that "I'm Here" displayed we'll know where it blows-up.

The last line of the download code is 686. so you can stop there.

 

Im on it... will let you know.. Thanks

Share this post


Link to post
Share on other sites

I can see it when its like this..

//*******************************
//*******************************
echo "I'm here";
exit;

if ( $download == 'stream' or  $download == 'activestream' or  $download == 'tempfile' ){

//*******************************
//*******************************
// DOWNLOAD FILE
//*******************************
//*******************************
$filestring = ""; // this holds the csv file we want to download

 

I cant see it when its like this...

 

//*******************************
//*******************************
// E N D
// INITIALIZATION
//*******************************
//*******************************


if ( $download == 'stream' or  $download == 'activestream' or  $download == 'tempfile' ){
echo "I'm here";
exit;
//*******************************
//*******************************
// DOWNLOAD FILE
//*******************************
//*******************************
$filestring = ""; // this holds the csv file we want to download
$result = tep_db_query($filelayout_sql);
$row =  tep_db_fetch_array($result);

 

So I guess the problem is with the variable $Download ???

Share this post


Link to post
Share on other sites
So I guess the problem is with the variable $Download ???

yup, I see now. try this:

find:

if ( $download == 'stream' or  $download == 'activestream' or  $download == 'tempfile' ){

 

replace with:

if ( !empty($_GET['download']) && ($_GET['download'] == 'stream' or $_GET['download'] == 'activestream' or $_GET['download'] == 'tempfile') ){

Share this post


Link to post
Share on other sites

Well its doing more now.. Nice find... I am getting an error now tho..

 

1065 - Query was empty

 

 

 

[TEP STOP]

Share this post


Link to post
Share on other sites
Well its doing more now.. Nice find... I am getting an error now tho..

 

1065 - Query was empty

[TEP STOP]

are u using the register globals fix by chance? any issues with the globals that you know of?

Share this post


Link to post
Share on other sites

I can NOT see "I'm Here" with this I get that error..

 

	$filestring = ""; // this holds the csv file we want to download
$result = tep_db_query($filelayout_sql);
$row =  tep_db_fetch_array($result);
		echo "I'm here";
exit;

 

I CAN see "I'm Here" with this

			echo "I'm here";
exit;
$filestring = ""; // this holds the csv file we want to download
$result = tep_db_query($filelayout_sql);
$row =  tep_db_fetch_array($result);

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

×