Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

Hello,

 

I have easypopulate 2.76d and it works fine.

 

I have a little problem, that when I upload to update prices, it created to me a new product even that I didn't create a new product ???

 

I try to look for it, to delete it ,and I could't find it !?

 

Any advises where to search and how I solve this issue from coming again ??

 

Thanks for the attention and will be glad to get some help..

 

Regards,

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Hi,

 

I just wonder if anyone who is interested in building an extra field for attribute sort order on EP with Product Attributes Sort Order v1.0. I got to the point where i can get v_attribute_sort after each attribute option

 

e.g. Each attribute option will have - v_value_name, v_attribute_sort

 

I am struggling to get the query right and the inserting the value for the sort order (0,1,2,3,4,5) Below is a code i am still working on, if anyone can give advise on how to correct this or continue with this it would be great. This should be the last part the addon needs to work on, if there's anyone who want the full code to work on just pm me and i will send it to you.

 

 

// Attributes Value Order Sort begin
					  $v_attribute_sort_var = 'v_attribute_sort_' . $attribute_options_count . '_' . $attribute_values_count;

						if (isset($$v_attribute_sort_var) && ($$v_attribute_sort_var != '')) {
							$attribute_sort_query = "select attribute_sort from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id ='" . (int)$$v_attribute_options_id_var . "' and options_values_id = '" . (int)$$v_attribute_values_id_var . "'";

							$attribute_sort_values = tep_db_query($attribute_sort_query);

							// options_values_prices table update begin
							// insert into attribute_sort table if no sort exists
							if (tep_db_num_rows($attribute_sort_values) <= 0) {
								$attribute_sort_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (attribute_sort) values ('" . (int)$v_attribute_sort ."')";

								$attribute_sort_insert = tep_db_query($attribute_sort_insert_query);
							} else { // update options table, if options already exists
								$attribute_sort_update_query = "update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $$v_attribute_values_price_var . "', attribute_sort = '" . $attribute_values_sort_var . "' where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "' and options_values_id ='" . (int)$$v_attribute_values_id_var . "'";

								$attribute_sort_update = tep_db_query($attribute_sort_update_query);
							}
						}
						// Attributes Value Order Sort end

 

 

Regards

kccy

Link to comment
Share on other sites

if you are using one of the versions of EP that I uploaded there is a section of the docs called, how to ask for help. please follow those directions for help on this.

 

 

I have set Excel safe output to false and this solved the problem define ('EP_EXCEL_SAFE_OUTPUT', false); // default is: true

 

 

Thank you a great contribution indeed.

that doesn't help anyone else that may encounter the problem, but still wants excel safe output.

Link to comment
Share on other sites

Still enjoying this add-on. But need some help, ive had a quick look to see if anyone has asked about changing the sequence of the header. Ive decided to have multiple copies of EP running on my site for the multiple csv files i get from my different suppliers as the formats are all different. So if anyone has any ideas a way of going about this, it would be greatly appreciated. Ive tried to use excel and set up afew macros to add and rearrange the required feilds but with csv's with ouver 35,000 products it tends to take a while.

 

Also is there a way to not use the EOREOR as i do not want to have to edit the csv's from my suppliers.

 

Thanks Craig.

 

There shouldn't be any problem with a different order of columns. Removing the EOREOR would require recoding the script. The alternate solutions may cause problems determining the end of row with some formats of text files.

Link to comment
Share on other sites

Is there a way to make all products taxable? I've uploaded over 10K products (that took a while) and none of them were "labelled" as taxable. How can I do this?

first you need to know what the tax class ID is. if it is 1, then you can change every product in the database to taxable with this SQL:

 

UPDATE  products  SET products_tax_class_id  =  '1';

 

please do backup before doing this, even though changing back would be as simple as:

 

UPDATE  products  SET products_tax_class_id  =  '0';

Link to comment
Share on other sites

Hello,

 

I have easypopulate 2.76d and it works fine.

 

I have a little problem, that when I upload to update prices, it created to me a new product even that I didn't create a new product ???

 

I try to look for it, to delete it ,and I could't find it !?

 

Any advises where to search and how I solve this issue from coming again ??

 

Thanks for the attention and will be glad to get some help..

 

Regards,

Nathali

