Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyPopulate 1.0 - Populate your store from Excel / csv


wasson65

Recommended Posts

Am using Easypopulate 2 amd thanks to everyone who contributed to it. After a number of false starts got it going and its going to save a great deal of time.

 

I have a question though. We run 2 sites - one with 1 tax code (zero %) and the other with 2 (zero and 17.5%).

 

Which part of the code do we need to adjust to switch these options on/off? Is it

 

 

// $v_products_weight = doubleval ($v_products_weight);

// if ($v_tax_class_id == '') {$v_tax_class_id = 0;}

 

Thanks for your nelp

Citizen of US Minor Outlying Islands

Link to comment
Share on other sites

  • Replies 362
  • Created
  • Last Reply

Top Posters In This Topic

hi @ll!

 

sorry for my bad english! i have a problem whit Easy Populate 2.1

i can download the file but when i will upload i become this message:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/www/web19/html/catalog/admin/easypopulate.php on line 724

 

can u help me please!

regards,

cyberfly

Link to comment
Share on other sites

hi @ll!

 

sorry for my bad english!  i have a problem whit Easy Populate 2.1

i can download the file but when i will upload i become this message:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/www/web19/html/catalog/admin/easypopulate.php on line 724

 

can u help me please!

regards,

cyberfly

 

You're running an older snapshot. EasyPopulate needs a snapshot from after november 1 (the new checkout code).

 

Tim

Link to comment
Share on other sites

If you want to run easy populate with default language reported on category instead of always language id 1

 

Find Near 215

require('includes/application_top.php');

Add After

//elari check default language_id from configuration table DEFAULT_LANGUAGE

$epdlanguage_query = tep_db_query("select languages_id, name from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");

if (tep_db_num_rows($epdlanguage_query)) {

$epdlanguage = tep_db_fetch_array($epdlanguage_query);

$epdlanguage_id = $epdlanguage['languages_id'];

$epdlanguage_name = $epdlanguage['name'];

} else {

Echo 'Strange but there is no default language to work... That may no happen, just in case... ';

}

 

Find near 253

echo "Easy Populate $curver";

Replace

echo "Easy Populate $curver - Default Language : " . $epdlanguage_name . '(' . $epdlanguage_id .')' ;

 

Find Near 321 categories_id = " . $thecategory_id . " AND

language_id = " . $langcode['1'];

Replace last line to look like this language_id = " . $epdlanguage_id ;

 

 

i have run this on easypopulate 2.2 beta

the updated file is in my cvs for who want

Link to comment
Share on other sites

I get this error:

 

| | | SWINGARM P | | | | | | 89.9500 | 0.00 | 2002-12-03 | 0 | | Guards | Body | | | | | | 



No products_model field in record. This line was not imported 



| | | SWINGARM P | | | | | | 89.9500 | 0.00 | 2002-12-03 | 0 | | Guards | Body | | | | | | 



No products_model field in record. This line was not imported 



| radiator_s | | RADIATOR S | | | | | | 39.9500 | 0.00 | 2002-12-03 | 0 | | Radiator S | Body | | | | | |

 

I download the tab-delimited file, change the name of it and just upload the file back without even opening it in excel... It will not upload correctly. I'm running osc 2.2 (one of the newer snapshots) and easy populate 2.2. Please help.

Link to comment
Share on other sites

to fozzynetworks

do you have a the field model filled for the products in admin of products

Easy Populate need the Products model to be avalaible

 

 

Rerun a little bit the auto adapt language and i need some report of people using more than the 3 languages and if avalaible shop using language_id like 1,2,3,5 (missing one id) and test with shop using language like 2,3,4,5,7 or somethink like that

the file is avalaible here

www.unlockgsm.com/dload-osc/ in ep-not-off directory

Link to comment
Share on other sites

I get this error:

 

| | | SWINGARM P | | | | | | 89.9500 | 0.00 | 2002-12-03 | 0 | | Guards | Body | | | | | | 



No products_model field in record. This line was not imported 



| | | SWINGARM P | | | | | | 89.9500 | 0.00 | 2002-12-03 | 0 | | Guards | Body | | | | | | 



No products_model field in record. This line was not imported 



| radiator_s | | RADIATOR S | | | | | | 39.9500 | 0.00 | 2002-12-03 | 0 | | Radiator S | Body | | | | | |

 

I download the tab-delimited file, change the name of it and just upload the file back without even opening it in excel... It will not upload correctly. I'm running osc 2.2 (one of the newer snapshots) and easy populate 2.2. Please help.

 

EP uses the product_model to identify which item is being referenced. If it's not there, then EP won't know if this is a new product or a modification of an existing product.

 

Short Answer: just like elari said, EP must have Product_model to work.

 

Tim

Link to comment
Share on other sites

Ya, I fixed that... now I'm having an issue try to add a Tax Class to the products.

 

If you go into EP, and uncomment the v_tax_class_id, it should show up in the downloads.

 

