Jump to content
VJ

Easy Populate & Products Attributes

Recommended Posts

I save from EP, open in notepad and SAVE AS in the encoding ANSI, then I open it in excel so I may read the hebrew, It do not work for some reason the other way

 

Thanks for the replies I've recived, I figure out my probloms:

The following steps needed to be done and it work out fine.

1. Download EP txt file.

2. Open the file and SAVE AS a separate ANSI format

2a. change the data in excel (while closing it answer YES to the questions).

3. Open notepad and SAVE AS again to UTF-8

3a. Here is the bug for some reson the "v_products_model" turned into UTF-8 codes and did not stay in English.

Sincerly and thanks for this great cont.

Shlomo

Share this post


Link to post
Share on other sites
Thanks for the replies I've recived, I figure out my probloms:

The following steps needed to be done and it work out fine.

1. Download EP txt file.

2. Open the file and SAVE AS a separate ANSI format

2a. change the data in excel (while closing it answer YES to the questions).

3. Open notepad and SAVE AS again to UTF-8

3a. Here is the bug for some reson the "v_products_model" turned into UTF-8 codes and did not stay in English.

Sincerly and thanks for this great cont.

Shlomo

interesting, so neither EasyPopulate nor Excel are saving in the char-set you need. I'll put it on the list.

Share this post


Link to post
Share on other sites
I imported my .txt minus the duplicate entries and the attributes.

 

The first import went fine.

 

I then amended the file, deleted some categories, added descriptions etc and when i tried to import to database i recieve the following error:

 

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/20/20389.jpg', '20389', '10.49', '1', CURRENT_TIMESTAMP, "0000-00-00 00:00:00", "0000-00-00 00:00:00", '', '0', '888', 'NULL') 

[TEP STOP]

 

Can anyone (surfalot) suggest what the problem might be here?

I may be going out on a limb here...

it sounds like the insert is failing because key 1 (products_id) is getting the same value for more then one insert. This shouldn't happen if your products table has the products_id as not auto_increment. I'm not sure how that can happen though. the field should have been setup with auto_increment. Export your products table structure and post please (phpMyAdmin).

 

is the product you are showing the second one in your import file?

I don't see the descriptions you say you entered in the error message.

Edited by surfalot

Share this post


Link to post
Share on other sites
interesting, so neither EasyPopulate nor Excel are saving in the char-set you need. I'll put it on the list.

 

<?
$str = "שלום";
echo $str."<BR>";
$str = mb_convert_encoding($str, "UTF-8", "ISO-8859-8");
echo $str."<BR>";
?>

 

You should see latin latters or hebrew in $str. the charest in windows-1255 or ISO-8859-9 to the begining and the code traslate to UTF-8.

 

The string in hebrew is SHALOM, I wrote one a MySql PHP site in UTF-8,

I know it works fine on < PHP 4. I have hard time to understand, and I am very busy, so I don't have real time to go over the code. maybe the following weekend when my project is over.

The only probloms with mb_convert us far I know it must be done in the headers or it BBUUGG out.

sincerly,

Shlomo

my site that needs about 7-9K products to be addes is http://www.jewish-shop.net

Share this post


Link to post
Share on other sites
interesting, so neither EasyPopulate nor Excel are saving in the char-set you need. I'll put it on the list.

 

<?
$str = "שלום";
echo $str."<BR>";
$str = mb_convert_encoding($str, "UTF-8", "ISO-8859-8");
echo $str."<BR>";
?>

 

You should see latin latters or hebrew in $str. the charest in windows-1255 or ISO-8859-9 to the begining and the code traslate to UTF-8.

 

The string in hebrew is SHALOM, I wrote one a MySql PHP site in UTF-8,

I know it works fine on < PHP 4. I have hard time to understand, and I am very busy, so I don't have real time to go over the code. maybe the following weekend when my project is over.

The only probloms with mb_convert us far I know it must be done in the headers or it BBUUGG out.

sincerly,

Shlomo

P.S.

I forgot to add I am useing Microsoft windows XP home enable edition (Hebrew enable edition, means my Start menu is in Hebrew.....)

my site that needs about 7-9K products to be addes is http://www.jewish-shop.net

Share this post


Link to post
Share on other sites
I may be going out on a limb here...

it sounds like the insert is failing because key 1 (products_id) is getting the same value for more then one insert. This shouldn't happen if your products table has the products_id as not auto_increment. I'm not sure how that can happen though. the field should have been setup with auto_increment. Export your products table structure and post please (phpMyAdmin).

 

is the product you are showing the second one in your import file?

I don't see the descriptions you say you entered in the error message.

 