if it is creating a new product, that means EP is not finding the model number in the database. Could mean that the model number for the product you wish to change has a space or other characters you havn't included in the EP update file. Or maybe the EP update file has a space or other odd character in the model number that shouldn't be there.

Link to comment
Share on other sites

if it is creating a new product, that means EP is not finding the model number in the database. Could mean that the model number for the product you wish to change has a space or other characters you havn't included in the EP update file. Or maybe the EP update file has a space or other odd character in the model number that shouldn't be there.

 

Thanks a lot Surfalot for your kind reply !

 

I try to look for it, to delete it ,and I could't find it !?

 

What should I do or how I can find it in the database and delete it ?

 

Thanks,

 

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Thanks a lot Surfalot for your kind reply !

 

I try to look for it, to delete it ,and I could't find it !?

 

What should I do or how I can find it in the database and delete it ?

 

Thanks,

 

Nathali

you didn't make a backup of the database before trying that? Always backup the database before doing thing with EP. And if you follow this help, PLEASE, backup before.

 

I suppose the way I would go about removing a product that doesn't show in the admin or shop is to use phpMyAdmin. It is a database management tool often included/offered by your host.

 

go into the products table, sort by products_model (click the column header) and look for the one you inserted. Write down the products_id it was given.

 

Then you can use the SQL tab in phpMyAdmin to issue these commands (replacing the xxxx with the products_id you found).

 

delete from products where products_id = 'xxxx';
delete from products_description where products_id = 'xxxx';
delete from products_to_categories where products_id = 'xxxx';

Link to comment
Share on other sites

you didn't make a backup of the database before trying that? Always backup the database before doing thing with EP. And if you follow this help, PLEASE, backup before.

 

I suppose the way I would go about removing a product that doesn't show in the admin or shop is to use phpMyAdmin. It is a database management tool often included/offered by your host.

 

go into the products table, sort by products_model (click the column header) and look for the one you inserted. Write down the products_id it was given.

 

Then you can use the SQL tab in phpMyAdmin to issue these commands (replacing the xxxx with the products_id you found).

 

delete from products where products_id = 'xxxx';
delete from products_description where products_id = 'xxxx';
delete from products_to_categories where products_id = 'xxxx';

 

Thanks dear surfalot for your kind & clear instructions !!

 

All the best,

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

I probably shouldn't post this in here but since that surfalot knows alot about this maybe you could help. Ive decided to make my own populate tool due to the fact that i receive many feeds from many suppliers and they are all different.

 

If you could help that would be great i basically would like to know which file in osc creates the categories as i am stuck on the creation of the categories_description.categories_id as it is not auto increment and how to link to the categories table. Or if this code is in the EP tool that i could look at and get a general idea of how to implement it for myself.

 

Thanks Craig

Link to comment
Share on other sites

Nathali

 

This contribution displays products with no category and allows them to be deleted. You can also integrity check your product table on other criteria as well.

 

Database Checking Tool v1.2

 

Very useful when testing and later.

 

Craig

 

Rather than reinvent the wheel, why not reformat your supplier's files into EP format and then import them via EP.

 

There is months of coding that has gone into this contribution which you will have to emulate.

 

One solution would be to download a complete export file using EP and then update the changed field using the information in your supplier's data files, at the same time insert new records for new products and set "missing" products inactive.

 

Then import this new file using EP.

 

(Failing that I'll start a sweepstake on when you get it finished, can I have July 1st.)

:-)

 

By the way Category and Manufacturer creation are in the EP code.

 

Enjoy

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Yeah i did originally reformat my suppliers feed to suit EP but after running macros for over 35,000 products (in just one of the many different feeds) we came to the conclusion to create a different populate tool for each individual feed. As we have the site on a linux box we dont want a separate windows box sitting there being wasted by doing excel/vba macros all day. We decided that that would not be feasible. :)

 

By the way Category and Manufacturer creation are in the EP code.

 

Enjoy

 

G

 

Thanks.

Another question, I'm quite stuck on the categories creation part if anyone could explain to me the process that they are create for example:

 

what order the data is import into the db via the tables. (does it import the data into the tbl.categories the sends the appropriate data to tbl.categories_description then tbl.products_to_categories.)

 

I realise this is alot to ask and much help is appreciated as i am still learning about php. After creating a cms from knowing no php at all, learning all this will help me alot and maybe return the favour to the community. :)

 

