Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

Hi Surfalot

 

Is there any way that I can put my developer in contact with you? I need to find a system for uploading and updating large numbers of products and we want the product ID to remain the same for each product every time we upload. Maybe the version I am using is set up incorrectly.

 

Thanks

 

e-new

 

he is welcome to ask questions here.

Link to comment
Share on other sites

i am getting this error when i try to upload the file. made all the chagnes.. from 1readmeFirst.txt file.

 

 

 

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

 

 

Warning: move_uploaded_file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php0F6E5C' to 'DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt' in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

File uploaded.

Temporary filename: /tmp/php0F6E5C

User filename: EP2007Jun13-1301(2).txt

Size: 474605

 

Warning: file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 805

 

Warning: Invalid argument supplied for foreach() in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 844

Link to comment
Share on other sites

can any one please help me fix these errors ... i can create/download the file just fine.. but get the error when i try to upload.

 

i am getting this error when i try to upload the file. made all the chagnes.. from 1readmeFirst.txt file.

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

Warning: move_uploaded_file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php0F6E5C' to 'DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt' in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

File uploaded.

Temporary filename: /tmp/php0F6E5C

User filename: EP2007Jun13-1301(2).txt

Size: 474605

 

Warning: file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 805

 

Warning: Invalid argument supplied for foreach() in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 844

Link to comment
Share on other sites

Thank you Nicole.

Very interesting information, I did not realize.

Thanks again,

Jim

 

 

again, that is not true.

 

Thank you Todd for setting the record straight. ;)

 

Jim

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

i am getting this error when i try to upload the file. made all the chagnes.. from 1readmeFirst.txt file.

 

 

 

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

 

 

Warning: move_uploaded_file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php0F6E5C' to 'DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt' in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate_functions.php on line 43

 

File uploaded.

Temporary filename: /tmp/php0F6E5C

User filename: EP2007Jun13-1301(2).txt

Size: 474605

 

Warning: file(DIR_FS_DOCUMENT_ROOT/test/temp/EP2007Jun13-1301(2).txt) [function.file]: failed to open stream: No such file or directory in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 805

 

Warning: Invalid argument supplied for foreach() in /home/itsmysit/public_html/increaselinks/test/admin/easypopulate.php on line 844

search this topic for DIR_FS_DOCUMENT_ROOT for help on this issue.

Link to comment
Share on other sites

Hi,

 

 

I use Easy Populate 2.76d-MS2 (with attributes) - register globals off . When I try to upload a file ( modified with Excel, Openoffice, Windows Editor or just unmodified) nothing happens. Neither I get a progress bar or a list of imported items nor I get an error message. Even when I try to import an image the browser just uploads the file and displays the easypopulate.php without any error... download works fine....

 

can anybody tell me what is wrong ?

 

thanks

Link to comment
Share on other sites

alright it works just added

 

 

 

// fix by jb 20040815 set the strings to http post/request, since they don't seem to work on the new server, with register globals=off...

$dltype=$_REQUEST['dltype'];

$download=$_REQUEST['download'];

 

global $HTTP_POST_FILES;

 

foreach( $HTTP_POST_FILES as $varname => $fileinfo ){

$GLOBALS[$varname] = $fileinfo["tmp_name"];

$GLOBALS[$varname.'_name'] = $fileinfo["name"];

}

// end fix jb

 

 

 

to the easypopulate.php

Link to comment
Share on other sites

Dear All,

 

Could someone please help me, i am a complete beginner to easy populate, and although i have been learning for some time of running websites, i am not sure either how to work in databases, and i wondered if someone could please point me in the direction of how i can get hold of a good instruction guide of how to use easy populate.

 

My main priority question is when i import a .txt file how do i get the products info to be inserted into the actual websites, so they categorise and and show upon my website.

 

It would dearly be appreciated if someone could please advise me, so i may continue with my endeavours.

 

Thankyou, Pureliving.

Link to comment
Share on other sites

Surfalot...

Wanted to ask, I downloaded your latest version and noticed that there are several instructions files. I think two, which one should I use and follow religiously?

I really need for this to work and dont want to mess anything up in my store?

Thanks

Daniel

Link to comment
Share on other sites

Hi,

 

I have been using version 2.76d with no problems until now.

 

Stupidly i deleted all products from my database using an amend databse contribution.

 

I therefore proceeded to upload my ep.txt file and using ep in the admin panel selected Import EP file from Temp Dir.

 

