Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

I am putting it in exactly as the in the same format as what it exports as. It exports from EP as 4/21/2005 0:00 and i use the same format. Even if i change an already good value it doesnt update at all. So the best I can think is that in order to import it has to be changed to that of how mysql sees it (ie 0000-00-00 00:00:00) so it could possibly be Excel that is screwing it up but if i textedit the txt file it comes up like this 4/21/2005 0:00 as well so I am at a loss

Edited by MDXMan
Link to comment
Share on other sites

Its not EP's fault nor is it mine. It turns out that its good old microcrap excel thats modifying the date to something it cant use. I was looking at an already saved file when i said the txt file was the same. Any ideas on how to get around this problem other than manually editing the txt file

Link to comment
Share on other sites

Maybe someone had exactly the same problem like I have ... I'm sorry for not finding it with the forums' search:

 

Well, what I have done:

 

- First I installed EP correctly - it worked fine.

- Then I put in 4 new fields in the product database. OK, not only there ... I don't know whether it's a contrib what I have found or not - but anyway it's a manual how to do that ... and therefore I integrated them correctly I think (also the entries in the easypopulate.php) ... cause

- it worked ... they were also exported out of easypopulate with the TAB deliminated file. I filled them for one item out of about 10 (but it was not the first row!) to test it - it worked.

- Then I added some lower categories in one of my upper categories - and cleared the product database.

- I downloaded the "fresh" TAB del file ... and filled it with some items. After uploading I got the message "No products_model field in record. This line was not imported" ... all items were automatically set to "Inactive" ... and while looking in the DB with phpMyAdmin I saw that the fields from the TXT haven't been in the correct order. For example there was a date in the products_model field and some other things like that ... it seemed like the columsn in the DB had been changed ...

- I tried several things to find the failure myself ... until I reduced the data down to one row with a single item then ... it didn't work any more ...

 

So, do you have any idea what the reason for this problem might be? I would be very happy about your help ... :)

Link to comment
Share on other sites

I hope someone can help with this "project".

 

I have several suppliers for products like harddisk, vga cards etc.

I'd like to make an excel script (for price comparison reason) which can insert prices from an xls file (with 2 columns: v_products_model, v_products_price) into an existing fully formatted EasyPopulate.txt file which already has the current datas from the shop. The new prices should place into a new column (next to the v_products_price column) with the proper order based on model number. And when I execute the script again for the 2nd and 3rd supplier it should insert a 2nd and 3rd column next to the 1st newly inserted price column (ofcourse next to the v_products_price column). The newly created columns will be named as: 1st supplier, 2nd supplier etc.

 

Another function will be good if its possible to implement it:

From these new columns the script will highlight the best price and the suppliers name in each row on 2 separate column after the EOEOR column.

 

Hereby I can easily have the best price automatically by the script.

Its will accelerate my work especially when I have hundreds of products from 4-5 supllier.

 

macro_project.gif

 

 

Correction for the above image: This is how should look the fully formatted EP file after the script was executed and the prices imported into new columns.

 

After this I will overwrite the v_products_price column's values with the best price's values then I will delete all the unnecessary columnes. Upload EP file. Presto! I have hundreds of updated prices in my shop with best prices from various suppliers in minutes.

 

Thats the goal...

 

I can use a hand on this cos I never wrote an excel macro before.

 

If I'm not perfectly clear please let me know, I'll try to explain in other way.

 

Ps.: It could be very handy to all EP users B)

Edited by Andrew J
Link to comment
Share on other sites

you need to read the easypopulate.php file to make the settings necessary for your shop. you will find the setting for inactive. most likely you didnt code your field changes properly is why the other current fields are not showing up.

 

 

Maybe someone had exactly the same problem like I have ... I'm sorry for not finding it with the forums' search:

 

Well, what I have done:

 

- First I installed EP correctly - it worked fine.

- Then I put in 4 new fields in the product database. OK, not only there ... I don't know whether it's a contrib what I have found or not - but anyway it's a manual how to do that ... and therefore I integrated them correctly I think (also the entries in the easypopulate.php) ... cause

- it worked ... they were also exported out of easypopulate with the TAB deliminated file. I filled them for one item out of about 10 (but it was not the first row!) to test it - it worked.

- Then I added some lower categories in one of my upper categories - and cleared the product database.

- I downloaded the "fresh" TAB del file ... and filled it with some items. After uploading I got the message "No products_model field in record. This line was not imported" ... all items were automatically set to "Inactive" ... and while looking in the DB with phpMyAdmin I saw that the fields from the TXT haven't been in the correct order. For example there was a date in the products_model field and some other things like that ... it seemed like the columsn in the DB had been changed ...

- I tried several things to find the failure myself ... until I reduced the data down to one row with a single item then ... it didn't work any more ...

 

So, do you have any idea what the reason for this problem might be? I would be very happy about your help ... :)

Link to comment
Share on other sites

most likely you didnt code your field changes properly is why the other current fields are not showing up.

 

Well - the "problem" ist: it already worked with the fields without any problems! Therefore I now don't understand which effect a simple insert of new lower categories now had ... cause usually this should have NO effect on the database and/or the TXT file ...!? As I wrote the TXT file has indeed no changes in its' structure (after I cleared the database and downloaded a "fresh" one with EP) ... the columns are still in the same order ... I only fill the second categories column now too.

So - where shall I look for if it worked before ...!? (If you want I also can publish my EP file to look at ...)

Edited by s97446
Link to comment
Share on other sites

Hi all,

 

I have installed the latest version of easypopulate. I have also the separate pricing per customer Ver 4.0 contribution. The problem is that whenever I download the EP file containing amongst others the prices for different customer groups, the prices for all the groups except group "0" (Retail) are multiplied by 100.

 

Any ideas ?

 

Thanks in advance

Link to comment
Share on other sites

Well - here some parts of my TXT file and the easypopulate.php:

 

The header of my TXT is looking like that:

 

v_products_model	v_products_image	v_products_name_2	v_products_description_2	v_products_url_2	v_products_name_1	v_products_description_1	v_products_url_1	v_products_price	v_products_weight	v_date_avail	v_date_added	v_products_quantity	v_manufacturers_name	v_categories_name_1	v_categories_name_2	v_categories_name_3	v_tax_class_title	v_status	v_products_art	v_products_nennwert	v_products_adatum	v_products_aort	EOREOR

 

I have 4 new fields: art, nennwert, adatum und aort

 

The table 'products' in my database is looking like that:

?products_id?
?products_quantity?
?products_model?
?products_image?
?products_art?
?products_nennwert?
?products_adatum?
?products_aort?
?products_price?
?products_date_added?
?products_last_modified?
?products_date_available?
?products_weight?
?products_status?
?products_tax_class_id?
?manufacturers_id?
?products_ordered?

 

In easypopulate.php the code around line 1680 looks like:

 

$query = "INSERT INTO ".TABLE_PRODUCTS." (
  	 products_image,
  	 products_art,
  	 products_nennwert,
  	 products_adatum,
  	 products_aort,
  	 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 (
    	 '$v_products_image',";

 

~ line 1720:

 

$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_art',
       '$v_products_nennwert',
       '$v_products_adatum',
       '$v_products_aort',
       '$v_manufacturer_id')
    	 ";

 

~ line 1760:

 

$query .= '", products_weight="'.$v_products_weight .
  	 '", products_tax_class_id="'.$v_tax_class_id . 
  	 '", products_date_available= ' . $v_date_avail .
  	 ', products_date_added= ' . $v_date_added .
  	 ', products_last_modified=CURRENT_TIMESTAMP
  	 , products_quantity="' . $v_products_quantity .
  	 '", products_art="' . $v_products_art .
  	 '", products_nennwert="' . $v_products_nennwert .
  	 '", products_adatum="' . $v_products_adatum .
  	 '", products_aort="' . $v_products_aort .  
  	 '" ,manufacturers_id=' . $v_manufacturer_id . 
  	 ' , products_status=' . $v_db_status . '
  	 WHERE
     (products_id = "'. $v_products_id . '")';

 

It's driving me mad: it worked before - and now it doesn't any more (I know - this is nothing new while working with computers ... :lol: ). I have the following chaotic symptoms in my 'products' table now:

 

products_id wird is set correct automatically ... and products_quantity is 0 (as I wanted this).

 

products_model now is set with the actual TIMESTAMP ... products_art gets the value from TXT.products_model ... products_nennwert the value from TXT.products_price ... products_adatum is set as 1 ... products_aort a TIMESTAMP ... products_price contains 2005 (which is the first part of a TIMESTAMP I guess ...) ... the 3 following datas are all 0:00:00 ...

 

I tlooks like the fields being uploaded in a wrong order ... but why? What did I do wrong while editing the easypopulate.php ...?!? :'(

Link to comment
Share on other sites

if you have products_attributes with your store, then ep already handles them. you just have to turn on that function in ep.

 

what is it you are proposing for it?

 

Hello,

 

I'd been working on getting easypopulate to handle product attribs, and managed to achieve something functional. I haven't tested the code extensively yet, but it should theoretically be capable of handling any number of product options, option values, and languages.

 

This is still beta code, and I haven't put it up as a contribution yet. If anyone is interested in giving this a try (at their own risk!), you can download my easypopulate.php file, and a sample tab-limited file (from an 'out-of-the-box' osc product list), here.

 

Please try this on a test osc setup, before you even think about using it in your "live" store. And in any case, BACKUP your database.

 

This code was developed and tested with EP version '2.62-MS2' on oscommerce 2.2-MS2.

 

Here's an overview of the system. Hope its not confusing as it looks, and  makes some sense :). 

FIELD STRUCTURE

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

 

1. v_attribute_options_id_1
? ? ? ?v_attribute_options_name_1_1
? ? ? ?v_attribute_options_name_1_2
? ? ? ?.
? ? ? ?.
? ? ? ?.
? ? ? ?v_attribute_values_id_1_1
? ? ? ?v_attribute_values_price_1_1
? ? ? ? ? ?v_attribute_values_name_1_1_1
? ? ? ? ? ?v_attribute_values_name_1_1_2
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ?v_attribute_values_id_1_2
? ? ? ?v_attribute_values_price_1_2
? ? ? ? ? ?v_attribute_values_name_1_2_1
? ? ? ? ? ?v_attribute_values_name_1_2_2
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ?.
? ? ? ?.
? ? ? ?.

2. v_attribute_options_id_2
? ? ? ?v_attribute_options_name_2_1
? ? ? ?v_attribute_options_name_2_2
? ? ? ?.
? ? ? ?.
? ? ? ?.
? ? ? ?v_attribute_values_id_2_1
? ? ? ?v_attribute_values_price_2_1
? ? ? ? ? ?v_attribute_values_name_2_1_1
? ? ? ? ? ?v_attribute_values_name_2_1_2
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ?v_attribute_values_id_2_2
? ? ? ?v_attribute_values_price_2_2
? ? ? ? ? ?v_attribute_values_name_2_2_1
? ? ? ? ? ?v_attribute_values_name_2_2_2
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ? ? ?.
? ? ? ?.
? ? ? ?.
? ? ? ?.
.
.
. ? ?	

where, 

1. v_attribute_options_id_x

?x = a count, beginning from 1, and incrementing by 1

This column contains the options ID (each option ID must be unique).
2. v_attribute_options_name_x_y

?x = count (same as above)
?y = count and language id . This means, language id must correspond to the count, begin on 1, and increment by 1. 

For example, 

correct language id structures include, 

?English (ID = 1), German (ID = 2) and Spanish (ID = 3)
?English (ID = 1) and French (ID = 2)

and the system most likely won't work with the following language id structures, 

?English (ID = 2) and German (ID = 3)
?French (ID = 2)
So basically, if you're using 3 languages (say, English, German and French) make sure their language ids begin with 1, and increment by 1, without jumping values. 

This column contains the option name (in each language).


3. v_attribute_values_id_x_y

?x = corresponding option count
?y = option values count, beginning from 1, and incrementing by 1

This column contains the option value ID (each option value ID must be unique).
4. v_attribute_values_price_x_y

?x = corresponding option count
?y = option values count

This column contains the "signed" price. If non-empty, attribute value is added to the product. 
5. v_attribute_values_name_x_y_z

?x = corresponding option count
?y = corresponding option values count
?z = count and language id . This means, language id must correspond to the count, begin on 1, and increment by 1 (please see description for v_attribute_options_name_x_y).

HOW IT WORKS

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

 

Basically, if the field "v_attribute_values_price_x_y" is not empty for a product row, the corresponding attribute is added to that product. Example non-empty values include,

 

0 (zero) = just the attribute is added (there's no special price)

11.50 = attribute is added, with price value 11.50, and price prefix '+'

-9.30 = attribute is added, with price value  9.30, and price prefix '-'

 

You'll also be able to add product options/option values, modify option/option value names.

VJ

Link to comment
Share on other sites

if you have products_attributes with your store, then ep already handles them.  you just have to turn on that function in ep.

 

I guess I don't understand your post correctly :( (Cause I'm either German + sometimes have not thn necessary experience with writing/reading English ... or cause I'm just working with osCommerce just since two weeks now - and some things don't look as familiar to me as they should ... ;) )

 

So ... what I have is a contrib named "AddNewFields" - which I downloaded HERE ...

 

What did you mean with product_attributes? Is this a contribution ...? This HERE ...? :rolleyes:

Link to comment
Share on other sites

hello,

 

i used EP:

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

 

 

When I import the file, and it contains new categories, EP add ist to the tables ?categories? and ?categories_description?, but only in one language. I used two languages, german and English. The std language is german. So EP generate only the german vategories, not the English categories.

 

Do I have to add the English categories manually in the db or is there a bug, or have destroy something??

 

Please help me.

Greets from germany

Link to comment
Share on other sites

Its not EP's fault nor is it mine.  It turns out that its good old microcrap excel thats modifying the date to something it cant use.  I was looking at an already saved file when i said the txt file was the same.  Any ideas on how to get around this problem other than manually editing the txt file

 

 

I saw the same thing, too. It was really messing up my product IDs! What I did:

 

When brining the text file into Excel, the second step (I think) asks you about the field format for the fields. I select TEXT and it leaves the field contents alone rather than converting them. :D

Link to comment
Share on other sites

Something wrong with my host server? um, interesting. but i think there is no other reason maybe.

 

I set my apache server's document root to "E:\MyWesites"  ( I know not 'MyWebsites', just i missing a 'b' when i first configure my host server, but it is the right path, works fine) , and under my server's document root, there are folders like "catalog01", "catalog02", "catalog03", "os_blue_rounded", etc. I installed EP on the catalog01. So, the easypopulate.php says /catalog01/temp/. BTW, there are two var: $tempdir and $tempdir2, I set them all to /catalog01/temp. And in my admin/includes/configure.php, the document root set to "define('DIR_FS_DOCUMENT_ROOT', 'E:/MyWesites/catalog01/');", I think it was right.

 

When I upload EP file, in admin, it says "

File uploaded.

Temporary filename: C:\WINNT\TEMP\php171.tmp

User filename: EP2005Feb24-0909.txt

Size: 24384

"

Then nothing.

 

This, i don't know whether it is right or not.  The problem is, if indeed, there is something wrong on my host server, how can i know what is wrong?

 

As to the date, how can i set the excel to text mode? Every time i opened the file with excel, it automatically change the date field's format before i do ang edit on other field :( .

 

When you import the file, make sure you set the particular field to TEXT. It is the second or third step when importing the text file into Excel.

Link to comment
Share on other sites

if your path in easypopulate.php says /catalog/temp/ and it doesnt work, then something wrong with your host server . ..

or your document root wrong in admin/includes/configure.php.

 

post that here.

 

With the path set as you described above, I could not get the files to populate the tables. I had to set the path in easypopulate.php to:

 

temp/

 

I found this because the error message was showing an error that read, in part:

 

.../catalog/ /catalog/temp/

 

It appears that if you are using the default location for the catalog and temp folders, it was duplicating them. :blink:

Link to comment
Share on other sites

that problem is most liikely caused by your document_root setting in the admin/includes/configure.php file being set incorrectly, it is in the format of /home/user/public_html (depends upon your server) it does not have a trailing slash nor does it contain /catalog/

 

With the path set as you described above, I could not get the files to populate the tables.  I had to set the path in easypopulate.php to:

 

temp/

 

I found this because the error message was showing an error that read, in part:

 

.../catalog/ /catalog/temp/

 

It appears that if you are using the default location for the catalog and temp folders, it was duplicating them. :blink:

Link to comment
Share on other sites

I guess I don't understand your post correctly :( (Cause I'm either German + sometimes have not thn necessary experience with writing/reading English ... or cause I'm just working with osCommerce just since two weeks now - and some things don't look as familiar to me as they should ... ;) )

 

So ... what I have is a contrib named "AddNewFields" - which I downloaded HERE ...

 

What did you mean with product_attributes? Is this a contribution ...? This HERE ...? :rolleyes:

 

In addition to my posting I now found the solution ... well, let's say: VJ found it ;) (... and I have to thank him a lot! :thumbsup:) Well, I will post this here ... maybe someone else will have the same problem with this manual anytime in the future ...

 

OK ... what had to be done?

 

First there had been an entry missing:

 

$default_these = array(
'v_products_image',
#'v_products_mimage',
#'v_products_bimage',
#'v_products_subimage1',
#'v_products_bsubimage1',
#'v_products_subimage2',
#'v_products_bsubimage2',
#'v_products_subimage3',
#'v_products_bsubimage3',
'v_categories_id',
'v_products_price',
'v_products_quantity',
'v_products_weight',
'v_products_art',
'v_products_nennwert',
'v_products_adatum',
'v_products_aort',
'v_date_avail',
'v_instock',
'v_tax_class_title',
'v_manufacturers_name',
'v_manufacturers_id',
'v_products_dim_type',
'v_products_length',
'v_products_width',
'v_products_height'
);

 

