Page 320 of 348 FirstFirst ... 220270310318319320321322330 ... LastLast
Results 3,191 to 3,200 of 3479
  1. #3191
    Join Date
    Dec 2020
    Location
    china
    Posts
    21
    Plugin Contributions
    0

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by mc12345678 View Post
    To "pile on" to the rest of the recommendations, please also identify version(s) of software (I figured out/can guess from the image in the github issue that it is most likely Zen Cart 1.5.7x because of the cmd= parameter in the URI path, but even that is not highly specific). More information helps to figure out the issue. Obviously the first thing that would help would be the error log that has been discussed above, then the data within the file or something similar. If I can recreate the issue then perhaps it either can be fixed or prevented.


    In the picture is my website log, can you see any results?
    I also looked at the php log and the apache log and found no entries for easyPopulate.


    Zen Cart 1.5.7
    Easy Populate 4.0.37.10 - 02-08-2017
    PHP 7.4Click image for larger version. 

Name:	11.png 
Views:	8 
Size:	2.5 KB 
ID:	19336Click image for larger version. 

Name:	44.png 
Views:	7 
Size:	2.9 KB 
ID:	19337Click image for larger version. 

Name:	22.jpg 
Views:	17 
Size:	32.6 KB 
ID:	19338

  2. #3192
    Join Date
    Jul 2012
    Posts
    16,488
    Plugin Contributions
    17

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by zswll2 View Post
    In the picture is my website log, can you see any results?
    I also looked at the php log and the apache log and found no entries for easyPopulate.


    Zen Cart 1.5.7
    Easy Populate 4.0.37.10 - 02-08-2017
    PHP 7.4Click image for larger version. 

Name:	11.png 
Views:	8 
Size:	2.5 KB 
ID:	19336Click image for larger version. 

Name:	44.png 
Views:	7 
Size:	2.9 KB 
ID:	19337Click image for larger version. 

Name:	22.jpg 
Views:	17 
Size:	32.6 KB 
ID:	19338
    The website log is an access log not an error log, so there is nothing there that helps resolve the issue. What about the first two lines of the import file? also, generally a way to evaluate operation of EP4 as compared to the file being imported is to export a file and then immediately import it again without editing... If there is no problem with that process then the problem is in the file that is attempted to be uploaded and imported after it was edited.

    I'll try a simple file in a similar environment and see what happens. Current environment appears to be Zen Cart 1.5.7 (although rev b has been issued), PHP 7.4 with EP4.0.37.10
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3193
    Join Date
    Jul 2012
    Posts
    345
    Plugin Contributions
    0

    Default Re: EasyPopulate 4.0 Support Thread

    Model number is as item number or SKU which is always different than UPC/barcode of products. I already tried to work by changing EP4_DB_FILTER_KEY it did not work therefore I seek for help in this forum. Can you please provide the codes changes or updated file to work with upc?
    Thank you.


    Quote Originally Posted by mc12345678 View Post
    Yes, though I didn't make it as easy as I thought I had...

    Apparently a new notifier needs to be added in to allow further "development" to use an alternate field,..

    There are two basic factors involved with details to be captured/handled in what appears to be two files:

    admin/easypopulate_4.php : Need to populate 'EP4_DB_FILTER_KEY' with the key name to be used later in import... This is normally read from the database, but it could be pre-loaded in the file load structure or the database could be updated to include the extra option(s).
    admin/easypopulate_4_import.php: sometime either within or after this section: switch (EP4_DB_FILTER_KEY) { ... } need to set each of the variables identified within that section to the desired state for your new primary key. I was thinking that a notifier was included to support this, but I don't see it... Obviously could add a set of code directly in that file's section to handle your specific case.

    Considering that the UPC "mod" is recognized, there is no need to add an additional custom field to track for export/import, but if the new field was not a pre-recognized field then would need to add it to the list of fields to process.

    Of course and has likely been described countless times in here, is there a reason that the UPC code isn't part of the model?

  4. #3194
    Join Date
    Dec 2020
    Location
    china
    Posts
    21
    Plugin Contributions
    0

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by mc12345678 View Post
    The website log is an access log not an error log, so there is nothing there that helps resolve the issue. What about the first two lines of the import file? also, generally a way to evaluate operation of EP4 as compared to the file being imported is to export a file and then immediately import it again without editing... If there is no problem with that process then the problem is in the file that is attempted to be uploaded and imported after it was edited.

    I'll try a simple file in a similar environment and see what happens. Current environment appears to be Zen Cart 1.5.7 (although rev b has been issued), PHP 7.4 with EP4.0.37.10
    As you said, I only export and import, not edit. When importing, the browser is blank. I check Network and find POST 500.

    I checked the website error log and there was no relevant error message at the same time.
    Click image for larger version. 

