Jump to content
VJ

Easy Populate & Products Attributes

Recommended Posts

please try v2.76f. In the future, please include the version you are using, and other details outlined in the docs under the heading How to ask for help.

 

I am using 2.76.

 

I actually have seen that at least some of my data did enter into the database. Two questions. Is it OK to modify the format of the input file as long as I use the headers from the output file that mach the fields I do include.

 

Do I need to pre create in the administration interface the categories and manufacturers I will be entering?

 

Thanks

Share this post


Link to post
Share on other sites
Is it OK to modify the format of the input file as long as I use the headers from the output file that mach the fields I do include.

not sure what you mean by "modify the format". you may rearange the columns as long as the model number is first. you may change the data in any row to suit. do not EVER apply a format to a column with number data.

 

Do I need to pre create in the administration interface the categories and manufacturers I will be entering?

all EP versions I know of (except v2.76e bug) will create any new manufacturer or categories from your import.

Share this post


Link to post
Share on other sites
well easy awnser, MS supports (most) software that i need and "free" doesnt always means better.

 

no i dont multi boot. that is the old way. i use VMWARE right now but there are free of charge alternatives and paid ones for as little as 49,99.

reason i choose for vmware was that i did some work for a compagny and they used vmware. do some work at home and testing and dump the image on a usb stick and i could take it to work. very usefull.

 

does freebsd support multi desktop with password protection ?

 

windows is a nice piece of software that is very forgiving. windows 2000 was the best and it went downhill from there. xp is not great, vista sucks.. but looking at the alternative i stick to windows. "free" is no reason to pick a certain piece of software. i run a business and i can effort 100$ for a piece of software. i run freebsd on my production webserver because linux sucks big time. i ran it for 1 year and i had a kernel hack twice. now i run freebsd/mysql and its stable no problems and no hacks,. great two thumbs up for freebsd.

i will never use MS for a critical part of my business.

 

here is the fun bit, im mcse,mcsa,mcp,mcsdba,mos ai,ccna,ccnp,cca xp. and i will neverl run MS on a critical system like webserver or business server (file,register)

 

We can only hope the utter failure that is Vista is gonna bring Microsoft to their knees. At which point they will hopefully realize what people really want from an OS is not a 'Ferrari exterior' with 2-cylinder riding lawnmower engine under the hood... Stability, performance, and ease (yes I said ease!) of configuration will always pull me in the *nix direction, as I feel these are the attributes that I expect from an operating system. MS fails on stability, performance, and yes even ease... MS only has the edge in 'traditionally used software' compatibility. It may be easier to set up and install for your average user... but lets face it, the average user shouldn't have many reasons to have to completely re-install their OS... I'm looking at you Microsoft!!! My choice has nothing to do with free/not free, as it's not hard to get a hold of a free copy of windows XP... Unfortunately because of their monopolistic tactics of the 90's, (and even today!) everyone needs a copy of ms windows around for one reason or another eventually...

 

Vmware is the PERFECT solution for this as far as I'm concerned ... I make a clean install of windows on the Vmware then I add the programs I need... set a vmware restore point. BOOM! no more reinstalling windows EVER! NO more windows crashing your computer... instead it just crashes the virtual machine! Hell if you are running a dual core processor, Windows can even through your VMware into an infinte loop, and you can still have the other processor's cycles to kill the now looping Vmware process!

 

BTW... I love your idea of dumping the VMware image to a usb drive!

Share this post


Link to post
Share on other sites
move to the newest version please. v2.76f

 

I have updated to v2.76f, and I am still getting the same error.

 

Thanks for the help.

Share this post


Link to post
Share on other sites
I have updated to v2.76f, and I am still getting the same error.

 

Thanks for the help.

do you have any products with attributes (options)? what languages are you using in the shop? what version of osCommerce are you using?

Edited by surfalot

Share this post


Link to post
Share on other sites
do you have any products with attributes (options)? what languages are you using in the shop? what version of osCommerce are you using?

 

I currently do not have any products with attributes, as I am just testing the contribution in my shop in its most basic form at first (just trying to export 4 items). Eventually, I will be adding products with attributes. English is the only language in my shop. I am using osCommerce v2.2 RC1.

 

Thank you

Share this post


Link to post
Share on other sites
I currently do not have any products with attributes, as I am just testing the contribution in my shop in its most basic form at first (just trying to export 4 items). Eventually, I will be adding products with attributes. English is the only language in my shop. I am using osCommerce v2.2 RC1.

 