My products table is quite large with over 3000 products so i've just included the info up to where the products begin, please let me know if you need more.

 

The particular file I was uploading was just an update file (200 products or so) and not the full database of products.

 

It did update the first 7 products and delivered the error before the 8th.

 

Anyways, please let me know if you require any further information.

 

-- phpMyAdmin SQL Dump
-- version 2.6.4-pl3
-- http://www.phpmyadmin.net
-- 
-- Host: db837.oneandone.co.uk
-- Generation Time: Mar 07, 2007 at 01:07 AM
-- Server version: 4.0.27
-- PHP Version: 4.3.10-200.schlund.1
-- 
-- Database: `db198681683`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `products`
-- 

CREATE TABLE `products` (
 `products_id` int(11) NOT NULL default '0',
 `products_quantity` int(4) NOT NULL default '0',
 `products_model` varchar(12) default NULL,
 `Featured_product` int(4) NOT NULL default '0',
 `products_image` varchar(64) default NULL,
 `products_msrp` decimal(15,4) NOT NULL default '0.0000',
 `products_price` decimal(15,4) NOT NULL default '0.0000',
 `products_date_added` datetime NOT NULL default '0000-00-00 00:00:00',
 `products_last_modified` datetime default NULL,
 `products_date_available` datetime default NULL,
 `products_featured_until` date default NULL,
 `products_weight` decimal(5,2) NOT NULL default '0.00',
 `products_status` tinyint(1) NOT NULL default '0',
 `products_featured` tinyint(1) default '0',
 `products_tax_class_id` int(11) NOT NULL default '0',
 `manufacturers_id` int(11) default NULL,
 `products_ordered` int(11) NOT NULL default '0',
 PRIMARY KEY  (`products_id`),
 KEY `idx_products_date_added` (`products_date_added`),
 KEY `idx_products_model` (`products_model`)
) TYPE=MyISAM;

-- 
-- Dumping data for table `products`
--

 

Many Thanks

D4

Share this post


Link to post
Share on other sites

Hi Everyone,

I've worked with EP and have had success using it to populate OSC carts with products not requiring many attributes. Now I have a dataset with over 25K items, which have a palette of over 1200 colors, 10 sizes and 4 packaging units. I'm having trouble understanding how EP might handle this attribute list. If I'm correct an EP excel file to populate this database would be thousands of columns wide, is this correct?? or am I missing something. I'm looking for guidance on how to approach this population for the database. Many Thanks in Advance.

Cheers

JK

Share this post


Link to post
Share on other sites

Was hoping that someone would be able to help. I have installed ep and that went well. Fixed an error with my host and now when I upload my data, I get this error.

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

 

Filename: ep1.txt

 

Warning: file(DIR_FS_DOCUMENT_ROOT/home/halg127/public_html/ediscount-sales/admin/temp/ep1.txt) [function.file]: failed to open stream: No such file or directory in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 685

 

Warning: Invalid argument supplied for foreach() in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 690

 

Any help would be great! I do not know much about code or php.....

 

Thanks in advance.

Kevin

Share this post


Link to post
Share on other sites

Hi,

 