Name:	77.jpg 
Views:	10 
Size:	22.0 KB 
ID:	19341Click image for larger version. 

Name:	66.jpg 
Views:	12 
Size:	54.5 KB 
ID:	19340
    Last edited by zswll2; 22 Dec 2020 at 04:06 AM.

  5. #3195
    Join Date
    Dec 2020
    Location
    china
    Posts
    21
    Plugin Contributions
    0

    Default Re: EasyPopulate 4.0 Support Thread

    Latest log

    Website log:
    Click image for larger version. 

Name:	99.jpg 
Views:	15 
Size:	15.6 KB 
ID:	19342

    error log:
    Click image for larger version. 

Name:	00.jpg 
Views:	15 
Size:	28.1 KB 
ID:	19343

  6. #3196
    Join Date
    Jan 2007
    Location
    Illinois, USA
    Posts
    302
    Plugin Contributions
    0

    Default Re: EasyPopulate 4.0 Support Thread

    Fresh install of 1.5.7b with Edit Orders, Clone Template, TY Package tracker, & Shopping Cart Reminder mods
    php73

    Haven't used EP4 since version 1.5.6c

    Does this mod work with 1.5.7b? I gone back thru the last couple of years of comments, looks like one person installed with errors but no direct resolution posted.

    Anyone have this functioning on 1.5.7b?
    NTO: building a better network thru collaboration
    www.needtoorder.com | www.coffeewitheinstein.com

  7. #3197
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,508
    Plugin Contributions
    28

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by Carbonless View Post
    Fresh install of 1.5.7b with Edit Orders, Clone Template, TY Package tracker, & Shopping Cart Reminder mods
    php73

    Haven't used EP4 since version 1.5.6c

    Does this mod work with 1.5.7b? I gone back thru the last couple of years of comments, looks like one person installed with errors but no direct resolution posted.

    Anyone have this functioning on 1.5.7b?
    Sure do, works a good as ever.

  8. #3198
    Join Date
    Jul 2012
    Posts
    16,488
    Plugin Contributions
    17

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by zswll2 View Post
    As you said, I only export and import, not edit. When importing, the browser is blank. I check Network and find POST 500.

    I checked the website error log and there was no relevant error message at the same time.
    Click image for larger version. 

Name:	77.jpg 
Views:	10 
Size:	22.0 KB 
ID:	19341Click image for larger version. 

Name:	66.jpg 
Views:	12 
Size:	54.5 KB 
ID:	19340
    Quote Originally Posted by zswll2 View Post
    Latest log

    Website log:
    Click image for larger version. 

Name:	99.jpg 
Views:	15 
Size:	15.6 KB 
ID:	19342

    error log:
    Click image for larger version. 