Thank you

 

try the latest please.

Share this post


Link to post
Share on other sites

Easy Populate 2.76f-MS2 (with attributes) r1 Released !!

 

In this revision:

+ Removed EVEN more globals use. Man I hope that's all of them! >_<

Share this post


Link to post
Share on other sites

Hi. What an excellent version! I downloaded it to use with a client (after reading all the higher-number versions and deciding, 'nah').

 

I'd like to retrofit this to other sites where I already have an older version. Is there anything I need to do other than just replace the version that is there, and add any extra item fields to the code?

Share this post


Link to post
Share on other sites

I am currently using EP_v2_76c_MS2. I am using Excel 2003 I keep trying to include html links to additional images in my description field. When I upload it the images don't show up.

 

Does anyone else do this? Is there a way to have additional images in seperate columns instead of creating html code for each in the description? I haven't found a contrib for this that works with EP.

 

Here's a sample of the code I'm putting in my description column:

 

Style #: 198<br>

Brand: Kids Dream<br>

Description: Sleeveless, satin body, toule overlay, lace pearl and sequin waist<br> Fabric Content: 100% Polyester<br>

Colors: White or Ivory<br>

Price: $55.00<br>

Available Sizes: 6-12m, 12-18m, 18-24m, 1/2, 3/4, 5/6, 7/8, 9/10<br>

Other Images: <br>

<a href=\"images/198..jpg\" target=\"_blank\"><img src=\"images/198..jpg\" alt=\"Click for Larger Image\" width=\"100\" border=\"0\" /></a>

 

And this is what comes back to me when I download the database:

 

Style #: 198<br>

Brand: Kids Dream<br>

Description: Sleeveless, satin body, toule overlay, lace pearl and sequin waist<br>

Fabric Content: 100% Polyester<br>

Colors: White or Ivory<br>

Price: $55.00<br>

Available Sizes: 6-12m, 12-18m, 18-24m, 1/2, 3/4, 5/6, 7/8, 9/10<br>

Other Images: <br>

<a href="images/198..jpg" target="_blank"><img src="images/198..jpg" alt="Click for Larger Image" width=蔴" border=Ŕ" /></a>

 

I tried setting easypopulate.php replace quotes to false and to true neither way seemed to make a difference.

 

I also tried writing the link code without the backslash before each quotation.

Edited by winkblink

Share this post


Link to post
Share on other sites
I've now added an option to download and handle just the product model/attributes. You can download the updated easypopulate.php file, here.

 

The code is almost out of beta stage now, and should be ready to be added in the contribs section, in a few days (just needs a bit more cleaning up and testing).

 

Thanks for all your feedback and comments :).

 

VJ

 

I am probably alittle slow here, so please bare with me. I have a customer that has over 2000 products, really all they would like to accomplish is changing the pricing say every year. Maybe delete or add products occasionally. Will this help them?


Do or Do Not, there is no try.

Share this post


Link to post
Share on other sites
Hi. What an excellent version! I downloaded it to use with a client (after reading all the higher-number versions and deciding, 'nah').

 

I'd like to retrofit this to other sites where I already have an older version. Is there anything I need to do other than just replace the version that is there, and add any extra item fields to the code?

should be able to. the only version that is an exception is one the was a variation to v2.76d that has admin settings. But they can be ignored or removed.

Share this post


Link to post
Share on other sites

I don't know if this is a known issue. But when inserting Manufacturers if there is a ' in the name it errors out

 

 

2090069 | SOSTONOL 6 | Dietary Su | data/67594 | 44.95 | IDS | Anabolic P | Active Updated

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Food Products'' at line 4

 

SELECT man.manufacturers_id FROM manufacturers as man WHERE man.manufacturers_name = 'Chef Jay's Food Products'

split10.csv

 

Is there a method of resolving this issue.

 

A second issue I just found is manufacturers appear to being created multiple times through the import. I am going to do more testing on this issue tomorrow morning but was wondering if anyone has had this.

 

I am using the most recent release of easypopulate

Share this post


Link to post
Share on other sites
I don't know if this is a known issue. But when inserting Manufacturers if there is a ' in the name it errors out

 

 

2090069 | SOSTONOL 6 | Dietary Su | data/67594 | 44.95 | IDS | Anabolic P | Active Updated

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Food Products'' at line 4

 

