Page 3 of 15 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 146
  1. #21
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    jasontomczak, are there any myDebug*.log files in your store's /logs directory?

  2. #22
    Join Date
    Feb 2013
    Posts
    11
    Plugin Contributions
    0

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Quote Originally Posted by lat9 View Post
    jasontomczak, are there any myDebug*.log files in your store's /logs directory?
    Yes. Here it is, with my server path obscured:
    [16-Feb-2013 14:32:47] PHP Warning: Invalid argument supplied for foreach() in /store/oooooo/add_customers.php on line 129

  3. #23
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Would you send me either the full or a partial CSV file via PM so that I can "play" with it and see what's going on?

  4. #24
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    I downloaded your file and can verify that I receive the same behavior (screen just refreshes), but I don't get any log files (I'm running PHP 5.3.8). What version of PHP are you running?

    I most likely won't be able to get more into this until tomorrow ...

  5. #25
    Join Date
    Feb 2013
    Posts
    11
    Plugin Contributions
    0

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Quote Originally Posted by lat9 View Post
    I downloaded your file and can verify that I receive the same behavior (screen just refreshes), but I don't get any log files (I'm running PHP 5.3.8). What version of PHP are you running? I most likely won't be able to get more into this until tomorrow ...
    Looks like PHP 5.2.x. Not sure which subversion, but 5.2-something. Tomorrow is fine. Thanks!

  6. #26
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    What OS are you running and what program are you using to create the CSV file? The file you sent me has only <CR>, not <CR><LF> at the end of each line.

  7. #27
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Gotta love www.php.net! I'll get an update together within the next couple of days. In the interim, you'll need to edit /YOUR_ADMIN/add_customers_backend.php, adding one line and changing another around line 40:
    Code:
    ...
    function check_file_upload() {
      global $db, $row_positions, $post, $acfa_lines;
    
      $files = $_FILES['bulk_upload'];
      $errors = array();
      $to_insert = array();
    
      if (!zen_not_null($files['name'])) {
        $errors[] = ERROR_NO_UPLOAD_FILE;
      
      } else {
        if ($files['error'] != 0) {
        $errors[] = sprintf (ERROR_FILE_UPLOAD, $files['error']);
        
        } else {
          $pos = strrpos($files['name'],'.')+1;
          $allowed_extensions = array ( 'TXT', 'CSV' );
          $extension = substr ($files['name'], $pos);
          if ( (strlen ($extension) < 1 ) || !in_array(strtoupper($extension), $allowed_extensions) ) {
          $errors[] = sprintf (ERROR_BAD_FILE_EXTENSION, $extension) . implode(', ', $allowed_extensions);
        
          } else {
            $path = DIR_FS_UPLOADS . $files['name'];
    
            if (!move_uploaded_file($files['tmp_name'], $path)) {
              $errors[] = ERROR_CANT_MOVE_FILE;
          
            } else {
              chmod($path, 0775);
              ini_set("auto_detect_line_endings", true);  /*v2.0.3a*/
              $lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);  /*v2.0.3c*/
    
    ...
    I'll also beef up some of the error-detection that's present in the files ...

  8. #28
    Join Date
    Feb 2013
    Posts
    11
    Plugin Contributions
    0

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Quote Originally Posted by lat9 View Post
    What OS are you running and what program are you using to create the CSV file? The file you sent me has only <CR>, not <CR><LF> at the end of each line.
    Using OS X Mountain Lion and Excel for the CSV. I saved it in Windows Comma Separated format.

  9. #29
    Join Date
    Feb 2013
    Posts
    11
    Plugin Contributions
    0

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    Quote Originally Posted by lat9 View Post
    Gotta love www.php.net! I'll get an update together within the next couple of days. In the interim, you'll need to edit /YOUR_ADMIN/add_customers_backend.php, adding one line and changing another around line 40:
    Code:
    ...
    function check_file_upload() {
      global $db, $row_positions, $post, $acfa_lines;
    
      $files = $_FILES['bulk_upload'];
      $errors = array();
      $to_insert = array();
    
      if (!zen_not_null($files['name'])) {
        $errors[] = ERROR_NO_UPLOAD_FILE;
      
      } else {
        if ($files['error'] != 0) {
        $errors[] = sprintf (ERROR_FILE_UPLOAD, $files['error']);
        
        } else {
          $pos = strrpos($files['name'],'.')+1;
          $allowed_extensions = array ( 'TXT', 'CSV' );
          $extension = substr ($files['name'], $pos);
          if ( (strlen ($extension) < 1 ) || !in_array(strtoupper($extension), $allowed_extensions) ) {
          $errors[] = sprintf (ERROR_BAD_FILE_EXTENSION, $extension) . implode(', ', $allowed_extensions);
        
          } else {
            $path = DIR_FS_UPLOADS . $files['name'];
    
            if (!move_uploaded_file($files['tmp_name'], $path)) {
              $errors[] = ERROR_CANT_MOVE_FILE;
          
            } else {
              chmod($path, 0775);
              ini_set("auto_detect_line_endings", true);  /*v2.0.3a*/
              $lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);  /*v2.0.3c*/
    
    ...
    I'll also beef up some of the error-detection that's present in the files ...

    SUCCESS!! It worked that time! Thank you thank you!

  10. #30
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Customizing the Add Customers form to include Wholesale/Retail pricing option

    I've submitted v2.0.3 to the Plugins area; that version includes the change identified above and some additional error-checking on the imported CSV file.

 

 
Page 3 of 15 FirstFirst 1234513 ... LastLast

Similar Threads

  1. Save For Later Support Thread
    By swguy in forum All Other Contributions/Addons
    Replies: 209
    Last Post: 11 Mar 2024, 03:50 AM
  2. v155 Default Attribute - Add from product list [Support Thread]
    By swguy in forum Addon Admin Tools
    Replies: 9
    Last Post: 6 Jul 2020, 01:13 PM
  3. v151 Black and White Admin [Support Thread]
    By vvomble in forum Addon Templates
    Replies: 1
    Last Post: 1 Jun 2013, 04:04 PM
  4. add customers from admin
    By stevebrett in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 May 2009, 02:24 AM
  5. Add Customers from Admin
    By bigbadboy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Apr 2008, 02:42 AM

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