Page 2 of 32 FirstFirst 123412 ... LastLast
Results 11 to 20 of 317
  1. #11
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    phazei,

    2.0 is supposed to come with a db backup system built in, so it probably won't even need easy populate.
    Actually, this is strictly a mysql backup tool for backing up and restoring your store.

    Concerning Product Attribute: This feature does not work in 1.2.5.4. Langer fixed it and then marketed it as EP Advanced (along with a number of other features) for a cost. Personally, I've often found it easier to code a solution from scratch then to try and fix bad code.

    Quantity Discounts: This does use it's own table. It's really quite simple although a bit of research needs to be done to identify each type of discount. Best to create a discount, then down load it to see how it's encoded. The code I uploaded handles all this.

    -cj

  2. #12
    Join Date
    Jan 2009
    Posts
    31
    Plugin Contributions
    1

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    Quote Originally Posted by PatF View Post
    Fatal error: Call to undefined function: fputcsv() in xxxxxxxxxxxxxx\(my root folder)\( my admin folder )\easypopulate.php on line 1124

    Any ideas ???
    Unfortunately, I do have some ideas, but nothing that will help. Something I should have stated in my first post to this thread. I mentioned it in the other forum...

    1.2.5.5.CSV will ONLY work with PHP > v5.1

    fgetcsv existed in PHPv4, but fputcsv was only added in v5.1

    There are custom fputcsv functions that could be put at the begining of the file that would make it work with PHP4.

    I just did a quick google search and found this:

    PHP Code:
    if (!function_exists('fputcsv')) {
        function 
    fputcsv(&$handle$fields = array(), $delimiter ','$enclosure '"') {
            
    $str '';
            
    $escape_char '\\';
            foreach (
    $fields as $value) {
                
    settype($value'string');
                if (
    strpos($value$delimiter) !== false ||
                    
    strpos($value$enclosure) !== false ||
                    
    strpos($value"\n") !== false ||
                    
    strpos($value"\r") !== false ||
                    
    strpos($value"  ") !== false ||
                    
    strpos($value' ') !== false) {
                    
                    
    $str2 $enclosure;
                    
    $escaped 0;
                    
    $len strlen($value);
                    for (
    $i=0;$i<$len;$i++) {
                        if (
    $value[$i] == $escape_char) {
                            
    $escaped 1;
                        } else if (!
    $escaped && $value[$i] == $enclosure) {
                            
    $str2 .= $enclosure;
                        } else {
                            
    $escaped 0;
                        }
                        
    $str2 .= $value[$i];
                    }
                    
    $str2 .= $enclosure;
                    
    $str .= $str2.$delimiter;
                } else {
                    
    $str .= $value.$delimiter;
                }
            }
            
    $str substr($str,0,-1);
            
    $str .= "\n";
            return 
    fwrite($handle$str);
        }

    I don't know if it works, but I hope it does

    Quote Originally Posted by chadderuski View Post
    phazei,
    Concerning Product Attribute: This feature does not work in 1.2.5.4. Langer fixed it and then marketed it as EP Advanced (along with a number of other features) for a cost. Personally, I've often found it easier to code a solution from scratch then to try and fix bad code.

    Quantity Discounts: This does use it's own table. It's really quite simple although a bit of research needs to be done to identify each type of discount. Best to create a discount, then down load it to see how it's encoded. The code I uploaded handles all this.

    -cj
    Since most of the code for the attributes options is there it probably wouldn't be that hard to make it work.

    I thought there was a column added to the db to get quantity discounts to work in that other version. I didn't want to add anything that would require someone to have to modify the db in any way. I wanted it to be as plug and play as possible.
    Last edited by phazei; 10 Jan 2009 at 03:42 AM. Reason: formated php better

  3. #13
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    That work around for PHP4 done the trick - many thanks

  4. #14
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    phazie,

    Yes, there is some custom stuff in my code, but that is independant of quantity discounts. I wanted to be able to say how a product was priced, i.e. ea=each, cs=box, etc. So when you look at the page is says "3.95 ea". The basic quantity discounts is quite simple. I made a new download file type and added the code to automatically add discounts on upload.

    Also, since zen 2.0 will be php 5.1 required, your csv mod will mature well with it. :)

    I have not look closely at the Attributes code to see what is wrong. Partly cause I haven't had the need to use attributes like this. The 2.??? code at langer's modhole was his attempt to fix this, but it is quite buggy.
    I would not trust the logic per say. The problem with attributes is that they can get quite complicated, and add language support and you have a LOT of columns.

    I've been experimenting with your CSV version, chopping out a lot of the fluff. I like the trimmer code. It also runs much quicker. Nice to be able to open directly into Excel too!

    If the code is mature enough, you may even get it included with 2.0! It's happened before, where a mod became core. This really is something that should have been in the core (IMOP). Just too important of a feature.

    One Request: In your next code post, could you comment with your name "phazie" the sections you changed? There is so much errant garbage in the file that scanning through it for your work becomes cumbersome.

    -cj

  5. #15
    Join Date
    Dec 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    I did not see there was a support thread started.

    I have been having problems getting my file uploaded into the Langer's old version of Easy Pop. It is comma delineated, and then each text field is enclosed in quotes (since it may be "" inside of it).

    Both OpenOffice Calc and Excel can parse this file without problems, so I assumed it would work with this upload tool, too. Can your update handle such a file?

  6. #16
    Join Date
    Dec 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    Okay... I just found the wiki on Easy Populate and I now realize that I made a very bad assumption.

    I needed a tool that could upload a file, parse that file into columns, and assign an attribute to each column.

    I thought that you could create any attribute you wanted on each product. My products have more attributes than just the ones in the required list.

    Help?

  7. #17
    Join Date
    Jan 2009
    Posts
    31
    Plugin Contributions
    1

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    I updated the version again. Added some stuff, cleaned up a bit of code. There is now a pretty file listing with import button next to each file.

    lstahlberg:
    No clue, sorry.


    chadderuski:
    I started tagging things with phazei, but I've made so many changes all over that that failed quickly.

    I suggest a program called WinMerge. It lets you compare 2 files and see the differences between them.

  8. #18
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    I'm getting the following error when trying to upload the CSV file:

    Warning: array_flip() [function.array-flip]: The argument should be an array in xxxxx/public_html/store/admin/easypopulate.php on line 1245

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

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    Quote Originally Posted by khopek View Post
    I'm getting the following error when trying to upload the CSV file:

    Warning: array_flip() [function.array-flip]: The argument should be an array in xxxxx/public_html/store/admin/easypopulate.php on line 1245

    That doesn't reflect any line number in the file that uses array_flip. You must have modified it in some way.

    The only place I see where that could be possible is by the while loop around line 1220.

    Only if fgetcsv returns false on it's first call near line 1220 would you get that error. That reads the header line of the file.

    You have to make sure it is a comma and quote deliminated file.

    If you open it with a text editor, it should look like the one it exports. The first line needs to be identical.


    I uploaded an updated one that should be approved soon. But it probably won't fix your problem.

    Something you modified in easypopulate or someway you saved your csv is likely the problem.

  10. #20
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: Easy Populate support for Version 1.2.5.5.csv

    I actually changed my PHP Engine to use PHP 5. It was set to use PHP 4, but when I changed it, I know longer got that error.

 

 
Page 2 of 32 FirstFirst 123412 ... 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