SELECT man.manufacturers_id FROM manufacturers as man WHERE man.manufacturers_name = 'Chef Jay's Food Products'

split10.csv

 

Is there a method of resolving this issue.

 

A second issue I just found is manufacturers appear to being created multiple times through the import. I am going to do more testing on this issue tomorrow morning but was wondering if anyone has had this.

 

I am using the most recent release of easypopulate

 

find:

 

		$sql = "SELECT man.manufacturers_id
		 FROM ".TABLE_MANUFACTURERS." as man
		 WHERE
			 man.manufacturers_name = '" . $v_manufacturers_name . "'";

 

replace with

 

		$sql = "SELECT man.manufacturers_id
		 FROM ".TABLE_MANUFACTURERS." as man
		 WHERE
			 man.manufacturers_name = '" . tep_db_prepare_input($v_manufacturers_name) . "'";

 

find:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			 manufacturers_id,
			 manufacturers_name,
			 manufacturers_image,
			 date_added,
			 last_modified
			 ) VALUES (
			 $max_mfg_id,
			 '$v_manufacturers_name',
			 '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			 '".date("Y-m-d H:i:s")."',
			 '".date("Y-m-d H:i:s")."'
			 )";

 

replace with:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			 manufacturers_id,
			 manufacturers_name,
			 manufacturers_image,
			 date_added,
			 last_modified
			 ) VALUES (
			 $max_mfg_id,
			 '".tep_db_prepare_input($v_manufacturers_name)."',
			 '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			 '".date("Y-m-d H:i:s")."',
			 '".date("Y-m-d H:i:s")."'
			 )";

 

round about lines: 2190 & 2225

Edited by surfalot

Share this post


Link to post
Share on other sites
find:

 

		$sql = "SELECT man.manufacturers_id
		 FROM ".TABLE_MANUFACTURERS." as man
		 WHERE
			 man.manufacturers_name = '" . $v_manufacturers_name . "'";

 

replace with

 

		$sql = "SELECT man.manufacturers_id
		 FROM ".TABLE_MANUFACTURERS." as man
		 WHERE
			 man.manufacturers_name = '" . tep_db_prepare_input($v_manufacturers_name) . "'";

 

find:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			 manufacturers_id,
			 manufacturers_name,
			 manufacturers_image,
			 date_added,
			 last_modified
			 ) VALUES (
			 $max_mfg_id,
			 '$v_manufacturers_name',
			 '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			 '".date("Y-m-d H:i:s")."',
			 '".date("Y-m-d H:i:s")."'
			 )";

 

replace with:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			 manufacturers_id,
			 manufacturers_name,
			 manufacturers_image,
			 date_added,
			 last_modified
			 ) VALUES (
			 $max_mfg_id,
			 '".tep_db_prepare_input($v_manufacturers_name)."',
			 '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			 '".date("Y-m-d H:i:s")."',
			 '".date("Y-m-d H:i:s")."'
			 )";

 

round about lines: 2190 & 2225

 

Still received the error message on the data input. I also am still getting duplicates on my input data.

 

 

 

SELECT man.manufacturers_id FROM manufacturers as man WHERE man.manufacturers_name = 'Nature's Best Inc.'

Share this post


Link to post
Share on other sites

Hello,

 

I am using the new version 2.76F r1 and it works great with SPPC. I need to add a cost field to Easy Populate, so I tried add products_cost to every spot that products_price was located, but when I down load the file and open, no cost field?? Where did I mis a line?

 

Thanks JR

Share this post


Link to post
Share on other sites
Still received the error message on the data input.

 

SELECT man.manufacturers_id FROM manufacturers as man WHERE man.manufacturers_name = 'Nature's Best Inc.'

 

I guess you are going to need to supply some data then. please PM me a link to the data that is failing.

 

I also am still getting duplicates on my input data.

this doesn't help me locate any problem.

Edited by surfalot

Share this post


Link to post
Share on other sites

OK, I gave you the wrong function. go with this instead if you have quotes in your manufacturer or cateogry data.

looks like the product data is already handled.

 

find:

 

		$sql = "SELECT man.manufacturers_id
		  FROM ".TABLE_MANUFACTURERS." as man
		  WHERE
			  man.manufacturers_name = '" . $v_manufacturers_name . "'";

 

replace with

 

		$sql = "SELECT man.manufacturers_id
		  FROM ".TABLE_MANUFACTURERS." as man
		  WHERE
			  man.manufacturers_name = '" . tep_db_input($v_manufacturers_name) . "'";

 

find:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			  manufacturers_id,
			  manufacturers_name,
			  manufacturers_image,
			  date_added,
			  last_modified
			  ) VALUES (
			  $max_mfg_id,
			  '$v_manufacturers_name',
			  '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			  '".date("Y-m-d H:i:s")."',
			  '".date("Y-m-d H:i:s")."'
			  )";

 

replace with:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			  manufacturers_id,
			  manufacturers_name,
			  manufacturers_image,
			  date_added,
			  last_modified
			  ) VALUES (
			  $max_mfg_id,
			  '".tep_db_input($v_manufacturers_name)."',
			  '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			  '".date("Y-m-d H:i:s")."',
			  '".date("Y-m-d H:i:s")."'
			  )";

 

round about lines: 2190 & 2225

 

and in case you have single quotes in category names:

 

find:

 

				$sql = "SELECT cat.categories_id
				FROM ".TABLE_CATEGORIES." as cat, 
					 ".TABLE_CATEGORIES_DESCRIPTION." as des
				WHERE
					cat.categories_id = des.categories_id AND
					des.language_id = ".EP_DEFAULT_LANGUAGE_ID." AND
					cat.parent_id = " . $theparent_id . " AND
					des.categories_name = '" . $thiscategoryname . "'";

 

 

replace with:

 

				$sql = "SELECT cat.categories_id
				FROM ".TABLE_CATEGORIES." as cat, 
					 ".TABLE_CATEGORIES_DESCRIPTION." as des
				WHERE
					cat.categories_id = des.categories_id AND
					des.language_id = ".EP_DEFAULT_LANGUAGE_ID." AND
					cat.parent_id = " . $theparent_id . " AND
					des.categories_name = '" . tep_db_input($thiscategoryname) . "'";

 

find:

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

 

replace with:

 

							$sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
									categories_id,
									language_id,
									categories_name
								) VALUES (
									$max_category_id,
									'".EP_DEFAULT_LANGUAGE_ID."',
									'".tep_db_input($thiscategoryname)."'
								)";

Share this post


Link to post
Share on other sites

Hello,

 

I am using the new version 2.76F r1 with the last post update and I have three questions.

 

1. Is there anyway you could setup an auto upload to Froogle? (Like a Cron Job)(FTP)

 

2. The images can't have any 's ** Not a big deal but might be something to add

 

3. What about making an option when downloading under custom (categories) Have it download the Sub Name and Description

 

Once again thanks for the great mod

 

Thanks Adam

Share this post


Link to post
Share on other sites
Hello,

 

I am using the new version 2.76F r1 with the last post update and I have three questions.

 

1. Is there anyway you could setup an auto upload to Froogle? (Like a Cron Job)(FTP)

 

2. The images can't have any 's ** Not a big deal but might be something to add

 

3. What about making an option when downloading under custom (categories) Have it download the Sub Name and Description

 

Once again thanks for the great mod

 

Thanks Adam

1. I believe the froogle support is, again, out of date. I plan to retire that functionality since I think its beyond the true scope of this project and there are a couple very good contribs available that does what you want. I think this one has the latest requirements. This one is missing some newer requirements from google.

2. single quotes are not valid in a filename on the net. (not sure if that's what your meant)

3. The custom download with a category filter will download all sub-cats.

Share this post


Link to post
Share on other sites
1. I believe the froogle support is, again, out of date. I plan to retire that functionality since I think its beyond the true scope of this project and there are a couple very good contribs available that does what you want. I think this one has the latest requirements. This one is missing some newer requirements from google.

2. single quotes are not valid in a filename on the net. (not sure if that's what your meant)

3. The custom download with a category filter will download all sub-cats.

 

 

Just as a follow up on 2 and 3....

 

1. This was for any images that have a " ' " like "Children's" it will error out.

 

2. It does the full tree but does not give you the options to add actual * category descriptions / The 2nd name

 

***** Is there a way to have the files delete after complete upload. This should have an on / off button. This would keep the Temp table clean.

 

Adam

Share this post


Link to post
Share on other sites
OK, I gave you the wrong function. go with this instead if you have quotes in your manufacturer or cateogry data.

looks like the product data is already handled.

 

find:

 

		$sql = "SELECT man.manufacturers_id
		  FROM ".TABLE_MANUFACTURERS." as man
		  WHERE
			  man.manufacturers_name = '" . $v_manufacturers_name . "'";

 

replace with

 

		$sql = "SELECT man.manufacturers_id
		  FROM ".TABLE_MANUFACTURERS." as man
		  WHERE
			  man.manufacturers_name = '" . tep_db_input($v_manufacturers_name) . "'";

 

find:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			  manufacturers_id,
			  manufacturers_name,
			  manufacturers_image,
			  date_added,
			  last_modified
			  ) VALUES (
			  $max_mfg_id,
			  '$v_manufacturers_name',
			  '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			  '".date("Y-m-d H:i:s")."',
			  '".date("Y-m-d H:i:s")."'
			  )";

 

replace with:

 

			$sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
			  manufacturers_id,
			  manufacturers_name,
			  manufacturers_image,
			  date_added,
			  last_modified
			  ) VALUES (
			  $max_mfg_id,
			  '".tep_db_input($v_manufacturers_name)."',
			  '".EP_DEFAULT_IMAGE_MANUFACTURER."',
			  '".date("Y-m-d H:i:s")."',
			  '".date("Y-m-d H:i:s")."'
			  )";

 