This was working for me only a couple of hours ago and i have made no changes to any file.

 

The programme proceeds to upload the first 2 products from the list and then displays the following error message:

 

1062 - Duplicate entry '0' for key 1

 

INSERT INTO products ( products_image, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'large/24/24302.jpg', '24302', '9.49', '1', CURRENT_TIMESTAMP, "0000-00-00 00:00:00", "0000-00-00 00:00:00", '', '0', '163', 'NULL')

 

[TEP STOP]

 

can you guide me please to a swift solution.

 

Many Thanks

D4

Link to comment
Share on other sites

okay,

 

after a bit of testing the error has now changed please ignore the post above.

 

New Error:

 

Filename: EP2007Jun18-1705.txt

 

Warning: file(DIR_FS_DOCUMENT_ROOT/temp/EP2007Jun18-1705.txt) [function.file]: failed to open stream: No such file or directory in /homepages/26/d198638006/htdocs/admin/easypopulate.php on line 824

 

Warning: Invalid argument supplied for foreach() in /homepages/26/d198638006/htdocs/admin/easypopulate.php on line 844

 

The line 824 refers to:

 

// get the entire file into an array

$readed = file($tempdir . $localfile); [strong]THIS IS LINE 824[/strong]

}

if ($excel_safe_output == true) {

 

Whilst 844 refers to:

 

// do normal EP input

// now we string the entire thing together in case there were carriage returns in the data

$newreaded = "";

foreach ($readed as $read){ [strong]THIS IS LINE 844[/strong]

$newreaded .= $read;

}

 

 

Can anyone shed any light on this?

 

php version 4.4.7

mysql version 4.0.27

ep version 2.76d-MS2

 

Many Thanks

D4

Edited by d4funky1
Link to comment
Share on other sites

ok tried some more and it looks like i'm back to the original issue:

 

Filename: EP2007Jun18-1705.txt

| 22624 | large/22/2 | ARMOUR, SH | ARMOUR, SH | | 2.49 | 0 | 0000-00-00 | 0000-00-00 | 338 | | | | | | | | | | | | | | | | | | | | | | | | | Accessorie | Armour | | --none-- | Active Updated

| 24302 | large/24/2 | ARMOUR, CO | ARMOUR, CO | | 9.49 | 0 | 0000-00-00 | 0000-00-00 | 163 | | | | | | | | | | | | | | | | | | | | | | | | | Accessorie | Armour | | --none-- | Active !New Product!

1062 - Duplicate entry '0' for key 1

 

INSERT INTO products ( products_image, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'large/24/24302.jpg', '24302', '9.49', '1', CURRENT_TIMESTAMP, "0000-00-00 00:00:00", "0000-00-00 00:00:00", '', '0', '163', 'NULL')

 

[TEP STOP]

 

Anyone?

 

I've seen that this could be to do with an auto increment issue with the database? can anyone confirm this and point me in the right direction?

 

Many Thanks

D4

Link to comment
Share on other sites

Checkout out this following web link, and scroll down to the second topic, i do not know if this will help, but i hope so.

 

 

http://www.oscommerce.com/forums/index.php?showuser=71648

 

In the mean time can anyone tell me of a good manual of how to import and export using easy populate please, my main concern is how do i get the products; once imported; to show upon my website, it would be appreciated if someone could please lead me in the right direction, or explain here please.

 

Thankyou, pureliving

Link to comment
Share on other sites

I am sooooo confused.

 

I downloaded Easy Populate 2.72.... installed it on one site... it worked perfectly.

Installed it onto another site... and problems!

 

The file downloads, with all of the products in it... but it does not upload. My catalog root is www.mysite.com/cat so for my configuration i set it up to be

 

// Current EP Version

$curver = '2.72-MS2';

 

/*

$Id: easypopulate.php,v 2.72 2003/12/28 VJ Exp $

*/

 

//

//*******************************

//*******************************

// C O N F I G U R A T I O N

// V A R I A B L E S

//*******************************

//*******************************

 

// **** Temp directory ****

// if you changed your directory structure from stock and do not have /catalog/temp/, then you'll need to change this accordingly.

//

$tempdir = "/cat/temp/";

$tempdir2 = "/cat/temp/";

 

//**** File Splitting Configuration ****

// we attempt to set the timeout limit longer for this script to avoid having to split the files

// NOTE: If your server is running in safe mode, this setting cannot override the timeout set in php.ini

// uncomment this if you are not on a safe mode server and you are getting timeouts

// set_time_limit(330);

 

// if you are splitting files, this will set the maximum number of records to put in each file.

// if you set your php.ini to a long time, you can make this number bigger

global $maxrecs;

$maxrecs = 300; // default, seems to work for most people. Reduce if you hit timeouts

//$maxrecs = 4; // for testing

 

//**** Image Defaulting ****

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

 

// set them to your own default "We don't have any picture" gif

$default_image_manufacturer = 'blank.jpg';

$default_image_product = 'soon.jpg';

$default_image_category = 'blank.jpg';

 

// or let them get set to nothing

//$default_image_manufacturer = '';

//$default_image_product = '';

//$default_image_category = '';

 

//**** Status Field Setting ****

// Set the v_status field to "Inactive" if you want the status=0 in the system

// Set the v_status field to "Delete" if you want to remove the item from the system <- THIS IS NOT WORKING YET!

// If zero_qty_inactive is true, then items with zero qty will automatically be inactive in the store.

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

$active = 'Active';

$inactive = 'Inactive';

//$deleteit = 'Delete'; // not functional yet

$zero_qty_inactive = false;

 

//**** Size of products_model in products table ****

// set this to the size of your model number field in the db. We check to make sure all models are no longer than this value.

// this prevents the database from getting fubared. Just making this number bigger won't help your database! They must match!

global $modelsize;

$modelsize = 15;

 

//**** Price includes tax? ****

// Set the v_price_with_tax to

// 0 if you want the price without the tax included

// 1 if you want the price to be defined for import & export including tax.

global $price_with_tax;

$price_with_tax =false;

 

// **** Quote -> Escape character conversion ****

// If you have extensive html in your descriptions and it's getting mangled on upload, turn this off

// set to 1 = replace quotes with escape characters

// set to 0 = no quote replacement

global $replace_quotes;

$replace_quotes = true;

 

// **** Field Separator ****

// change this if you can't use the default of tabs

// Tab is the default, comma and semicolon are commonly supported by various progs

// Remember, if your descriptions contain this character, you will confuse EP!

global $separator;

$separator = "\t"; // tab is default

//$separator = ","; // comma

//$separator = ";"; // semi-colon

//$separator = "~"; // tilde

//$separator = "-"; // dash

//$separator = "*"; // splat

 

// **** Max Category Levels ****

// change this if you need more or fewer categories

global $max_categories;

$max_categories = 6; // 7 is default

 

// VJ product attributes begin

// **** Product Attributes ****

// change this to false, if do not want to download product attributes

global $products_with_attributes;

$products_with_attributes = false;

 

// change this if you want to download selected product options

// this might be handy, if you have a lot of product options, and your output file exceeds 256 columns (which is the max. limit MS Excel is able to handle)

global $attribute_options_select;

//$attribute_options_select = array('Size', 'Model'); // uncomment and fill with product options name you wish to download // comment this line, if you wish to download all product options

// VJ product attributes end

 

 

Temp is set as mysite.com/temp and has 777 on

 

When I goto upload the easypopulate file i get the message:

 

File uploaded.

Temporary filename: /tmp/phpOE97Lg

User filename: EP2007Jun20-1806.txt

Size: 1842

 

I am only doing one file for now... jsut to make sure it works... no file uploads to my temp directory, and nothing is added into the DB.

 

If I try to download the file to the temp directory... it says that it goes through, and that it is there.... yet nothing.

 

Any suggestions???

 

Thanks.

 

Mark

Link to comment
Share on other sites

*****EDIT

 

Just for the heck of it, i tried DELETING the temp directory to see what would happen.... and it doesnt even seem to care that it is missing. No error messages or anything..... doesnt that seem a little weird????

 

***** End EDIT

Ok.... Well.... I upgraded to the November 2006 release.... and everything works... so YEA!

 

 

i am running the Extra Fields contribution as well.... is there a way to pull what is in those tables into the easy populate file as well???

 

Thanks.

Link to comment
Share on other sites

I have a question about customizing EP.

 

What do I have to do to add columns to my EP spreadsheet? For example, I have added a contribution for featured products. I would like to be able to include the featured value of a product when I DL my EP file, but that is obviously something EP does not currently do. What is the code that I have to work with to customize?

Link to comment
Share on other sites

Surfalot...

Wanted to ask, I downloaded your latest version and noticed that there are several instructions files. I think two, which one should I use and follow religiously?

I really need for this to work and dont want to mess anything up in my store?

Thanks

Daniel

most of use just feel our way though it. most of the doc files still apply. one item to ignore is the DIR_FS_DOCUMENT_ROOT instructions. If it is setup correctly already, fine.

 

Get good at backing-up and restoring your database AND use a test site if your live site has a lot of traffic. this contrib will do undesired things from time to time. the only way to reverse it is to restore the database. It makes me cringe to hear folks say; I don't want to mess things up. Always backup before every use!!

Link to comment
Share on other sites

ok tried some more and it looks like i'm back to the original issue:

 

 

 

Anyone?

 

I've seen that this could be to do with an auto increment issue with the database? can anyone confirm this and point me in the right direction?

 

Many Thanks

D4

can you post a link to the import file (or at least the first 5 lines).

Link to comment
Share on other sites

Ahh yeah, not only does it not handle importing multi-language cats, it also doesn't handle the single language category import correctly in a multi-language shop. this should fix that up so you can edit them after.

 

find:

 

					$sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
						categories_id,
						language_id,
						categories_name
					) VALUES (
						$max_category_id,
						'$epdlanguage_id',
						'$thiscategoryname'
					)";
				$result = tep_db_query($sql);

 