I don't have the tax class using the words instead of the id yet. Probably should change EP to do that, since it does it with everything else...

 

Tim

Link to comment
Share on other sites

Ok, and also what sohuld I do about an error when I leave the image cell for the product blank. It get's and error when i upload it.

 

Try putting a space in the image field in excel, and save that as the tab delimited file.

 

In 2.2 I'm going to move the image field to the end of the row, and make product_model (which is required) the first field. It seems like the php explode function doesn't work well if there are blank fields at the start of the data.

 

Tim

Link to comment
Share on other sites

may someone check this file for testing

http://www.unlockgsm.com/dload-osc/ep-not-...php-2m1205-1.18

 

rename to easypopulate.php

 

- report categories in the default language

- auto adapt to language number

- report tax class title

- report price with or without price included can be set in file

- import price and remove tax if included

 

this is unofficial easypopulate 2.2beta++ and is just provided as is for test

Link to comment
Share on other sites

I read the whole thread (WOW) and have run into a problem (at least I think it is) with excel

 

excel 2002

tep 2.2 (late november)

ep 2.1

 

I download the .txt file in notepad and it is all enclosed by quotes (good).

I open it in excel and save it any format (really any) and it removes ALL the quotes around fields. I try to upload it and it won't take it, when I try to split (900 records) it says

 

File uploaded.

Temporary filename: /tmp/php8yxcED

User filename: good inventory.txt

Size: 125943

Creating file EP_Split1.txt ... Added 0 records and closing file...

 

You can download your split files in the Tools/Files under /catalog/temp/

 

so it obviously isn't parsing the file right I assume without the quotes. Then I found a VB snippet from M$ knowledge base http://support.microsoft.com/default.aspx?...kb;en-us;291296 saying

Microsoft Excel does not have a menu command to automatically export data to a text file so that the text file is exported with both quotation marks and commas as delimiters. For example, there is no command to automatically create a text file that contains the following:

 

"Text1","Text2","Text3"

so I used the snippet in the article and can get out a comma delimited file with quotes. But that file won't work either, same message.

 

Am I too hung up on the quotes? Do I really need to have the file tab delimited enclosed in quotes?

 

I have no smarts I am aware of... someone have pity on me :roll:

Link to comment
Share on other sites

Hi, sorry for the problems you're having....

 

The quotes are not required. Comma delimited will not work. Tab delimited is required.

 

The fact that the split didn't find any records means it's not seeing the end of row field EOREOR in the data. It counts the EOREOR fields to know when it's gotten enough records to fill one file.

 

You are saving as a "text (tab delimited)" file, right?

 

If you do a download of the txt file, and just cut off all except the first few lines in notepad, can you import that?

 

If you can just send me the downloaded file, I'll take a look and see what's up.

 

Tim

Link to comment
Share on other sites

ok I have been trying to upload in smaller chunks and this is what I have gotten so far

File uploaded.

Temporary filename: /tmp/phps2QS1J

User filename: inventory.txt

Size: 18800

| default.gi | 016-1194-0 | Xerox 50 T | Xerox 50 T | 50 | 0 | 11/28/2002 | 10 | Xerox | 615 | | | | | | | Updated

| default.gi | 016-1130-0 | Xerox 50 T | Xerox 50 T | 42 | 0 | 11/28/2002 | 10 | Xerox | 615 | | | | | | | Updated

 

Intermission... :wink:

 

| default.gi | F13-IC22-P | Canon Imag | Canon Imag | 4150 | 0 | 11/28/2002 | 10 | Canon | 1314 | | | | | | | !New Product!

| default.gi | 1518A002AA | Canon Mage | Canon Mage | 159 | 0 | 11/28/2002 | 10 | Canon | 2011 | | | | | | | !New Product!

| default.gi | M95-0271 | Canon PC70 | Canon PC70 | 132 | 0 | 11/28/2002 | 10 | Canon | 2015 | | | | | | | !New Product!

| default.gi | 1517A002AA | Canon Yell | Canon Yell | 159 | 0 | 11/28/2002 | 10 | Canon | 2011 | | | | | | | !New Product!

| default.gi | C4717A | DesignJet | DesignJet | 230 | 0 | 11/28/2002 | 10 | HP | 1211 | | | | | | | !New Product!

| default.gi | C4713A | DesignJet | DesignJet | 1349 | 0 | 11/28/2002 | 10 | HP | 1211 | | | | | | | !New Product!

| | | | | | | | | | | | | | | | |

 

No products_model field in record or incorrect root for category. I cannot import this record!

 

that was a hundred or so items

 

it seems so far I haven't come accross the problem but lemme confirm that the quotes are NOT neccessary? but tabs is.

Link to comment
Share on other sites

well I am stumped and feel real foolish

 

I S L O W L Y copied and pasted small amounts into separate text files and uploaded them all successful until it seems the file got too large (i kept appending the file and re-uploading it hoping it was perhaps some string of data that was messed up) so when it hung up I slowly ran the last group looking for the messed up data but then... NUTS it all went through (so there goes the malformed data theory) so I got the entire catalog uploaded.

 