round about lines: 2190 & 2225

 

and in case you have single quotes in category names:

 

find:

 

				$sql = "SELECT cat.categories_id
				FROM ".TABLE_CATEGORIES." as cat, 
					 ".TABLE_CATEGORIES_DESCRIPTION." as des
				WHERE
					cat.categories_id = des.categories_id AND
					des.language_id = ".EP_DEFAULT_LANGUAGE_ID." AND
					cat.parent_id = " . $theparent_id . " AND
					des.categories_name = '" . $thiscategoryname . "'";

replace with:

 

				$sql = "SELECT cat.categories_id
				FROM ".TABLE_CATEGORIES." as cat, 
					 ".TABLE_CATEGORIES_DESCRIPTION." as des
				WHERE
					cat.categories_id = des.categories_id AND
					des.language_id = ".EP_DEFAULT_LANGUAGE_ID." AND
					cat.parent_id = " . $theparent_id . " AND
					des.categories_name = '" . tep_db_input($thiscategoryname) . "'";

 

find:

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

 

replace with:

 

							$sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
									categories_id,
									language_id,
									categories_name
								) VALUES (
									$max_category_id,
									'".EP_DEFAULT_LANGUAGE_ID."',
									'".tep_db_input($thiscategoryname)."'
								)";

 

Still having the issue I will PM you the data.

 

Thanks for the help. Removing the quotes everything work

Share this post


Link to post
Share on other sites

For anyone getting the "Warning: Invalid argument supplied for foreach..." error, it is due to some missing code in the new version. The error will only show up if the category doesn't already exist. To fix it, find this code in easypopulate.php

	// if the categories names are set then try to update them
if ( isset($v_categories_name_1)){

and add this right below it

		$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... ';
	}		 

	$langcode = ep_get_languages();

Then add the following to the easypopulate_functions.php file right before the last ?>

function ep_get_languages() {
$languages_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " order by sort_order");
// start array at one, the rest of the code expects it that way
$ll =1;
while ($ep_languages = tep_db_fetch_array($languages_query)) {
	//will be used to return language_id en language code to report in product_name_code instead of product_name_id
	$ep_languages_array[$ll++] = array(
				'id' => $ep_languages['languages_id'],
				'code' => $ep_languages['code']
				);
}
return $ep_languages_array;
};

 

Jack

Share this post


Link to post
Share on other sites
For anyone getting the "Warning: Invalid argument supplied for foreach..." error, it is due to some missing code in the new version. The error will only show up if the category doesn't already exist. To fix it, find this code in easypopulate.php
	// if the categories names are set then try to update them
 if ( isset($v_categories_name_1)){

and add this right below it

		$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... ';
	 }		 

	 $langcode = ep_get_languages();

Then add the following to the easypopulate_functions.php file right before the last ?>

function ep_get_languages() {
 $languages_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " order by sort_order");
 // start array at one, the rest of the code expects it that way
 $ll =1;
 while ($ep_languages = tep_db_fetch_array($languages_query)) {
	 //will be used to return language_id en language code to report in product_name_code instead of product_name_id
	 $ep_languages_array[$ll++] = array(
				 'id' => $ep_languages['languages_id'],
				 'code' => $ep_languages['code']
				 );
 }
 return $ep_languages_array;
};

 

Jack

What version is this fixing?

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

×