I was hoping to get some help with using a couple of new fields with Easy Populate (also with using a field from MVS (vendors_id), but let's take one thing at a time).

 

With the original un-modded EP 2.76d-MS2 (with attributes) by Surfalot: I tested exporting my test-product, changed the Model and Name of it to insert another product, everything worked just fine.

 

With the modded EP (after I inserted two new fields, products_briefdesc and products_condition): I can export the products just fine by using "Download Complete .txt file to edit", the file also includes the two new fields with information. However, when I try to import products, the values get inserted into the wrong fields!

 

I have been looking over the easypopulate.php file all day, but I am no EP expert, and I am getting rather desperate about this. So I was wondering if I could kindly get any help here?

 

Here is a link to the Modded Easy Populate that I am using at the moment.

Share this post


Link to post
Share on other sites

Hey guys, love the contribution, but I am frustrated by it right now.

 

I installed a clean install on a new site I have uploaded a file, but the page does not change, and no error messages. But none of the information is in my db!

If I download a file, all of the information I uploaded is in the txt file, but not on the site. I do not know what I am doing wrong. I set the document root to: $tempdir = DIR_FS_DOCUMENT_ROOT . "/home/facphoto/public_html/shop/temp/"; I also tried /shop/temp/ but same issue. I know I am doing something really stupid, but do not know what.

 

Any suggestions?


Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Share this post


Link to post
Share on other sites
Hey guys, love the contribution, but I am frustrated by it right now.

 

I installed a clean install on a new site I have uploaded a file, but the page does not change, and no error messages. But none of the information is in my db!

If I download a file, all of the information I uploaded is in the txt file, but not on the site. I do not know what I am doing wrong. I set the document root to: $tempdir = DIR_FS_DOCUMENT_ROOT . "/home/facphoto/public_html/shop/temp/"; I also tried /shop/temp/ but same issue. I know I am doing something really stupid, but do not know what.

 

Any suggestions?

 

In further testing I cannot create a complete file from the admin panel, but any of the smaller ones are not an issue. They all go to temp. It is a complete upload that is not working. Even if I put the file into the temp folder, it just will not work.


Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Share this post


Link to post
Share on other sites
My products table is quite large with over 3000 products so i've just included the info up to where the products begin, please let me know if you need more.

 

The particular file I was uploading was just an update file (200 products or so) and not the full database of products.

 

It did update the first 7 products and delivered the error before the 8th.

 

Anyways, please let me know if you require any further information.

 

-- phpMyAdmin SQL Dump
-- version 2.6.4-pl3
-- http://www.phpmyadmin.net
-- 
-- Host: db837.oneandone.co.uk
-- Generation Time: Mar 07, 2007 at 01:07 AM
-- Server version: 4.0.27
-- PHP Version: 4.3.10-200.schlund.1
-- 
-- Database: `db198681683`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `products`
-- 

CREATE TABLE `products` (
 `products_id` int(11) NOT NULL default '0',
 `products_quantity` int(4) NOT NULL default '0',
 `products_model` varchar(12) default NULL,
 `Featured_product` int(4) NOT NULL default '0',
 `products_image` varchar(64) default NULL,
 `products_msrp` decimal(15,4) NOT NULL default '0.0000',
 `products_price` decimal(15,4) NOT NULL default '0.0000',
 `products_date_added` datetime NOT NULL default '0000-00-00 00:00:00',
 `products_last_modified` datetime default NULL,
 `products_date_available` datetime default NULL,
 `products_featured_until` date default NULL,
 `products_weight` decimal(5,2) NOT NULL default '0.00',
 `products_status` tinyint(1) NOT NULL default '0',
 `products_featured` tinyint(1) default '0',
 `products_tax_class_id` int(11) NOT NULL default '0',
 `manufacturers_id` int(11) default NULL,
 `products_ordered` int(11) NOT NULL default '0',
 PRIMARY KEY  (`products_id`),
 KEY `idx_products_date_added` (`products_date_added`),
 KEY `idx_products_model` (`products_model`)
) TYPE=MyISAM;

-- 
-- Dumping data for table `products`
--

 

Many Thanks

D4

yep, for sure, that is your problem. you need to add the auto_increment to the products_id field of that table. if you have phpMyAdmin, just edit the field and select it under the Extra label

Share this post


Link to post
Share on other sites
Hi Everyone,

I've worked with EP and have had success using it to populate OSC carts with products not requiring many attributes. Now I have a dataset with over 25K items, which have a palette of over 1200 colors, 10 sizes and 4 packaging units. I'm having trouble understanding how EP might handle this attribute list. If I'm correct an EP excel file to populate this database would be thousands of columns wide, is this correct?? or am I missing something. I'm looking for guidance on how to approach this population for the database. Many Thanks in Advance.

Cheers

JK

Umm, yeah. that's a problem. If this is something that must be done with attributes included, and edited through excel, I'd say EP wouldn't do the trick. excel only handles 256 columns. If you remove excel from the equation, EP probably would parse smaller groups of it. That might be something that requires a custom solution with careful forethought.

Share this post


Link to post
Share on other sites
Was hoping that someone would be able to help. I have installed ep and that went well. Fixed an error with my host and now when I upload my data, I get this error.

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

 

Filename: ep1.txt

 

Warning: file(DIR_FS_DOCUMENT_ROOT/home/halg127/public_html/ediscount-sales/admin/temp/ep1.txt) [function.file]: failed to open stream: No such file or directory in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 685

 

Warning: Invalid argument supplied for foreach() in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 690

 

Any help would be great! I do not know much about code or php.....

 

Thanks in advance.

Kevin

DIR_FS_DOCUMENT_ROOT is set wrong in your catalog/admin/includes/configure.php.

should look like this.

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

and you possibly have the temp folder name wrong in your easypopulate.php. if this is the actuall path to your temp location:

/home/halg127/public_html/ediscount-sales/admin/temp/ep1.txt

The you can make the temp path setting in EP "/temp/"

Share this post


Link to post
Share on other sites
In further testing I cannot create a complete file from the admin panel, but any of the smaller ones are not an issue. They all go to temp. It is a complete upload that is not working. Even if I put the file into the temp folder, it just will not work.

need more information. how large it the file you are uploading (MB/products)? have you tried just a few products? PHP ver? PHP globals (on/off)? MySQL ver?

Share this post


Link to post
Share on other sites
Hi,

 

I was hoping to get some help with using a couple of new fields with Easy Populate (also with using a field from MVS (vendors_id), but let's take one thing at a time).

 

With the original un-modded EP 2.76d-MS2 (with attributes) by Surfalot: I tested exporting my test-product, changed the Model and Name of it to insert another product, everything worked just fine.

 

With the modded EP (after I inserted two new fields, products_briefdesc and products_condition): I can export the products just fine by using "Download Complete .txt file to edit", the file also includes the two new fields with information. However, when I try to import products, the values get inserted into the wrong fields!

 

I have been looking over the easypopulate.php file all day, but I am no EP expert, and I am getting rather desperate about this. So I was wondering if I could kindly get any help here?

 

Here is a link to the Modded Easy Populate that I am using at the moment.

Well, I said I wouldn't help with contrib integration, but you came close and I admire the do-it-yourself attitude.

your problem is here. when you craft a SQL insert INSERT INTO () VALUES (), the fields on the front side of the insert must match exactly in position and number with the back side of the statement. So you added products_briefdesc & products_condition to the very beginning of the field list on the front side (that is, before the image and model fields). But on the back side you added the fields between quantity and manufacturer id fields. If you clear out the "image mods" code comments it might be easier to see. So you need to move '$v_products_briefdesc', & '$v_products_condition', up above the image and model vars.

			$query = "INSERT INTO ".TABLE_PRODUCTS." (
				products_briefdesc,
				products_condition,
				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 (

                                                       // <-- move '$v_products_briefdesc', & '$v_products_condition', here

						'$v_products_image',";

		// unmcomment these lines if you are running the image mods
		/*
			$query .=		. $v_products_mimage . '", "'
						. $v_products_bimage . '", "'
						. $v_products_subimage1 . '", "'
						. $v_products_bsubimage1 . '", "'
						. $v_products_subimage2 . '", "'
						. $v_products_bsubimage2 . '", "'
						. $v_products_subimage3 . '", "'
						. $v_products_bsubimage3 . '", "'
		*/

		$query .="				'$v_products_model',
							'$v_products_price',
							'$v_db_status',
							CURRENT_TIMESTAMP,
							$v_date_added,
							$v_date_avail,
							'$v_tax_class_id',
							'$v_products_weight',
							'$v_products_quantity',
							'$v_products_briefdesc',
							'$v_products_condition',
							'$v_manufacturer_id')
						";

Edited by surfalot

Share this post


Link to post
Share on other sites
DIR_FS_DOCUMENT_ROOT is set wrong in your catalog/admin/includes/configure.php.

should look like this.

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

and you possibly have the temp folder name wrong in your easypopulate.php. if this is the actuall path to your temp location:

/home/halg127/public_html/ediscount-sales/admin/temp/ep1.txt

The you can make the temp path setting in EP "/temp/"

 

Thanks for the reply! I made the changes you mention and now when I try to upload I get this set of errors.

 

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

 

Warning: move_uploaded_file(/home/halg127/public_html/ediscount-sales/temp/ep1.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/halg127/public_html/ediscount-sales/admin/easypopulate_functions.php on line 32

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php8hXvrq' to '/home/halg127/public_html/ediscount-sales/temp/ep1.txt' in /home/halg127/public_html/ediscount-sales/admin/easypopulate_functions.php on line 32

 

File uploaded.

Temporary filename: /tmp/php8hXvrq

User filename: ep1.txt

Size: 23396

 

Warning: file(/home/halg127/public_html/ediscount-sales/temp/ep1.txt) [function.file]: failed to open stream: No such file or directory in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 667

 

Warning: Invalid argument supplied for foreach() in /home/halg127/public_html/ediscount-sales/admin/easypopulate.php on line 690

 

Again thanks in advance for the help.

Kevin

Share this post


Link to post
Share on other sites

i guess my question was too moronic, so it was ignored. I am becoming suicidal over this though.

 

I CANNOT UPLOAD A FILE SUCCESSFULLY!

 

I have checked the setting fr TEMP, reinstalled like 5 times, and nothing. I can download a complete file to my desktop, But if I mod anything on it - nothing

I can create partial files and send to temp, but complete only works every now and then. Sometimes the alert flashes telling me the file is in /home/facphoto/public_html/shop/temp/FILENAME.csv but I can not find through ftp. I really need this to work any ideas??

 

You help would be appreciated.

 

The site

 

 

Jeff


Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Share this post


Link to post
Share on other sites
i guess my question was too moronic, so it was ignored. I am becoming suicidal over this though.

 

I CANNOT UPLOAD A FILE SUCCESSFULLY!

 

I have checked the setting fr TEMP, reinstalled like 5 times, and nothing. I can download a complete file to my desktop, But if I mod anything on it - nothing

I can create partial files and send to temp, but complete only works every now and then. Sometimes the alert flashes telling me the file is in /home/facphoto/public_html/shop/temp/FILENAME.csv but I can not find through ftp. I really need this to work any ideas??

 

Your help would be appreciated.

 

The site

Jeff

 

Guys I would really appreciate some help. Here is more info:

Easy Populate 2.76d-MS2

Server OS: Linux 2.6.19-1_3.BHsmp

Database: MySQL 4.1.21-standard-log

HTTP Server: Apache/1.3.37 (Unix) mod

PHP-CGI/0.1b

PHP Version: 4.4.4 (Zend: 1.3.0)

 

Globals Off


Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Share this post


Link to post
Share on other sites
Thanks for the reply! I made the changes you mention and now when I try to upload I get this set of errors.

 

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

 

Warning: move_uploaded_file(/home/halg127/public_html/ediscount-sales/temp/ep1.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/halg127/public_html/ediscount-sales/admin/easypopulate_functions.php on line 32

 

Again thanks in advance for the help.

Kevin

is this where your temp folder is?

/home/halg127/public_html/ediscount-sales/temp/

if not make that folder and assign it the permissions required. Or adjust your temp folder setting in EP until it reflects the actuall path to your temp folder.

If you need help determining you path, creating a folder or setting permissions, talk with your host.

Share this post


Link to post
Share on other sites
Guys I would really appreciate some help. Here is more info:

Easy Populate 2.76d-MS2

Server OS: Linux 2.6.19-1_3.BHsmp

Database: MySQL 4.1.21-standard-log

HTTP Server: Apache/1.3.37 (Unix) mod

PHP-CGI/0.1b

PHP Version: 4.4.4 (Zend: 1.3.0)

 

Globals Off

so you're saying it works with partial files. then you need to split it and upload portions. PHP scripts are limited in time. You may be able to over-ride the time limit your host sets. Look at the settings in EP for a function that sets the time limit. If that doesn't work, look at doing it with a PHP.INI file in your host space. (talk to your host)

 

And BTW, with globals off, this script should not work at all. It is not updated for that issue. You can try to over-ride that setting with a PHP.INI in your host space. (ask your host)

Share this post


Link to post
Share on other sites
is this where your temp folder is?

/home/halg127/public_html/ediscount-sales/temp/

if not make that folder and assign it the permissions required. Or adjust your temp folder setting in EP until it reflects the actuall path to your temp folder.

If you need help determining you path, creating a folder or setting permissions, talk with your host.

 

 

It works now. I had the temp folder in /admin.....thats all it was.

Thank you very much, my life will be much easier now

Kevin

Share this post


Link to post
Share on other sites
Well, I said I wouldn't help with contrib integration, but you came close and I admire the do-it-yourself attitude.

your problem is here. when you craft a SQL insert INSERT INTO () VALUES (), the fields on the front side of the insert must match exactly in position and number with the back side of the statement. So you added products_briefdesc & products_condition to the very beginning of the field list on the front side (that is, before the image and model fields). But on the back side you added the fields between quantity and manufacturer id fields. If you clear out the "image mods" code comments it might be easier to see. So you need to move '$v_products_briefdesc', & '$v_products_condition', up above the image and model vars.

Thank you very much for the tip surfalot, it works like a charm now. Sometimes it can be very hard to find a small clerical error amongst so much code. ;)

Share this post


Link to post
Share on other sites

Thank you for the response. I am working on a new host and they have a server based setting for the globals, I am not used to that. I installed a php.ini and that now allows it to work perfectly.

 

I would like to know if anyone know how to make this work with Attribute Sets.


Jeff

 

Contributions I use: DynaMenus - Light Box - Best Sellers Content Box - Related Products 3.2 - UPS XML - Secure Admin Login - Vendor Locator - Graphical Borders.

Share this post


Link to post
Share on other sites
Thank you for the response. I am working on a new host and they have a server based setting for the globals, I am not used to that. I installed a php.ini and that now allows it to work perfectly.

 

I would like to know if anyone know how to make this work with Attribute Sets.

what is not working with the attribute sets? (EP v2.76d) or just too hard to understand the spreadsheet?

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

×