replace with:

 

		foreach ($langcode as $key => $lang){
	  if ($epdlanguage_id == $lang['id']) {
				$sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
						categories_id,
						language_id,
						categories_name
					) VALUES (
						$max_category_id,
						'$epdlanguage_id',
						'$thiscategoryname'
					)";
		} else {
				$sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
						categories_id,
						language_id,
						categories_name
					) VALUES (
						$max_category_id,
						'".$lang['id']."',
						''
					)";
		}
		tep_db_query($sql);
	}

 

Surfalot.... I hear you are the Man!

 

The problem with multilanguage categories_name has been ignored for many years. I have searched exhaustively every oscommerce forum. An easypopulate contribution to insert multiple languages for the categories_name is absolutely vital for any international (multilanguage) site.

 

Now, the code for the categories_name is already set. All that is needed is to include the code for the language id where appropriate.

 

VJ’s nomenclature for attributes would be ideal: v_attribute_options_name_x_y

(where x = options count, and y = language id)

 

......... categories_name_x_y

 

Probably simple for those who know!

 

I have 15K (masters/slaves) products to upload, 4 levels of categories, 2 languages.

 

Please, do your magic.........

Link to comment
Share on other sites

Surfalot.... I hear you are the Man!

 

The problem with multilanguage categories_name has been ignored for many years. I have searched exhaustively every oscommerce forum. An easypopulate contribution to insert multiple languages for the categories_name is absolutely vital for any international (multilanguage) site.

 