Name:	00.jpg 
Views:	15 
Size:	28.1 KB 
ID:	19343
    Unfortunately, and I have no idea how it got there, but there is an extra period at the end of line 160 of admin/easypopulate_4_attrib.php. This does cause a mydebug log to be generated (if your system is properly setup to log myDebug logs) that reads like so:
    Code:
    [DATE TIME TIMEZONE] PHP Parse error:  syntax error, unexpected '.' in /filepath_to_admin/easypopulate_4_attrib.php on line 160
    
    [DATE TIME TIMEZONE] Request URI: /admin/index.php?cmd=easypopulate_4, IP address: IP_ADDRESS
    --> PHP Parse error: syntax error, unexpected '.' in /filepath_to_admin/easypopulate_4_attrib.php on line 160.
    To fix the issue change:
    Code:
          $products_options_values_sort_order = $products_sort_order_start;.
    to:
    Code:
          $products_options_values_sort_order = $products_sort_order_start;
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #3199
    Join Date
    Jul 2012
    Posts
    16,488
    Plugin Contributions
    17

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by Carbonless View Post
    Fresh install of 1.5.7b with Edit Orders, Clone Template, TY Package tracker, & Shopping Cart Reminder mods
    php73

    Haven't used EP4 since version 1.5.6c

    Does this mod work with 1.5.7b? I gone back thru the last couple of years of comments, looks like one person installed with errors but no direct resolution posted.

    Anyone have this functioning on 1.5.7b?
    Quote Originally Posted by jeking View Post
    Sure do, works a good as ever.
    Just as well in reviewing the issue that was previously discussed/corrected about using the basic attribute import, see: https://www.zen-cart.com/showthread....36#post1376036

    Have found a few minor things to correct addressing some of the more strict PHP usage, but functions.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #3200
    Join Date
    Jul 2012
    Posts
    16,488
    Plugin Contributions
    17

    Default Re: EasyPopulate 4.0 Support Thread

    Quote Originally Posted by jsarwar View Post
    Model number is as item number or SKU which is always different than UPC/barcode of products. I already tried to work by changing EP4_DB_FILTER_KEY it did not work therefore I seek for help in this forum. Can you please provide the codes changes or updated file to work with upc?
    Thank you.
    Apparently, I had started the development of considering an alternate primary key, but had not completed it. I am incorporating the below changes (outside of specific code for products_upc) into the distribution to allow further use/development of an alternate primary_key. Note that I may have missed something and would appreciate input on improvement. I do know that for example the detailed attributes handler still uses the v_products_id column primarily for import although there are messages that relate to the primary key being something else as well...

    Anyways, I am providing the needed file changes in reverse order from the bottom of the file to the top so that regardless additional changes personally made at least there is a chance that the instruction can be followed. I am using 4.0.37.10 against which to reference.

    So starting in admin/easypopulate_4_import.php at line 1647 adding the code in green:
    Code:
                    if (!in_array($chosen_key, array('v_products_id', 'v_products_model'))) {                  $chosen_key_sub = $chosen_key;
                      if (strpos($chosen_key_sub, 'v_') === 0) {
                        $chosen_key_sub = substr($chosen_key_sub, 2);
                      }
                      $sql = $db->bindVars($sql, ':' . $chosen_key_sub . ':', (!empty(${$chosen_key}) ? ${$chosen_key} : ''), $zc_support_ignore_null);
                    }
                    $result = ep_4_query($sql);
    Line 1601:
    Code:
                    if (!in_array($chosen_key, array('v_products_id', 'v_products_model'))) {                  $chosen_key_sub = $chosen_key;
                      if (strpos($chosen_key_sub, 'v_') === 0) {
                        $chosen_key_sub = substr($chosen_key_sub, 2);
                      }
                      $sql = $db->bindVars($sql, ':' . $chosen_key_sub . ':', (!empty(${$chosen_key}) ? ${$chosen_key} : ''), $zc_support_ignore_null);
                    }
                    $result = ep_4_query($sql);
    Line 1190:
    Code:
              if (!in_array($chosen_key, array('v_products_id', 'v_products_model'))) {            $chosen_key_sub = $chosen_key;
                if (strpos($chosen_key_sub, 'v_') === 0) {
                  $chosen_key_sub = substr($chosen_key_sub, 2);
                }
                $sql = $db->bindVars($sql, ':' . $chosen_key_sub . ':', (!empty(${$chosen_key}) ? ${$chosen_key} : ''), $zc_support_ignore_null);
              }
              $result = ep_4_query($sql);
    Line 269:
    Code:
            if (ep4_field_in_file($chosen_key) && !in_array($chosen_key, array('v_products_id', 'v_products_model'))){          if (!in_array($chosen_key, array('v_products_id', 'v_products_model'))) {
                $chosen_key_sub = $chosen_key;
                if (strpos($chosen_key_sub, 'v_') === 0) {
                  $chosen_key_sub = substr($chosen_key_sub, 2);
                }
                $sql = $db->bindVars($sql, ':' . $chosen_key_sub . ':', $items[$filelayout[$chosen_key]], $zc_support_ignore_null);
              }
            }
            $result = ep_4_query($sql);
    In admin/easypopulate_4_import.php add the notifier that will be needed to execute the code by making the following change(s) of adding the code that is in green (with the switch statement beginning at/near line 98):
    Code:
        switch (EP4_DB_FILTER_KEY) {
          case 'products_model':
            $chosen_key = 'v_products_model';
            $chosen_key_sql = "
                p.products_model   = :products_model:";
            $chosen_key_sql_limit = " WHERE (products_model = :products_model:) LIMIT 1";
            break;
          case 'blank_new':
          case 'products_id':
            $chosen_key = 'v_products_id';
            $chosen_key_sql = "
                p.products_id   = :products_id:";
            $chosen_key_sql_limit = " WHERE (products_id = :products_id:) LIMIT 1";
            break;
          default:
            $chosen_key = 'v_products_model';
            $chosen_key_sql = "
                p.products_model   = :products_model:";
            $chosen_key_sql_limit = " WHERE (products_model = :products_model:) LIMIT 1";
            $zco_notifier->notify('EP4_IMPORT_DEFAULT_EP4_DB_FILTER_KEY_DATA', EP4_DB_FILTER_KEY, $chosen_key, $chosen_key_sql, $chosen_key_sql_limit);
            break;
        }
    
    
        $zco_notifier->notify('EP4_IMPORT_AFTER_EP4_DB_FILTER_KEY');
    In admin/includes/functions/extra_functions/easypopulate_4_functions.php
    beginning at line 494 where the function ep_4_remove_product is initially defined, modify it to include the below content in green:
    Code:
    function ep_4_remove_product($product_model) {  global $db, $ep_debug_logging, $ep_debug_logging_all, $ep_stack_sql_error, $zco_notifier, $zc_support_ignore_null;
      $project = PROJECT_VERSION_MAJOR.'.'.PROJECT_VERSION_MINOR;
      $ep_uses_mysqli = ((PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3') ? true : false);
      $sql = "SELECT p.products_id FROM ".TABLE_PRODUCTS . " p";
      switch (EP4_DB_FILTER_KEY) {
        case 'products_model':
          $sql .= " WHERE p.products_model = :products_model:";
          $sql = $db->bindVars($sql, ':products_model:', $product_model, $zc_support_ignore_null);
          break;
        case 'blank_new':
        case 'products_id':
          $sql .= " WHERE p.products_id = :products_id:";
          $sql = $db->bindVars($sql, ':products_id:', $product_model, 'integer');
          break;
        default:
          $sql_add = " WHERE p.products_model = :products_model:";
          $zco_notifier->notify('EP4_FUNCTION_REMOVE_PRODUCT', $product_model, $sql_add);
          $sql .= $sql_add;
          unset($sql_add);
          $sql = $db->bindVars($sql, ':products_model:', $product_model, $zc_support_ignore_null);
    In admin/includes/modules/easypopulate_4_featured_ep.php at line 36:
    Code:
            $sql = $db->bindVars($sql, ':products_model:', $items[$filelayout['v_products_model']], $zc_support_ignore_null);        $sql = $db->bindVars($sql, ':products_id:', $items[$filelayout['v_products_id']], $zc_support_ignore_null);
            if (!in_array($chosen_key, array('v_products_id', 'v_products_model'))) {
              $chosen_key_sub = $chosen_key;
              if (strpos($chosen_key_sub, 'v_') === 0) {
                $chosen_key_sub = substr($chosen_key_sub, 2);
              }
              $sql = $db->bindVars($sql, ':' . $chosen_key_sub . ':', $items[$filelayout[$chosen_key]], $zc_support_ignore_null);
            }
            $result = ep_4_query($sql);

    The above changes are captured at: mc12345678/EasyPopulate-4.0 at v4.0.37.11 (github.com)


    Create a new observer file:
    admin/includes/classes/observers/class.easypopulate_4_default_ep4_db_filter_key_observer.php

    with the following contents:
    Code:
    <?php/* This is an observer class to take action when the ep4_db_filter_key is processed/determined.
    It is expected to set the variables needed within EP4 to support an alternate primary key.
    */
    
    
    class ep4_db_filter_key extends base
    {
        public function __construct()
        {
            $attachThis = array();
            $attachThis[] = 'EP4_MODULES_FILELAYOUT_CHOSEN_KEY';
            $attachThis[] = 'EP4_IMPORT_DEFAULT_EP4_DB_FILTER_KEY_DATA';
            $attachThis[] = 'EP4_FUNCTION_REMOVE_PRODUCT';
            $this->attach($this, $attachThis);
        }
    
    
        public function updateEp4ImportDefaultEp4DbFilterKeyData(&$callingClass, $notifier, $ep4_db_filter_key, &$chosen_key, &$chosen_key_sql, &$chosen_key_sql_limit)
        {
            if ($ep4_db_filter_key == 'products_upc') {
                $chosen_key = 'v_products_upc';
                $chosen_key_sql = "
                    p.products_upc = :products_upc:";
                $chosen_key_sql_limit = " WHERE (products_upc = :products_upc:) LIMIT 1";
            }
        }
    
    
        public function updateEp4ModulesFilelayoutChosenKey(&$callingClass, $notifier, $emptyArray, &$chosen_key)
        {
            if (EP4_DB_FILTER_KEY == 'products_upc') {
                $chosen_key = 'v_products_upc';
            }
        }
    
    
        public function updateEp4FunctionRemoveProduct(&$callingClass, $notifier, $key_value, &$sql_add)
        {
            if (EP4_DB_FILTER_KEY == 'products_upc') {
                global $chosen_key, $chosen_key_sql, $zc_support_ignore_null;
                
                if (in_array($chosen_key, array('v_products_id', 'v_products_model'))) {
                    return;
                }
                $sql_add = $chosen_key_sql;
    
    
                $chosen_key_sub = $chosen_key;
                if (strpos($chosen_key_sub, 'v_') === 0) {
                    $chosen_key_sub = substr($chosen_key_sub, 2);
                }
                $sql_add = $db->bindVars($sql_add, ':' . $chosen_key_sub . ':', $key_value, $zc_support_ignore_null);
            }
        }
    }
    Then add an autoloader to implement the above code:
    admin/includes/auto_loaders/easypopulate_4_ep4_db_filter_key.php
    Code:
    <?php
    /* loads and instantiates observer class within the admin file structure
    */
    $autoLoadConfig[0][] = array(
        'autoType' => 'class',
        'loadFile' => 'observers/class.easypopulate_4_default_ep4_db_filter_key_observer.php',
        'classPath' => DIR_WS_CLASSES,
    );
    $autoLoadConfig[180][] = array(
        'autoType' => 'classInstantiate',
        'className' => 'ep4_db_filter_key',
        'objectName' => 'ep4_db_filter_key_obs',
    );
    Then to possibly "pull it together" in:

    admin/includes/extra_configures/

    create a file, perhaps named: easypopulate_4_ep4_db_filter_key.php
    Code:
    <?php
    /* This hard codes the filter_key designation which will override the database setting for the same variable.  
    The intent is to force EP4 to use the following EP4_DB_FILTER_KEY setting.  
    Doing so is intended to treat the defined variable as the primary key when exporting and importing data.
    Upon successful use, the associated database field could be updated to recognize this variable. */
    
    define('EP4_DB_FILTER_KEY', 'products_upc');
    While I have not tested the above, it appears that it will have the desired effect. What it will do, by the "last" file is assign the filter key (primary key) to be products_upc which is then used/evaluated in the import process. Because that key doesn't exist within the basic structure, the default code is executed. Initially there are default values applied, but then a notifier is called to allow some modification at that point.
    Within the observer, the suggested key is evaluated and if it meets the desired value, the variables $chosen_key, $chosen_key_sql, and $chosen_key_sql_limit are each set to what appear to be valid values for this situation where the upc is expected to be either actually or at least desired to be handled as a unique key/value... If the database does not contain unique data, then importing data matching a key that is non-unique will cause all such similar to be updated and not just the first one found, this is along the lines of having linked product in multiple categories.

    If that seems to work as desired (again note that only able to update based on products_upc if the admin/includes/extra_configures file is still in place and/or the define is "active"...), then can update the configuration key to have an additional value available from which to select so that you can better control the primary key that is being used. To add the products_upc option to the configuration selector run the following sql:
    Code:
    UPDATE configuration SET set_function = 'zen_cfg_select_option(array(\'products_model\', \'products_id\', \'blank_new\', \'products_upc\'),' WHERE configuration_key = 'EP4_DB_FILTER_KEY';
    The above sql statement doesn't update the configuration_description text to include information about what that selection does, but understand that there is no code currently incorporated about supporting a "blank" value for the products_upc when products_upc is set as the primary key...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 19
    Last Post: 23 Jan 2023, 08:04 AM
  2. BackUp ZC [Support Thread]
    By skipwater in forum All Other Contributions/Addons
    Replies: 285
    Last Post: 23 Dec 2020, 10:40 AM
  3. Wordpress On ZC [Support Thread]
    By hira in forum All Other Contributions/Addons
    Replies: 1858
    Last Post: 17 Jan 2014, 01:24 AM
  4. ZJ Black 2 support thread
    By Liamv in forum Addon Templates
    Replies: 1
    Last Post: 15 Feb 2010, 02:53 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