Thanks Craig

Link to comment
Share on other sites

I searched for "Database Checking Tool" in the contributions, didn't see it.

 

Sorry, I just copied the screen title from the admin page, actual contribution name is Database Check Tool. I just went to look at it and found I had savaged it nearly a year ago, totally forgotten that.

 

http://addons.oscommerce.com/info/5962

Edited by geoffreywalton

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I am getting this error after just installing "Easypopulate v2.72-MS2"

 

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/catalog/public_html/boostanddestroy.com/admin/easypopulate.php on line 659

 

Has anyone had this problem ?

Edited by boostanddestroy

noob-

Link to comment
Share on other sites

I am getting this error after just installing "Easypopulate v2.72-MS2"

 

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/catalog/public_html/boostanddestroy.com/admin/easypopulate.php on line 659

 

Has anyone had this problem ?

 

I expect that is because your import file has some backslashes or quotes in the data that haven't been correctly escaped. if you follow the output it may show the product it last imported before the error. The next product line would be the problem.

Link to comment
Share on other sites

I expect that is because your import file has some backslashes or quotes in the data that haven't been correctly escaped. if you follow the output it may show the product it last imported before the error. The next product line would be the problem.

 

 

So how do I go about fixing this problem? I am needing to add a couple hundred products very soon.

noob-

Link to comment
Share on other sites

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

 

 

 

Your download link isn't working.

Link to comment
Share on other sites

What is the best and easiest "Easy Populate" version to install

 

if you are not using that 2.72 version because of any special contribution code, then I'm partial to the last version I uploaded which is v2.76g.

 

you shouldn't have your current problem with v2.76g as long as you follow the directions when saving a CSV file from excel or openoffice.

Edited by surfalot
Link to comment
Share on other sites

Your download link isn't working.

 

you do realize you are replying to a post from Nov 7 2003, 09:22 AM. I don't think he is involved any longer. The only relevant stuff in this thread is from (roughly) July 2008 and forward.

Link to comment
Share on other sites

if you are not using that 2.72 version because of any special contribution code, then I'm partial to the last version I uploaded which is v2.76g.

 

you shouldn't have your current problem with v2.76g as long as you follow the directions when saving a CSV file from excel or openoffice.

 

 

Thank you :D.

noob-

Link to comment
Share on other sites

Hi!

I have some problem with EASY POPULATE and PRODUCT EXTRA FIELD.

When I try to update PRODUCT EXTRA FIELD with EASY POPULATE it imports the fields into the PRODUCT EXTRA FIELD table but sets the product id as 0 (zero) on all products and obviously doesn't link it to the necessary products.

 

I have set extra fields to true in the EASY POPULATE file.

 

What can be wrong?

Link to comment
Share on other sites

Need some advice, I am trying to add 10 test products, but whenever I upload them using EP, it seems to add 17 products instead. The 10 test products have attributes and the 3 of them have a comma in the title and description, will this cause problems?, I am using MS Excel 2003. I have created a "complete" template, editted it and then saved it as a ms-dos csv and also as a csv file format, but still it always gives me 17 products.

 

I have also manually added the 10 products into the store, then created the template to compare, its the same, when I upload the manual entered products csv, this then gives me the same 17 products, the out come of the below csv can be seen at my customers website site here: http://www.bytesnkisz.com/index.php

 

Here are my details:

 

CSV File : here

 

EP vers: 2.76g

osCommerce Online Merchant v2.2 RC2a

OS: Linux 2.6.24.7

HTTP: Apache

DB: MySQL 5.0.45-log

PHP: 4.4.7 (Zend: 1.3.0)

 

Temp Directory:

/hermes/web01/b1438/pow.kbleyth/htdocs/temp/

Temp Dir is Writable

Magic Quotes is: off

register_globals is: off

Split files on: 300 records

Model Num Size: 30

Price with tax: false

Calc Precision: 2

Replace quotes: false

Field seperator: comma

Excel safe output: true

Preserve tab/cr/lf: false

Category depth: 3

Enable attributes: true

SEF Froogle URLS: false

More Pics: false

Unknown Pics: false

HTC: false

SPPC: false

Extra Fields: false

Any help is appreciated.

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