Now, the code for the categories_name is already set. All that is needed is to include the code for the language id where appropriate.

 

VJ’s nomenclature for attributes would be ideal: v_attribute_options_name_x_y

(where x = options count, and y = language id)

 

......... categories_name_x_y

 

Probably simple for those who know!

 

I have 15K (masters/slaves) products to upload, 4 levels of categories, 2 languages.

 

Please, do your magic.........

I wish I had time for that much magic. this may help you.

 

in my ver 2.76d, find this:

 

//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 not happen, just in case... ';
}

 

not sure why it was done this way, but elari decided to make the import language default to the shop's default language instead of the current admin language. If we change this to be the currently viewed language of the admin, then you will have a little control over importing the items that are not fully language compatible yet.

 

this is a little taste of the changes in v2.76e. change the code to this:

 

if (!empty($languages_id) && !empty($language)) {
 $epdlanguage_id   = $languages_id;
 $epdlanguage_name = $language;
} else {
//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 not happen, just in case... ';
}
}

 

If everything works as expected, you should see the current language at the top of the EP page and it should change when you select a different language in the admin.

 

With that change, your entries in the category columns should import to that language. So with this, you should be able to import all the category languages you need. You will just have to import your products once for each category language you have. You can keep a master file with the multiple columns for each category language, but you will need to copy the import file to a new file, then delete the columns for the languages you are not importing at each run.

 

NOTE: The above help is COMPLETELY on-the-fly and may not work as expected. So please BACKUP before you try this. And please report back if it works for you. ;)

 

hope that helps.

Link to comment
Share on other sites

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...