So I sent half and then larger and larger until it hung up. The half size data is 450 or so lines long and it will go through the upload with success... however if I send it through the split it won't complete. the page just blinks and I am back where I started.

 

I tried with the half page & full page to split it and here is what I got

File uploaded.

Temporary filename: /tmp/phpIN9CBb

User filename: inventory lets see if it works.txt

Size: 157337

Creating file EP_Split1.txt ... Added 0 records and closing file...

 

my EP_Split1.txt contains 900+ records (same as the inventory input) and no splits.

 

I think that (now that I have a workaround for me) that this contribution is FANTASTIC!!! I have been looking for this for months and now it is there.

 

I would be more than happy to try out any betas on my dev store.

Link to comment
Share on other sites

hi @ll!

 

sorry for my bad english!  i have a problem whit Easy Populate 2.1

i can download the file but when i will upload i become this message:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/www/web19/html/catalog/admin/easypopulate.php on line 724

 

can u help me please!

regards,

cyberfly

 

You're running an older snapshot. EasyPopulate needs a snapshot from after november 1 (the new checkout code).

 

Tim

 

Hi Tim,

 

I am also getting this error. When you say EasyPopulate needs a snapshot from after november 1, I assume you are talking about the main OSC code. However, I am the third person to be working on our store, and I am worried about copying the new version over the old due to so many developers having already made hacks (e.g. enhancements) to the store. Is there one small element (piece of code, tweak, whatever) that I can add that will make this above error go away, and allow us to use Easy Populate. If so, I would be so grateful to know what it is and where to put it, etc.. Thanks for your work on this. The export worked so well!! I am really exited to get the import working too (if possible).

 

Sincerely,

 

joeyramone

Link to comment
Share on other sites

hi @ll!

 

sorry for my bad english!  i have a problem whit Easy Populate 2.1

i can download the file but when i will upload i become this message:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/www/web19/html/catalog/admin/easypopulate.php on line 724

 

can u help me please!

regards,

cyberfly

 

You're running an older snapshot. EasyPopulate needs a snapshot from after november 1 (the new checkout code).

 

Tim

 

Hi Tim,

 

I am also getting this error. When you say EasyPopulate needs a snapshot from after november 1, I assume you are talking about the main OSC code. However, I am the third person to be working on our store, and I am worried about copying the new version over the old due to so many developers having already made hacks (e.g. enhancements) to the store. Is there one small element (piece of code, tweak, whatever) that I can add that will make this above error go away, and allow us to use Easy Populate. If so, I would be so grateful to know what it is and where to put it, etc.. Thanks for your work on this. The export worked so well!! I am really exited to get the import working too (if possible).

 

Sincerely,

 

joeyramone

 

It's not just a little thing, but you might grab a new snapshot, set it up in parallel to your existing shop, but point it at the same database.

 

Then just use the new shop to do the EP stuff with, but the actual shop runs on the older code.

 

This is the simplest, but not smallest way to make it work.

 

The next smallest thing would be to start pulling functions out of general.php and stuffing them into easypopulate.php, starting with the tep_get_uploaded_file. Then see what it complains about missing next. Then add that in, repeat until it will run. At some point you'll probably end up hardcoding some database values into the code...

 

Tim

Link to comment
Share on other sites

Thanks a lot. The first idea of setting of a second admin area just for easypopulate worked great. It was a really easy and non-invasive work around too. Thanks for the great and extremely fast feedback!!

 

joeyramone

Link to comment
Share on other sites

try to add this in admin/functions/general.php

or update your shop :))

 

 

function tep_get_uploaded_file($filename) {

if (isset($_FILES[$filename])) {

$uploaded_file = array('name' => $_FILES[$filename]['name'],

'type' => $_FILES[$filename]['type'],

'size' => $_FILES[$filename]['size'],

'tmp_name' => $_FILES[$filename]['tmp_name']);

} elseif (isset($GLOBALS['HTTP_POST_FILES'][$filename])) {

global $HTTP_POST_FILES;

 

$uploaded_file = array('name' => $HTTP_POST_FILES[$filename]['name'],

'type' => $HTTP_POST_FILES[$filename]['type'],

'size' => $HTTP_POST_FILES[$filename]['size'],

'tmp_name' => $HTTP_POST_FILES[$filename]['tmp_name']);

} else {

$uploaded_file = array('name' => $GLOBALS[$filename . '_name'],

'type' => $GLOBALS[$filename . '_type'],

'size' => $GLOBALS[$filename . '_size'],

'tmp_name' => $GLOBALS[$filename]);

}

 

return $uploaded_file;

}

 

// the $filename parameter is an array with the following elements:

// name, type, size, tmp_name

function tep_copy_uploaded_file($filename, $target) {

if (substr($target, -1) != '/') $target .= '/';

 

$target .= $filename['name'];

 

move_uploaded_file($filename['tmp_name'], $target);

}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...