Page 1 of 32 12311 ... LastLast
Results 1 to 10 of 317
  1. #1
    Join Date
    Jan 2007
    Posts
    1,396
    Plugin Contributions
    10

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

    Warning: The supplied file is for showing examples only, do not use it in your store since it will cause errors if you don't have all of the add-on mods installed that this file includes. Make the changes shown here in your copy of easypopulate.php!

    This is how you do it for easy populate v1.2.5.4 or 1.2.5.5, it's similar for other versions but there might be more or fewer additions of fields as described below.

    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.

    Now that you know what field names you need, open your copy of admin/easypoplulate.php in a text editor and search for v_products_weight. It will appear 7 times throughout this file. It's part of an array of fields that will be used, you can see that all of the one starting with v_ are in the database table zen_products.

    The order of the fields in that array correspond to where in the csv file the field will appear. So copy the entire line including v_products_weight and paste it where you want in the array. Make sure you copy everything, if you forget a comma you'll cause an error. Replace v_products_weight to v_yourfield (the field name using underscores instead of spaces), as well as p.products_weight to p.yourfield when it's in the line(3 of the 7 lines).

    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.

    Navigate to easy populate in the tools drop down in the admin panel. Download a complete tab-delimited file and open in your spreadsheet app to see the new fields that you added.

    You'll notice that I have added map_enabled to the included file. In the product creation page in the admin this is a radio button, so you can check boxes and select radio buttons, 0 is off and 1 is on.

    The mods that are used in the included file are msrp, map price, auction sites attributes (ASA), and dual pricing.

    The version that the included admin/easypopulate file is from is 1.2.5.4
    Attached Files Attached Files
    Last edited by lankeeyankee; 21 Dec 2008 at 07:36 AM.

    Zen Cart and it's community are the best!!

  2. #2
    Join Date
    Dec 2008
    Posts
    11
    Plugin Contributions
    0

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

    Hi,

    Getting the below when trying to import after modifying the various lines per your instruction. The first record will update correctly but the others will not (the subsequent records were new items). I have triple checked the mods and they are correct. Downloading the file gives me the correct columns I want.
    They are "products_sort_order" and "default_subcontractor" (from another mod). Tried it also with just "products_sort_order"
    and same problem. Below is the error log.

    Thanks for any help!

    Art

    MySQL error 1136: Column count doesn't match value count at row 1
    When executing:
    INSERT INTO zen_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 (
    'no_picture.gif','3R1919-14B-CW',
    '349.99',
    '1',
    CURRENT_TIMESTAMP,
    "2009-01-09 13:59",
    NULL,
    '1',
    '28',
    '20',
    '',
    '0',
    '13')

  3. #3
    Join Date
    Dec 2008
    Posts
    11
    Plugin Contributions
    0

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

    One more thing: This is the message after trying to update:

    UPDATED! - Model: 3R1919-14B-EW | | Roto Mil-S | Empty - Pu | | | | | 279.99 | 23 | 10 | | | 1/9/2009 1 | 0 | SKB | Shockmount | SKB - Mil | Roto Cases | 3R Series | | | | Taxable Go | 1 |
    ADD NEW PRODUCT FAILED! - Model: 3R1919-14B-CW - SQL error. Check Easy Populate error log in uploads directory
    ADD NEW PRODUCT FAILED! - Model: 3R2216-15B-E - SQL error. Check Easy Populate error log in uploads directory
    ADD NEW PRODUCT FAILED! - Model: 3R2217-10B-EW - SQL error. Check Easy Populate error log in uploads directory

    Thanks again.

    Art

  4. #4
    Join Date
    Jan 2007
    Posts
    1,396
    Plugin Contributions
    10

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

    Art,

    It looks like, in your first post, that there are more VALUES being added than there are rows in the table, thus the error message you received:

    MySQL error 1136: Column count doesn't match value count

    In your second post, it looks like you don't have EOREOR at the end of your row which is why the only one added is the first record, or since the column count and value count don't match it is throwing it off.

    This often happens with a quote ending up throwing things off. If you look at the VALUES you were trying to insert you will see after the weight and quantity values there is a '', followed by '0', '13'. I'd look at the spreadsheet file to make sure all values are in their correct columns and that you have EOREOR at the end of each row.

    Please let me know if you are still having trouble. You can post your spreadsheet file and your easypopulate file so I can see what's going on.

    Zen Cart and it's community are the best!!

  5. #5
    Join Date
    Dec 2008
    Posts
    11
    Plugin Contributions
    0

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

    Thanks for the reply lankeeyankee. Everything imports correctly if the product already exists. It only throws the error if it is a new product in the import file. I can take an existing product code that imports properly, change it by one character and when I try to import it again it throws that error.

    Thanks for the help!

    Art

  6. #6
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    386
    Plugin Contributions
    0

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

    I assume this would work for adding meta tags for products?

  7. #7
    Join Date
    Jan 2007
    Posts
    1,396
    Plugin Contributions
    10

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

    Quote Originally Posted by swamyg1 View Post
    I assume this would work for adding meta tags for products?
    most likely, yes. but I haven't tried it so I can't say for sure. You might have to insert new db queries for other db tables, but again I'm not sure. sorry that I can't help further!

    Zen Cart and it's community are the best!!

  8. #8
    Join Date
    Jan 2007
    Posts
    1,396
    Plugin Contributions
    10

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

    Quote Originally Posted by artmuns View Post
    Thanks for the reply lankeeyankee. Everything imports correctly if the product already exists. It only throws the error if it is a new product in the import file. I can take an existing product code that imports properly, change it by one character and when I try to import it again it throws that error.

    Thanks for the help!

    Art
    was this working correctly with the default EP install? Or just since you made the changes that I outlined?

    Zen Cart and it's community are the best!!

  9. #9
    Join Date
    Jan 2009
    Posts
    31
    Plugin Contributions
    1

    Default Easy Populate support for Version 1.2.5.5.csv

    Just putting this here in case it's needed. I uploaded EP 1.2.5.5.csv to the Zen Cart Add-on section. Most everything is the same as the 1.2.5.4 version. If something isn't working right with the CSV's I'll try to help.

    The CSV's created with this version will NOT work with the older versions. Just make sure your products are updated before upgrading. Then download a new backup.

    Yes it works with 1.3.8, so did the 1.2.5.4 version.

    I changed the temp directory to tempEP from temp so it's less generic and won't get in the way of any other temp directories. I also added a link to it and made the directory listing pretty. Remove the index.php file in the tempEP directory and replace it with an empty index.php if you don't want it to be seen.


    For the majority of support, it works just the same as the 1.2.5.4/5 version so that thread should be useful to look at as well:
    http://www.zen-cart.com/forum/showthread.php?t=34970

    If you are using a MAC, then you need to uncomment one line in the main easypopulate.php file. This is because MACs use different end of line characters than win and linux. Same problem you have with text files.

  10. #10
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    Hi Phazei - did not realise you had started your own support thread so apologies for a double post.


    trying to install the newer CSV version and got this error in the admin area ...


    Fatal error: Call to undefined function: fputcsv() in xxxxxxxxxxxxxx\(my root folder)\( my admin folder )\easypopulate.php on line 1124

    which is the line containing

    Code:
    //*******************************
    		// PUT FILE IN TEMP DIR
    		//*******************************
    		$tmpfpath = DIR_FS_CATALOG . '' . $tempdir . "$EXPORT_TIME.$FILE_EXT";
    		$fp = fopen( $tmpfpath, "w+");
    		foreach ($filestring as $line) {
    			fputcsv($fp, $line, $csv_deliminator, $csv_enclosure);
    		}
    		fclose($fp);
    		$messageStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_EXPORT_SUCCESS, $EXPORT_TIME.'.'.$FILE_EXT."    ", $tempdir), 'success');
    Had a refresh and this error disappeared but my downloaded csv file only contains the following ..

    <br />
    <b>Fatal error</b>: Call to undefined function: fputcsv() in <b>xxxxxxxxxxxxxx\(my root folder)\( my admin folder )\easypopulate.php on line <b>1113</b><br />

    Have checked and double checked all files are uploaded ( downloaded from contributions page here ) permissions are set on the tempEP folder and the tempEP folder is in my root folder ( even put it in the admin folder as well just in case )

    I am reasonably certain I have done everything required but will glady hear I have not if it gets this sorted



    Any ideas ???
    Last edited by PatF; 9 Jan 2009 at 01:17 PM.

 

 
Page 1 of 32 12311 ... LastLast

Similar Threads

  1. Basic Description of EasyPopulate database fields?
    By Ben-B in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 7 Feb 2008, 05:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR