Zen Cart Logo
Forums / All Other Contributions/Addons / Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Views: 83,541

Results 221 to 240 of 318
22 Jul 2010, 14:41
#221
shadowcast avatar

shadowcast

Zen Follower

Join Date:
Nov 2009
Posts:
106
Plugin Contributions:
0

Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

hi, is it possible to add images with it? So far i have tried b ut unscuccessful so far :(.
also is it possible to add the order status to it?

07 Sep 2010, 02:33
#222
misticloudz avatar

misticloudz

New Zenner

Join Date:
Oct 2007
Posts:
52
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

this worked SO well for me once I found the table heading I wanted - I was so confused when I couldn't find the zen_products table in my phpmyadmin! but I ended up just looking for it in the products table itself... I guess you have a database prefix?? anyhow, once I figured out that it worked perfectly!

thanks so much!:clap:

07 Sep 2010, 17:47
#223
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

shadowcast:

hi, is it possible to add images with it? So far i have tried b ut unscuccessful so far :(.
also is it possible to add the order status to it?

  1. Images
    The image name in the database is just a REFERENCE (just a LABEL). It is not the actual image file. The image files (jpg, gif, png) are best loaded to your images folder(s) using FTP.

  2. The Order status field is NOT part of the Products table, so cannot be included with Easy Populate, unless you do additional modifications to the easypopulate.php file.

20 Sep 2010, 05:04
#224
hobby_link avatar

hobby_link

New Zenner

Join Date:
Sep 2010
Posts:
5
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Awesome!!!

Thanks Lankeeyankee - worked a treat first go :D

20 Sep 2010, 23:43
#225
hobby_link avatar

hobby_link

New Zenner

Join Date:
Sep 2010
Posts:
5
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

1.3.8a, EP 1.2.5.4

Hi Guys,

Stumbled across a somewhat odd bug. Have added a v_product_length, v_product_width, v_product_height column to my EP csv file as per lankees tutorial. (OzPost module installed).

Everything installed and works fine, no errors. Three new columns populate fine in the database.

HOWEVER, when I click "Download Complete tab-delimited .txt file to edit (Attributes Not Included)" the three new fields are over overwritten by the data in the v_product_weight field.

Example:

Product weight 1.5kg, H = 20cm, W = 18cm, L = 40cm (uploads fine, correct in database)

Run download, fields are overwritten to weight = 1.5kg, H = 1.5, W = 1.5, L = 1.5 in the csv file (but NOT the database)

This creates an issue when I go to load the csv back up to the database as I either need to manually change the H,W,L fields or its overwritten to the weight value when uploaded. Fun.

I did notice this bit of code from the original EP mod. Don't know if this legacy code may be causing an issue?

Line 1272 (or thereabouts):
// PROCESS UPLOAD FILE
//*******************************
//*******************************

// langer - input: $readed
	
// these are the fields that will be defaulted to the current values in the database if they are not found in the incoming file
// langer - why not qry products table and use result array??
$default_these = array(
	'v_products_image',
	// redundant image mods removed
	'v_categories_id',
	'v_products_price',
	'v_products_quantity',
	'v_products_weight',
	'v_date_added',
	'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'
);

Note length, width, height at the end - I didn't copy these in - langer was already playing with them in the original EP mod.

Thoughts anyone?

21 Sep 2010, 01:46
#226
hobby_link avatar

hobby_link

New Zenner

Join Date:
Sep 2010
Posts:
5
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

All good peoples.

Missed a few lines of code when editing the php file - spotted the differences when I compared it to the code lankee put up originally.

Once again - works a treat!

Many thanks!

20 Oct 2010, 20:51
#227
libertyguy avatar

libertyguy

New Zenner

Join Date:
Oct 2009
Posts:
37
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Number of people have asked about this but I haven't seen the solution (if there is one) Adding items when using MSRP

UPDATED! - Model: 1305293 | 1305293.jp | BEEMAN | BEE ADJUST | | | | | 10 | 33 | 1 | | 08/02/10 0 | 0 | BEEMAN | AIRGUNS | AIRSOFT | --none-- | 1 |
ADD NEW PRODUCT FAILED! - Model: 1234567 - SQL error. Check Easy Populate error log in uploads directory

using 5.4 on 3.9g

Thanks
Nick

07 Jan 2011, 03:37
#228
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Hello, I'm using Zen Cart v1.3.9a and Easy Populate v1.2.5.4.

I'm trying to add a column to my database that will come after products_description called products_description_extra, it will be an additional paragraph that comes after my product description (this will make it easier to edit in the future if I want to change this extra description).

This is what I've done:

  1. I added the column products_description_extra to the table products_description, no problem.

  2. I went through easypopulate.php and found all instances of products_description, copied and pasted all the code bits to the next line and changed the instances of products_description to products_description_extra.

  3. I went into Easy Populate in my admin and downloaded the complete tab-delimited .txt file. The downloaded file DOES have the new column called v_products_description_extra_1. All good so far.

  4. I added my extra description paragraph in the new column, saved the file and uploaded it through Easy Populate. There are no error messages, the upload was successful, but my extra description is NOT showing up in my product listings.

Is there something I'm missing? Are there other files I need to change?

Thanks ahead of time!

08 Jan 2011, 00:27
#229
blackorchidcouture avatar

blackorchidcouture

Zen Follower

Join Date:
Apr 2010
Location:
Albuquerque, NM
Posts:
198
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

I dug around the forums more and found info on the .php files I needed to tinker with, and it's working now! I changed the files listed in this tutorial thread: https://www.zen-cart.com/forum/showthread.php?t=57924

I did the same thing to these files as I did to the easypopulate.php, I found all instances of products_description, copied and duplicated the code and changed it to products_description_extra, and it worked, and my listings are now showing the extra description paragraph! :clap:

17 Jan 2011, 06:41
#230
thunder2010 avatar

thunder2010

New Zenner

Join Date:
Aug 2010
Location:
Egypt - USA
Posts:
86
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Hello all,
I have problem and i don't understand why ??
I recheck many many times and i need your help plz

this is what i did to add new properties to general products
( yield , color )

  1. think
    the new properties i want to add to my products are
    ( yield , color )
    .
  2. db manipulation
    open the table "products" in your zencart-database and insert new rows at the end of the table called "products_yield" and "products_color"
    ALTER TABLE products ADD products_yield VARCHAR( 32 ) NOT NULL , ADD products_color VARCHAR( 32 ) NOT NULL;
    .
  3. edit 'collect_info.php' (in /admin/includes/modules/product/)
    1. at the very beginning there is the variable $parameters set. add your row-names to the end:
      'products_yield' => '', 'products_color' => '' );
      .
    2. just below there is the db-query set [$product = $db->Execute("...]
      add your rows with a 'p.' in front (before the "from ..." part)
      select ......., p.products_yield, p.products_color from ....
      .
    3. now you can add the input fields in the product-mask (lets say somewhere around line 450 or so): <tr> <td class="main">Yield</td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_yield', $pInfo->products_yield, zen_set_field_length(TABLE_PRODUCTS, 'products_yield')); ?></td> </tr><tr> <td class="main">Color</td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_color', $pInfo->products_color, zen_set_field_length(TABLE_PRODUCTS, 'products_color')); ?></td> </tr> .
  4. edit 'preview_info.php' (in /admin/includes/modules/product/)
    somewhere around line 10 is the variable $product set. like in step 3.2 add the new rows with a 'p.' in front just before the 'from'
    select ......., p.products_yield, p.products_color from ....
    .
  5. finally, edit 'update_product.php' (in /admin/includes/modules/)
    around line 20 is the $sql_data_array set. add to the last lines before ');' the new row names.
    $sql_data_array = .......... 'products_yield' => zen_db_prepare_input($_POST['products_yield']), 'products_color' => zen_db_prepare_input($_POST['products_color']) );
    .

1- when i go to any product page in the admin aria i found it blank and no thing there ??
2- when i remove step 1 i get the product page on the admin work as normal without any extra fields. So i thing there is some thing wrong on the first step i don't know it.

I hope any one can help me plz to solve this problem that i don't know how to get it work

17 Jan 2011, 07:38
#231
thunder2010 avatar

thunder2010

New Zenner

Join Date:
Aug 2010
Location:
Egypt - USA
Posts:
86
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

sorry for my post
i add it to the wrog threat
i know now why it's not working
coz i forget to add [ , ] before adding the new cods

26 Jan 2011, 16:13
#232
rudolphcorporative1 avatar

rudolphcorporative1

New Zenner

Join Date:
Jan 2011
Posts:
2
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Hi people, first of all I want to thanks everyone here who helped me solve my problem with the EASY POPULATE. What I did, and I hope you guys do before going crazy, take a little time if your easy pop doesn't work and do the following:

1- Download WinMerge, the last update available, this tool will show you which are the differences between two files.
2- Download the attached copy of my easypopulate.php and open it with the program.
3- Open your own copy.
4- Check for the changes in the code, and copy it exactly the way they are to your file.
5- Open EasyPop from your admin panel.
6- Download Complete tab-delimited .txt file to edit
7- Update it
8- Enjoy :clap: :clap: :clap:

I took this idea from "schoolboy", thank you buddy, I just downloaded the copy he provided for other easypop file and checked what was different, replacing the diferences with the new code for my own table. It just worked fine, but the first time I forgot a ' and I had to go back and put it in the correct position.
Note: My easy pop works with .txt, I don't know whether it is going to work for .cvs, I hope it will. Remember to Back Up your files first.

07 Mar 2011, 16:16
#233
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Need a bit of clarification here reguarding the instructions in the first post.

Find the name of the field that you would like to add if you don't already know it. To do this, go to phpMyAdmin, click on the zen_products table, on the Structure tab you will see all of the fields that easy populate is able to use. If you don't use phpMyAdmin you can query the structure of the products table.

#1) I looked at the DB named phpmyadmin and it only contains 8 items. Should I be looking at a different DB?

#2) I downloaded a copy of the mysql DB from my live site and none of the fields start with v_, instead they begin with zc_ but sure seems to be working. What am I not seeing/understandingg here? I thought all of the Easy Populate headings have to start with v_ .

#3) There is not a _products_weight in my DB, so how do I add it?

To help muddy the water a bit more, I'm just trying to add a shipping code to my tab delimited spreadsheet so I can get full use out of my Advanced Shipper Add-on and add multiple shipping rates to my site.

07 Mar 2011, 19:05
#234
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Serious:

Need a bit of clarification here reguarding the instructions in the first post.

#1) I looked at the DB named phpmyadmin and it only contains 8 items. Should I be looking at a different DB?

phpMyAdmin is not a database. It is a TOOL for managing databases. Somewhere on the forum I posted a full list of fields in the products table, and all those in that list can be added to a modified easypopulate.php file, using the techniques described by LankeeYankee "How to add fields to Easy Populate"

Serious:

#2) I downloaded a copy of the mysql DB from my live site and none of the fields start with v_, instead they begin with zc_ but sure seems to be working. What am I not seeing/understandingg here? I thought all of the Easy Populate headings have to start with v_ .

Your TABLES begin with zc_ ... not the FIELDS. The v_ is an Easy Populate identifier... don't worry about it, just follow LankeeYankee's instructions.

Serious:

#3) There is not a _products_weight in my DB, so how do I add it?
I think there is a field by that name...
Serious:

To help muddy the water a bit more, I'm just trying to add a shipping code to my tab delimited spreadsheet so I can get full use out of my Advanced Shipper Add-on and add multiple shipping rates to my site.
The shipping modules write their data to the configuration table, not the products table. You can't use Easy Populate to load shipping rates.

07 Mar 2011, 22:06
#235
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

schoolboy:

phpMyAdmin is not a database. It is a TOOL for managing databases. Somewhere on the forum I posted a full list of fields in the products table, and all those in that list can be added to a modified easypopulate.php file, using the techniques described by LankeeYankee "How to add fields to Easy Populate"

Your TABLES begin with zc_ ... not the FIELDS. The v_ is an Easy Populate identifier... don't worry about it, just follow LankeeYankee's instructions.

I think there is a field by that name...

The shipping modules write their data to the configuration table, not the products table. You can't use Easy Populate to load shipping rates.

I'm not trying to load the rates, just a single character (A, B, C, etc.) that id's the rate for use with Advanced Shipper.

Make sense?

08 Mar 2011, 15:58
#236
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Serious:

I'm not trying to load the rates, just a single character (A, B, C, etc.) that id's the rate for use with Advanced Shipper.

Make sense?

What schoolboy was saying is that EP only works with the products table. You can add a field for your single character in the products table but Advanced Shipper will need to be modified to pull that character from the products table. If it's only for your reference and not for script functionality, just add that field to your products table in the DB and follow my instructions in post 1.

You can run this sql in phpmyadmin to add the field:

ALTER TABLE products ADD advanced_shipper_code CHAR(1) NOT NULL DEFAULT 'A' AFTER products_price;

A couple of things, if you are using prefixes on your tables, which is sounds like from your previous post, then it will be ALTER TABLE zc_products or whatever your prefix is.

You can change the name of the field from advanced_shipper_code to anything you want. This is the name that you will be inserting when you follow my instructions in post 1.

If you are using more than a single character change CHAR(1) to VARCHAR(3) or change 3 to the most characters you will use.

You can change the DEFAULT 'A' to anything that you want to be the default character.

08 Mar 2011, 17:18
#237
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

Thanks Lankeeyankee for helping clarify that issue.

Getting data into a database is relatively straight-forward, as is evidenced by Lankeeyankee's line of SQL.

However - and as Lankeeyankee points out - having data in the database, and making it useful on the website, are two very different things. The data is managed and manipulated by the site's php code - the part that delivers FUNCTIONALITY.

So, if you wanted to get the data in any part of the database to do something useful (other than to just sit there in silence) you need to build php script that enables functionality involving that data.

Just having a new field full of data in the database is no good to you unless you have some php script to "involve" that data in your webshop's functionality.

15 Mar 2011, 22:35
#238
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

From Post #1

After your first 5 alterations (around line 388, 455, 598, 1286, and 1434) you will come to the lines around line 1925. They look different, but still just copy and paste like the other 5 lines.

On around line 1959 copy only this part of the line:'", products_weight="'.zen_db_input($v_products_weight) .

and paste it where you want, changing products_weight and v_products_weight. That is your last alteration. Save the file and upload to the admin folder on your server.

line 456 reads p.products_weight as v_product_shipping_code, No I replace p.products_weight with p.products_shipping_code?

15 Mar 2011, 22:41
#239
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

nevermind....found it.

22 Mar 2011, 18:38
#240
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Here's a quick tutorial on how to add fields to easypopulate v1.2.5.4 or 1.2.5.5

zc v2.39
Just tried to replace v_products_weight with v_products_shipping_code and now I get the following error messgae in MyPHPadmin.

Error
SQL query:

SHOW FULL FIELDS FROM zc_products ;

MySQL said:

#144 - Table './seriouso_zc1/zc_products' is marked as crashed and last (automatic?) repair failedHELP!!!