This was at the beginning of the file ... around line 200 ...

 

Then another entry had to be done (which was simply missing in the manual) ... it's around line 935:

 

$header_array = array(
?	'v_products_price' ?=> $iii++,
?	'v_products_weight' ?=> $iii++,
?	'v_products_art' => $iii++,
?	'v_products_nennwert' => $iii++,
?	'v_products_adatum' => $iii++,
?	'v_products_aort' => $iii++,
?	'v_date_avail' ?	=> $iii++,
?	'v_date_added' ?	=> $iii++,
?	'v_products_quantity' ?=> $iii++,
?	);

 

Now it works ... :)

Edited by s97446
Link to comment
Share on other sites

Hi,

I have searched the thread for an answer to this but cannot find one. I am using Excel spreadsheet to produce SQL queries for attributes, and to produce easypopulate file for the products. Everything works fine except some products do not show images. The paths are correct, if I swap names around of the images they show up in the correct places with the new image. The admin panel shows 'image does not exist' for these products. If I add them manually then it works. I did upload the easy populate file before the images and I suspect this has caused the problem. However after deleting the products and starting again I still get the same problem. Can anyone help?

Link to comment
Share on other sites

I'm sure somewhere has figured out a way to get easy populate to work with price breaks. Can someone point me to the thread that has directions on how to get it to work.

 

Any help will be greatly rewarded by the karma police :-"

Link to comment
Share on other sites

When i insert EP file into database i get this message

 

 

Filename: EP2005Feb27-1705.txt

| 0-29-522 | painting/s | painting/m | painting/b | | | | | | | | | | | | | HOBBY PAIN | | | ?OPI? KVA | | | 0,603 | 0.00 | 2005-02-21 | 2005-02-21 | 1000 | | Painting / | Brushes | | Taxable Go | Active !New Product!

1136 - Column count doesn't match value count at row 1

 

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, 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 ( 'painting/small/0_29_521.jpg', 'painting/medium/0_29_521.jpg', 'painting/big/0_29_521.jpg', '', '', '', '', '', '', '', '', '', '', '', '', '0-29-522', 'painting/small/0_29_521.jpg', '0-29-522', '0', '1', CURRENT_TIMESTAMP, "2005-02-21", "2005-02-21", '1', '0.00', '1000', 'NULL')

 

[TEP STOP]

 

please help whats wrong in my EP file

Link to comment
Share on other sites

I Have the message above and nothing happens when i use the Easy_populate contribution...

 

Easy Populate 2.74-MS2 - Default Language : portugues(4)

 

File uploaded.

Temporary filename: /tmp/phpLpOzro

User filename: KT_EP_PT.txt

Size: 1128

 

Warning: Illegal offset type in /home/httpd/vhosts/kartunes.online.pt/httpdocs/loja-auto/admin/easypopulate.php on line 698

 

 

 

What could be wrong???? The same code it's working very well on EasyPhp on my machine, but when i publish i can't get Easy_populate working....

 

 

I Appretiate very mutch any sugestion or idea about this problem....

Link to comment
Share on other sites

I think its a problem using EP (I've got 2.74 but tryed all the other version) with PHP 5. It always worked for me but when I tried to upload A EP original File under PHP version 5.03 It only updated 1 product. Is PHP 5 such different as older PHP version?

 

Is there maybe somebody which has changed the original files to work under PHP 5?

 

Sorrie for my bad englisch I'm from the netherlands.

 

greetings

Link to comment
Share on other sites

I Have the message above and nothing happens when i use the Easy_populate contribution...

 

Easy Populate 2.74-MS2 - Default Language : portugues(4)

 

File uploaded.

Temporary filename: /tmp/phpLpOzro

User filename: KT_EP_PT.txt

Size: 1128

 

Warning: Illegal offset type in /home/httpd/vhosts/kartunes.online.pt/httpdocs/loja-auto/admin/easypopulate.php on line 698

What could be wrong???? The same code it's working very well on EasyPhp on my machine, but when i publish i can't get Easy_populate working....

I Appretiate very mutch any sugestion or idea about this problem....

 

 

What it's causing this problem and there is solution to resolve this????

Link to comment
Share on other sites

Resuming....

 

There is any contribution who permit completely populate products, for example

 

Categories ( In Portuguese and English )

and

Categories Images

In my oppinion to be perfect the Easy Populate only need permit create Categories and Subcategories in all stores languages and must permit to set the categories images... Only that it's meassing, i search the web but until now i can's find any EP code to do that.... :'(

 

 

You have your problem resolved??? I'm asking because i have the same problem...

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