-
Re: EasyPopulate 4.0 Support Thread
No, it is much simpler than that.
Your analogy is wrong - it is like opening a zip with a text editor, the editor allowing you to open the file, and edit it...... without throwing an error !
If a decision process runs and does not complete correctly for whatever reason then an error should be thrown advising the user. The assumption is the user is dumb (that's me !) and everything you can do to stop them making stupid errors should be encouraged - hence a million different error checks throughout Zencart.
In this instance the filename was incorrect which caused the program to carry on and report that everything was OK when clearly it wasn't.... (the data was right - just the filename being wrong)
That cost me a day of running around based on information reported by the process that was clearly wrong. It said it worked, when clearly it had not. That isn't right.
I'm not trying to be negative - I'd just like to see the code improved to the benefit of all as it is an indispensable tool for Zencart.
Here's a patch to check the filenames and log an error - it may not be perfect but it is about there - also miles quicker than running through all the code for a simple failure :-)
You can see my comment line - sometimes it checks for the filename, others it does a anything else check with <>
Either way, if the name is checked at the start then it gives a fast response to the problem. If you have new sections / filenames then just add the name to the array. Using stristr would give you more flexibility as per my note, but I have left as is for now.
It's also dead simple.....
--- easypopulate_4_import-orig.php 2015-06-18 11:18:05.000000000 +0200
+++ easypopulate_4_import.php 2015-06-18 14:00:21.000000000 +0200
@@ -8,6 +8,37 @@
$file = array('name' => $_GET['import']);
$display_output .= sprintf(EASYPOPULATE_4_DISPLAY_LOCAL_FILE_SPEC, $file['name']);
+
+
+
+/*
+ * These are the filenames that we look for
+ *
+strtolower(substr($file['name'],0,11)) == "featured-ep")
+strtolower(substr($file['name'],0,15)) == "attrib-basic-ep"
+strtolower(substr($file['name'],0,18)) == "attrib-detailed-ep")
+strtolower(substr($file['name'],0,15)) == "sba-detailed-ep")
+strtolower(substr($file['name'],0,12)) == "sba-stock-ep")
+strtolower(substr($file['name'],0,15)) <> "categorymeta-ep")
+strtolower(substr($file['name'],0,7)) <> "attrib-")
+strtolower(substr($file['name'],0,4)) <> "sba-")
+strtolower(substr($file['name'],0,14)) == "pricebreaks-ep")
+*/
+
+
+$fileNameArray = array ("featured-ep", "attrib-basic-ep", "attrib-detailed-ep", "sba-detailed-ep", "categorymeta-ep", "attrib-", "sba-", "pricebreaks-ep");
+$discoveredFile = false;
+
+foreach ($fileNameArray as $key) {
+
+ $length = strlen ($key);
+ // probably better to do stristr but all the lines then need changing further down
+ if (strtolower(substr($file['name'],0,$length)) == $key) {
+ $discoveredFile = true;
+ }
+}
+
+if ($discoveredFile == true) { // we'll proceed
$ep_update_count = 0; // product records updated
$ep_import_count = 0; // new products records imported
@@ -1637,5 +1668,17 @@
} else {
$messageStack->add("File Import Completed.", 'success');
}
+}
+else {
+ $display_output .= '<h3>Finished Processing Import File</h3>';
+ $display_output .= '<br /><h3 style="color:red">Filename is wrong</h3> ';
+ $display_output .= '<br />Please check that the filename <b>starts</b> with the correct term';
+ $display_output .= '<br />The following are the permissible names :';
+ foreach ($fileNameArray as $key) {
+ $display_output .= "<br />" . $key;
+ }
+ $messageStack->add("File Import Failed.", 'error');
+
+} // End file check loop
} // END FILE UPLOADS
-?>
\ No newline at end of file
+?>
And a small patch to easypopulate.php itself to clear a small warning that was annoying me :-)
--- easypopulate_4-orig.php 2015-06-17 19:03:42.000000000 +0200
+++ easypopulate_4.php 2015-06-18 14:47:28.000000000 +0200
@@ -28,9 +28,9 @@
$ep_music = (int)EASYPOPULATE_4_CONFIG_MUSIC_DATA; // 0-Disable, 1-Enable
$ep_uses_mysqli = (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3' ? true : false--- easypopulate_4-orig.php 2015-06-17 19:03:42.000000000 +0200
+++ easypopulate_4.php 2015-06-18 14:14:01.000000000 +0200
@@ -30,7 +30,7 @@
@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
-if (!$error) {
+if (!isset($error)) {
$upload_max_filesize=ini_get("upload_max_filesize");
if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024;
if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024;);
-@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
+@set_time_limit($ep_execution); // execution limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
-if (!$error) {
+if (!isset($error)) {
$upload_max_filesize=ini_get("upload_max_filesize");
if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024;
if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024;
I'd have a go on github but not very experienced with it.... and I am not sure which repo to follow - is chaddro still working on this ?
B. Rgds
John
-
Re: EasyPopulate 4.0 Support Thread
Did anyone ever come up with a fix for this being displayed on the bottom of the page?
. www.evoluted.net Layout: Manny . www.tenka.co.uk REQUIREMENTS ============ This script requires PHP and GD2 if you wish to use the thumbnail functionality. INSTRUCTIONS ============ 1) Unzip all files 2) Edit this file, making sure everything is setup as required. 3) Upload to server 4) ?????? 5) Profit! CONFIGURATION ============= Edit the variables in this section to make the script work as you require. Start Directory - To list the files contained within the current directory enter '.', otherwise enter the path to the directory you wish to list. The path must be relative to the current directory. */ $startdir = DIR_FS_CATALOG . $tempdir; /* Show Thumbnails? - Set to true if you wish to use the scripts auto-thumbnail generation capabilities. This requires that GD2 is installed. */ $showthumbnails = true; /* Show Directories - Do you want to make subdirectories available? If not set this to false */ $showdirs = true; /* Force downloads - Do you want to force people to download the files rather than viewing them in their browser? */ $forcedownloads = false; /* Hide Files - If you wish to hide certain files or directories then enter their details here. The values entered are matched against the file/directory names. If any part of the name matches what is entered below then it is now shown. */ $hide = array( 'dlf', 'index.php', 'Thumbs', '.htaccess', '.htpasswd', 'fileList.php' ); /* Show index files - if an index file is found in a directory to you want to display that rather than the listing output from this script? */ $displayindex = false; /* Allow uploads? - If enabled users will be able to upload files to any viewable directory. You should really only enable this if the area this script is in is already password protected. */ $allowuploads = false; /* Overwrite files - If a user uploads a file with the same name as an existing file do you want the existing file to be overwritten? */ $overwrite = false; /* Index files - The follow array contains all the index files that will be used if $displayindex (above) is set to true. Feel free to add, delete or alter these */ $indexfiles = array ( 'index.html', 'index.htm', 'default.htm', 'default.html' ); /* File Icons - If you want to add your own special file icons use this section below. Each entry relates to the extension of the given file, in the form => . These files must be located within the dlf directory. */ $filetypes = array ( 'png' => 'jpg.gif', 'jpeg' => 'jpg.gif', 'bmp' => 'jpg.gif', 'jpg' => 'jpg.gif', 'gif' => 'gif.gif', 'zip' => 'archive.png', 'rar' => 'archive.png', 'exe' => 'exe.gif', 'setup' => 'setup.gif', 'txt' => 'text.png', 'htm' => 'html.gif', 'html' => 'html.gif', 'fla' => 'fla.gif', 'swf' => 'swf.gif', 'xls' => 'xls.gif', 'doc' => 'doc.gif', 'sig' => 'sig.gif', 'fh10' => 'fh10.gif', 'pdf' => 'pdf.gif', 'psd' => 'psd.gif', 'rm' => 'real.gif', 'mpg' => 'video.gif', 'mpeg' => 'video.gif', 'mov' => 'video2.gif', 'avi' => 'video.gif', 'eps' => 'eps.gif', 'gz' => 'archive.png', 'asc' => 'sig.gif', ); /* That's it! You are now ready to upload this script to the server. Only edit what is below this line if you are sure that you know what you are doing! */ error_reporting(0); if(!function_exists('imagecreatetruecolor')) $showthumbnails = false; $leadon = $startdir; if($leadon=='.') $leadon = ''; if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/'; $startdir = $leadon; if($_GET['dir']) { //check this is okay. if(substr($_GET['dir'], -1, 1)!='/') { $_GET['dir'] = $_GET['dir'] . '/'; } $dirok = true; $dirnames = split('/', $_GET['dir']); for($di=0; $di
File
Size
Last Modified
'.$files[$i].''; $thumb2 = ' onmouseover="o('.$i.', \''.urlencode($leadon . $files[$i]).'\');" onmouseout="f('.$i.');"'; } if($filetypes[$ext]) { $icon = $filetypes[$ext]; } $filename = $files[$i]; if(strlen($filename)>43) { $filename = substr($files[$i], 0, 40) . '...'; } $fileurl = $leadon . $files[$i]; if(!$forcedownloads) { $fileurl = $_SESSION['PHP_SELF'] . '?dir=' . urlencode($leadon) . '&download=' . urlencode($files[$i]); } $fileurl = "../".$tempdir.$files[$i]; ?>
0KB
Jan 01 1970 01:00:00 AM
Thanks in advance
Tony
-
Re: EasyPopulate 4.0 Support Thread
Umm, unless can point to where this issue is addressed in this forum, nothing about that content has to do with this version of EP
-
Re: EasyPopulate 4.0 Support Thread
an error occurred while processing this directive
I'm trying to upload a new product list, with approx 6,800 products. Each time I do the upload, it crashes with the above error message displayed on a white screen. Also, the last product uploaded is different each time I run the upload, so I don't think there is an issue with uploaded data causing the crash. If I split the file into multiple uploads, (It splits this one into 2 uploads), the first one crashes, the second uploads fine.
I have looked for any error logs, but can't find one.
Any ideas??? Thanks!
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
RFree190
an error occurred while processing this directive
I'm trying to upload a new product list, with approx 6,800 products. Each time I do the upload, it crashes with the above error message displayed on a white screen. Also, the last product uploaded is different each time I run the upload, so I don't think there is an issue with uploaded data causing the crash. If I split the file into multiple uploads, (It splits this one into 2 uploads), the first one crashes, the second uploads fine.
I have looked for any error logs, but can't find one.
Any ideas??? Thanks!
From my quick internet search, it would appear that the issue is more related to your host to some extent than to EP4 and that the error logs will be logged with your host or wherever they store logs related to the site's operation as compared to the ZC cache (ZC < 1.5.1)/logs (ZC >= 1.5.1) folder. The next thought is that the problematic file be split again (and again) until the culprit entry(ies) are identified. It may also be necessary to split the files to a more refined limit... What is the difference in number of entries between the two files? (Ie. what was the record split number as compared to the total number?) If say the cutoff were 5,000, then the second file would only contain about 1,800... But if the split were 3,400 then basically they are equal files in rows of content. The difference in row last seen before the error is probably a result of caching in one respect or another or because there is different system response and action for an update as compared to an insertion. About how long is it taking for the data to be processed? I don't recall which setting(s) affect it, but I have seen something about timeouts occurring when trying to process a larger file even if the code is still actively processing the file. Just some ideas. :) The other thing that I found was to verify your file and folder permissions, but not so sure I see that as the issue here... (644 for files, and 755 for folders)
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
From my quick internet search, it would appear that the issue is more related to your host to some extent than to EP4 and that the error logs will be logged with your host or wherever they store logs related to the site's operation as compared to the ZC cache (ZC < 1.5.1)/logs (ZC >= 1.5.1) folder. The next thought is that the problematic file be split again (and again) until the culprit entry(ies) are identified. It may also be necessary to split the files to a more refined limit... What is the difference in number of entries between the two files? (Ie. what was the record split number as compared to the total number?) If say the cutoff were 5,000, then the second file would only contain about 1,800... But if the split were 3,400 then basically they are equal files in rows of content. The difference in row last seen before the error is probably a result of caching in one respect or another or because there is different system response and action for an update as compared to an insertion. About how long is it taking for the data to be processed? I don't recall which setting(s) affect it, but I have seen something about timeouts occurring when trying to process a larger file even if the code is still actively processing the file. Just some ideas. :) The other thing that I found was to verify your file and folder permissions, but not so sure I see that as the issue here... (644 for files, and 755 for folders)
Thanks for the quick reply.
I was doing some troubleshooting, using your idea of smaller "Splits" and think I tracked down the problem. I was using MS Access to compile a CSV of all my products. I have been doing this for years and have been using "chr(10) & chr(13)" to put line breaks and carriage returns into my product descriptions. For some reason, this broke my imports. Maybe it's the latest version of MS Access. I had been using Access 2007 for years, with success. This is my first time using Access 2013. I'm going to blame MS, as EP4 has worked for me in the past.
Thanks for your input. It helped me track down my issue.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
reetp
...code
Slight mod - needed to allow the file 'full-ep'
--- easypopulate_4-orig.php 2015-06-17 19:03:42.000000000 +0200
+++ easypopulate_4.php 2015-06-18 14:47:28.000000000 +0200
@@ -28,9 +28,9 @@
$ep_music = (int)EASYPOPULATE_4_CONFIG_MUSIC_DATA; // 0-Disable, 1-Enable
$ep_uses_mysqli = (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3' ? true : false);
-@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
+@set_time_limit($ep_execution); // execution limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
-if (!$error) {
+if (!isset($error)) {
$upload_max_filesize=ini_get("upload_max_filesize");
if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024;
if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024;
[root@home myadmin]# diff -ruN easypopulate_4_import-orig.php easypopulate_4_import.php
--- easypopulate_4_import-orig.php 2015-06-18 11:18:05.000000000 +0200
+++ easypopulate_4_import.php 2015-06-26 15:19:07.000000000 +0200
@@ -8,6 +8,34 @@
$file = array('name' => $_GET['import']);
$display_output .= sprintf(EASYPOPULATE_4_DISPLAY_LOCAL_FILE_SPEC, $file['name']);
+
+/*
+ * These are the filenames that we look for
+ *
+strtolower(substr($file['name'],0,11)) == "featured-ep")
+strtolower(substr($file['name'],0,15)) == "attrib-basic-ep"
+strtolower(substr($file['name'],0,18)) == "attrib-detailed-ep")
+strtolower(substr($file['name'],0,15)) == "sba-detailed-ep")
+strtolower(substr($file['name'],0,12)) == "sba-stock-ep")
+strtolower(substr($file['name'],0,15)) <> "categorymeta-ep")
+strtolower(substr($file['name'],0,7)) <> "attrib-")
+strtolower(substr($file['name'],0,4)) <> "sba-")
+strtolower(substr($file['name'],0,14)) == "pricebreaks-ep")
+*/
+
+$fileNameArray = array ("full-ep", "featured-ep", "attrib-basic-ep", "attrib-detailed-ep", "sba-detailed-ep", "categorymeta-ep", "attrib-", "sba-", "pricebreaks-ep");
+$discoveredFile = false;
+
+foreach ($fileNameArray as $key) {
+
+ $length = strlen ($key);
+ // probably better to do stristr but all the lines then need changing further down
+ if (strtolower(substr($file['name'],0,$length)) == $key) {
+ $discoveredFile = true;
+ }
+}
+
+if ($discoveredFile == true) { // we'll proceed
$ep_update_count = 0; // product records updated
$ep_import_count = 0; // new products records imported
@@ -1637,5 +1665,17 @@
} else {
$messageStack->add("File Import Completed.", 'success');
}
+}
+else {
+ $display_output .= '<h3>Finished Processing Import File</h3>';
+ $display_output .= '<br /><h3 style="color:red">Filename is wrong</h3> ';
+ $display_output .= '<br />Please check that the filename <b>starts</b> with the correct term';
+ $display_output .= '<br />The following are the permissible names :';
+ foreach ($fileNameArray as $key) {
+ $display_output .= "<br />" . $key;
+ }
+ $messageStack->add("File Import Failed.", 'error');
+
+} // End file check loop
} // END FILE UPLOADS
-?>
\ No newline at end of file
+?>
And a small patch to easypopulate.php itself to clear a small warning that was annoying me :-)
--- easypopulate_4-orig.php 2015-06-17 19:03:42.000000000 +0200
+++ easypopulate_4.php 2015-06-18 14:47:28.000000000 +0200
@@ -28,9 +28,9 @@
$ep_music = (int)EASYPOPULATE_4_CONFIG_MUSIC_DATA; // 0-Disable, 1-Enable
$ep_uses_mysqli = (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3' ? true : false--- easypopulate_4-orig.php 2015-06-17 19:03:42.000000000 +0200
+++ easypopulate_4.php 2015-06-18 14:14:01.000000000 +0200
@@ -30,7 +30,7 @@
@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
-if (!$error) {
+if (!isset($error)) {
$upload_max_filesize=ini_get("upload_max_filesize");
if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024;
if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024;);
-@set_time_limit($ep_execution); // executin limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
+@set_time_limit($ep_execution); // execution limit in seconds. 300 = 5 minutes before timeout, 0 means no timelimit
-if (!$error) {
+if (!isset($error)) {
$upload_max_filesize=ini_get("upload_max_filesize");
if (preg_match("/([0-9]+)K/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024;
if (preg_match("/([0-9]+)M/i",$upload_max_filesize,$tempregs)) $upload_max_filesize=$tempregs[1]*1024*1024;
-
Re: EasyPopulate 4.0 Support Thread
This entire week I've been trying to figure out how to provide comment to your code without running you away because these things don't get better without someone pointing out an issue. I have no control over your response and if it is to walk away or otherwise be upset, then so be it. Hopefully now you can look back at the suggestions of the last several posts, including the goal of being helpful to the newbie as well as not unnecessarily forcing existing users to make changes in how they operate and maybe see things a little differently.
In regards to the most recent post:
1) Wondered when you would figure that one out, and now 2) have added a restriction that didn't exist before and is truly unnecessary other than to suppport this error message. With that one single addition now all files must follow a specific naming convention not just the ones that require special/unique handling. I'll have my mod up in a bit, been trying to come up with decent terminology to display and maybe be acceptable to the eye. It doesn't restrict the ability to process files of any name, shows the naming convention expected to process that type of file, and provides the info on the first screen shot rather than after import "after the damage is done". The display of all file types on the first screen is switchable from all, to all in the designated directory to no help provided (ie, current view for those classic users :) ) with the default operation/install being all help. So those installing the update and wnting to not have this extra assistance will need to run a smidge of sql or store a constant somewhere to change the display of the min page away from the "full help".
-
Re: EasyPopulate 4.0 Support Thread
Version 4.0.30 has been pushed to github: https://github.com/mc12345678/EasyPopulate-4.0/ If found to be acceptable will have it merged into the version presented at the first post of this thread.
Adds a new switch to the configuration menu. If this switch is not entered, set, or reset then the full new method of filename display will be provided which may be considered annoying by those that have become accustomed to using EP4 as it is and understand the need to name certain files a certain way as outlined in the instructions. (If so, I suggest installing the below SQL through the tools -> Install SQL patches option or by selecting the un-install/reinstall links on the EP4 page and the SQL will take care of itself. Though remember to note any special settings on the admin's configuration panel before uninstalling.)
Also, the generation of a warning has been corrected. Previous use of would result in execution if $error was not set, was = null, was = false, or any other non-true type result. Problem is that now in certain versions of PHP, if the variable hasn't been declared (not set), then a warning is thrown so, to maintain continued functionality and prevent those warnings, the statement has been changed to
Code:
if ((isset($error) && !$error) || !isset($error))
This way, if it is set then can evaluate that it is not an error, or if it is not set at all (or if equal to null) then in either regards it is considered as being "addressed" and the software can move on.
So that SQL if you want to be lazy and install the software but only incorporate the one additional change:
Code:
SELECT @config_id:=configuration_group_id FROM configuration_group where configuration_group_title= 'Easy Populate 4' and configuration_group_description = 'Configuration Options for Easy Populate 4';
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show all EP4 Filetypes with Files', 'EP4_SHOW_ALL_FILETYPES', 'True', 'When looking at the EP4 Tools screen, should the filename prefix for all specific file types be displayed for all possible file types (True [default]), should only the method(s) that will be used to process the files present be displayed (False), or should there be no assistance be provided on filenaming on the main page (Hidden) like it was until this feature was added? (True, False, or Hidden)', @config_id , '25', NULL, now(), NULL, 'zen_cfg_select_option(array(\"True\", \"False\", \"Hidden\"),');
-
Re: EasyPopulate 4.0 Support Thread
I just had the module installed by my hosting company. I cannot download the Complete .csv file to edit (Attributes Not Included). I keep getting "WARNING: An Error occurred, please refresh the page and try again." even after I refresh the page.
I can download all the other files except this one (both the regular download and the temporary).
Thank you for any help or insight.
-
Re: EasyPopulate 4.0 Support Thread
Did you ask them to fix it? I mean if they installed it for you they should do it correctly. Just a thought.
Linda
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
kpshira
I just had the module installed by my hosting company. I cannot download the Complete .csv file to edit (Attributes Not Included). I keep getting "WARNING: An Error occurred, please refresh the page and try again." even after I refresh the page.
I can download all the other files except this one (both the regular download and the temporary).
Thank you for any help or insight.
While it helps to identify information contained in the posting tips, this first "step" can be offered without that information. If you have ZC 1.5.0 and below, check your cache directory, if ZC version 1.5.1 and above, check your logs directory for the most recent file starting with mydebug. This is likely an admin related log file, so if you could post the contents with your admin directory obscured, then perhaps the file(s) in question can be addressed. Could you also identify the version of EP4 that is being used as identified on the tools->Easy Populate v4 screen?
-
Re: EasyPopulate 4.0 Support Thread
What suggested improvements are there for the new disply formats provided on the tools screen based on the version identified at this post: https://www.zen-cart.com/showthread....20#post1285820
-
Re: EasyPopulate 4.0 Support Thread
I am running 1.5.4, this is the first mod installed on this configuration.
I installed this just fine on a client's site. Today, I installed it on mine (same hosts, etc.) and am getting a blank white page.
The error logs report
Code:
[07-Jul-2015 23:50:57 EST5EDT] [client 64.7.70.206 ] PHP Fatal error: Call to undefined function ep_4_chmod_check() in /big/dom/xwhatwouldwaltdo/www/.../easypopulate_4.php on line 74
The corresponding line is:
PHP Code:
73. // Pre-flight checks start here
74. $chmod_check = ep_4_chmod_check($tempdir);
75. if ($chmod_check == false) { // test for temporary folder and that it is writable
76. // $messageStack->add(EASYPOPULATE_4_MSGSTACK_INSTALL_CHMOD_FAIL, 'caution');
77. }
I already created the /temp directory within the Admin folder, I know that blew it up on my client's site.
I don't know what else to do to fix this. Any ideas?
-
Re: EasyPopulate 4.0 Support Thread
Reupload the admin/includes/functions/extra_functions/easypopulate_4_functions.php file.
That is the file that should contan the function.
-
Re: EasyPopulate 4.0 Support Thread
I just downloaded and installed EP4 and have to say install was easy and so far export and import is doing just fine. I had my reservations coming from Easy Populate after getting 'WARNING: An Error occurred, please refresh the...", then reading that someone with EP4 also had same issue. But took the dive and looking great!!
my ZC version is 1.5.4 with PHP Version: 5.5.26 (Zend: 2.5.0)
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
gcampos
I just downloaded and installed EP4 and have to say install was easy and so far export and import is doing just fine. I had my reservations coming from Easy Populate after getting 'WARNING: An Error occurred, please refresh the...", then reading that someone with EP4 also had same issue. But took the dive and looking great!!
my ZC version is 1.5.4 with PHP Version: 5.5.26 (Zend: 2.5.0)
Glad that thngs are working for you. One thing seen about Easy Populate related posting is that the version reported by the poster is not always the version installed, unfortunately... Yes, though there have been those occassions where software had to be removed and reinstalled or because of incomplete/inaccurate ZC/plugin upgrades an issue with the cart was identified. Mind indicating which version of EP4 was installed? Version number is provided on the tools->Easy Populate 4 screen.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
Glad that thngs are working for you. One thing seen about Easy Populate related posting is that the version reported by the poster is not always the version installed, unfortunately... Yes, though there have been those occassions where software had to be removed and reinstalled or because of incomplete/inaccurate ZC/plugin upgrades an issue with the cart was identified. Mind indicating which version of EP4 was installed? Version number is provided on the tools->Easy Populate 4 screen.
Yes no problem it is: Easy Populate 4.0.28 - Beta 01-03-2015
Thanks
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
gcampos
Yes no problem it is: Easy Populate 4.0.28 - Beta 01-03-2015
Thanks
Asked because I was a smidge confused about the post... Everything is working correctly thus far?
-
Re: EasyPopulate 4.0 Support Thread
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
Ignore this one.
Mind identifying what the issue was to all of those that received the first notification? :)
Otherwise, glad that the issue was resolved.
-
Re: EasyPopulate 4.0 Support Thread
What is the best program to edit the CSV files? I am having troubles with OpenOffice. I tried Notepad++ but it got pretty confusing.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
Mind identifying what the issue was to all of those that received the first notification? :)
Otherwise, glad that the issue was resolved.
When I edited it, it was a double post. But I don't see the other one. I am going to have to remember what I posted about lol!
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
What is the best program to edit the CSV files? I am having troubles with OpenOffice. I tried Notepad++ but it got pretty confusing.
So, open office has been the best program to use mostly because of it's direct support of UTF-8 character handling, date formatting and CSV formatting. I have recently seen instructions by internet search that have identified a way to maintain UTF-8 encoding when using the commercial program Microsoft Excel. The last time I tried it the major issue I encountered was how the date was formatted upon export and that it was not YYYY-MM-DD. That format is what is expected for date fields if they are to be contained in the upload... If the date field is not to be modified then would want to not include the field in the CSV file.
I have also seen some capability in Beyond Compare to manipulate CSV data, but then don't have spreadsheet related versatility.
What issues wth OO are being experienced?
-
Re: EasyPopulate 4.0 Support Thread
OO does open it fine and edit it fine, but when I import the edited file, it doesn't import correctly. All the data entered is randomly mixed up with other columns and stuff. It makes me think that maybe I am not saving it correctly so it is importing wrong. Is there a specific method to save it to make sure it doesn't get messed up?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
OO does open it fine and edit it fine, but when I import the edited file, it doesn't import correctly. All the data entered is randomly mixed up with other columns and stuff. It makes me think that maybe I am not saving it correctly so it is importing wrong. Is there a specific method to save it to make sure it doesn't get messed up?
More than likely that step is probably the issue. See post #10 about Open Office Settings for Export. Certainly the software has been updated a bit, but same basic process still seems to apply.
-
Re: EasyPopulate 4.0 Support Thread
I followed step #10 and added a couple of items. Here is the error it throws: http://www.pasteall.org/pic/91219
-
Re: EasyPopulate 4.0 Support Thread
No rows imported, or did only some of them? Contents of the file being imported? (Possibly post the first few lines if those did not import.) Before pasting, please click the # symbol in the toolbar above the text box, then paste.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
No rows imported, or did only some of them? Contents of the file being imported? (Possibly post the first few lines if those did not import.) Before pasting, please click the # symbol in the toolbar above the text box, then paste.
Nothing was imported.
Code:
v_products_model,v_products_type,v_products_image,v_products_name_1,v_products_description_1,v_products_url_1,v_specials_price,v_specials_date_avail,v_specials_expires_date,v_products_price,v_products_weight,v_product_is_call,v_products_sort_order,v_products_quantity_order_min,v_products_quantity_order_units,v_products_priced_by_attribute,v_product_is_always_free_shipping,v_date_avail,v_date_added,v_products_quantity,v_manufacturers_name,v_categories_name_1,v_tax_class_title,v_status,v_metatags_products_name_status,v_metatags_title_status,v_metatags_model_status,v_metatags_price_status,v_metatags_title_tagline_status,v_metatags_title_1,v_metatags_keywords_1,v_metatags_description_1
,1,,Laconiko Olive Oil - 16.9 fl.oz,"Laconiko olive oil is a fourth generation family of olive oil producers whose estate is on the sandy beaches of Southern Peloponnese, just outside Sparti, Greece. The relatively small number of olive trees on their estate, surrounded by orange and grapefruit trees, allows for an olive oil that is unique and wonderful. The family is committed to bringing a true extra virgin olive oil to the States. Brothers, Diamantis and Dino, reside in Gainesville, VA, but take turns returning to their family's olive estate to work the land with their father. Laconiko olive oil is on Weston A. Price's ""best"" list for their shopping guide. http://laconiko.com/index.html Each bottle is 500mL/16.9fl.oz.",,,,,25,0,0,0,1,1,0,0,,2015-07-27 15:23:09,6,,"Honey, Olive Oil, Tea, FireCider",--none--,1,0,0,0,0,0,,,
,1,,Laconiko Olive Oil - Value Size - 67.6 fl.oz,"The 2-litre value size of the Laconiko Olive Oil. Save $25 by purchasing this size! <p> Laconiko olive oil is a fourth generation family of olive oil producers whose estate is on the sandy beaches of Southern Peloponnese, just outside Sparti, Greece. The relatively small number of olive trees on their estate, surrounded by orange and grapefruit trees, allows for an olive oil that is unique and wonderful. The family is committed to bringing a true extra virgin olive oil to the States, this years harvest has a low acidity of 0.13% (to be an extra virgin acidity must be below 0.8%). Brothers, Diamantis and Dino, reside in Gainesville, VA, but take turns returning to their family's olive estate to work the land with their father. Laconiko olive oil is on Weston A. Price's ""best"" list for their shopping guide. http://laconiko.com/index.html",,,,,75,0,0,0,1,1,0,0,,2015-07-27 15:26:34,4,,"Honey, Olive Oil, Tea, FireCider",--none--,1,0,0,0,0,0,,,
,1,,Wild Alaskan Salmon,"Wild Caught Bristol Bay, Alaskan Salmon Filet Portions $18/lb. (NOW IN SMALLER PORTIONS! .4 lb./package). <p> We came across a northern Virginia native who has relocated to Bristol Bay Alaska as a fisherman! Here is the fisherman's description: ""Wild caught in Bristol Bay, Alaska, the largest true certified wild sustainable salmon fishery in the world. After being caught, fish are bled on the spot for higher quality, then stored in 33-35 degree refrigerated seawater until off loaded to tender-ships. Tender-ships transport the salmon from the fishing grounds to the salmon processing plant where the fish are filleted, de-boned and flash frozen. This entire process takes place from the water to the freezer all within 24-30 hours. I have been a Professional Commercial Fishermen in Bristol Bay, Alaska, for seven years. Originally growing up in Fairfax, Virginia I started off by bringing back personally caught fish for family and friends to enjoy. After taking extreme care of our fish on the fishermen's side, I have seen the poor quality of salmon offered in local stores. Therefore, I am offering the highest quality salmon available. Our salmon comes directly from me the fishermen then to you, the consumer.""",,,,,18,0,0,0,0.4,0.4,0,0,,2015-07-27 15:32:29,445.24,,Salmon,--none--,1,0,0,0,0,0,,,
That is what Notepad++ shows. That is after I exported the file from OO. I notice that there is no double quotes.
-
Re: EasyPopulate 4.0 Support Thread
Well, the "error" is reporting what is true with that file. The first column that has the header: v_products_model does not have any data in it.
As to the double quotes, there are occasion of double quotes in the file where basically at least in one instance a comma (field separator) was within the section of information to be updated. Notice in the first row of data the comma after Southern Peloponnese.
-
Re: EasyPopulate 4.0 Support Thread
But when I imported the file into OO, there was no data in that column for the items already there. Can I delete that column and not have an error?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
But when I imported the file, there was no data in that column for the items already there. Can I delete that column and not have an error?
For the moment no. EP4 works off of the model field, expecting every product to have a unique model. There are ways to autopopulate the database with a unique model number so that upon export, a model number would be present, the data modified then the import would make the change.
If there are/were no model # information in the initial export, then could do the following:
In the ZC admin-> tools->install SQL Patches box:
Code:
Update products set products_model = products_id;
Could concat() information to make it ever more unique or could only update values where products_model = '' or IS NULL, etc...
-
Re: EasyPopulate 4.0 Support Thread
That worked great! Thanks!
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
That worked great! Thanks!
Glad that worked, just remember now though how the software works as currently written. All product to have a model number, if the model number in one row of data is the same as another, then the later row wll "replace" the content of the previous. The model # can be anything desired that fits within the model field. Also verify on your site side that you are okay with the current results of having a model # flled in the way it is...
-
Re: EasyPopulate 4.0 Support Thread
Ok. Now, if I want to update a item, do I just use the same model number to update a particular field or what?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
Ok. Now, if I want to update a item, do I just use the same model number to update a particular field or what?
When uploading/importing, yes basically, model number identified will be updated with the contents of the field header along the top. If you're doing a onsey, twosey type update, just include those rows in your upload file.
The best thing to do though is basically go through the readme, export the file(s) for the type of action desired, and when trying something "new", use a single row first. This program modifies the database, so it is always suggested to backup (use of a development site to try new processes is also suggested). There are a few different backup tools available in the plugins section. DrBytes' database backup utility is pretty useful.
-
Re: EasyPopulate 4.0 Support Thread
That makes sense! Thanks!!
-
Re: EasyPopulate 4.0 Support Thread
Having a problem that I am uploading attributes with the basic attributes uploader following the template given by easy populate
I get the following message
Updated records: 2229
New Imported records: 0
Errors Detected: 0
Warnings Detected: 0
however, these are actually all new imported records?? I am not sure why this is happening or what I am doing wrong.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
fabburl
Having a problem that I am uploading attributes with the basic attributes uploader following the template given by easy populate
I get the following message
Updated records: 2229
New Imported records: 0
Errors Detected: 0
Warnings Detected: 0
however, these are actually all new imported records?? I am not sure why this is happening or what I am doing wrong.
Well, the reason for the above result is because the following sql when executed/queried provided a non-zero number of returned rows and as a result an update was performed:
Code:
"SELECT * FROM "
.TABLE_PRODUCTS_ATTRIBUTES. "
WHERE
products_id = '".$v_products_id."' AND
options_id = '".$v_products_options_id."' AND
options_values_id = '".$a_products_options_values_id."'"
Each of the variables are collected by related queries above the condition.
This is of course assuming that the filename follows the convention of beginning with
attrib-basic-ep
Otherwise, the result is because the records were being updated as a full import or some other import style...
-
Re: EasyPopulate 4.0 Support Thread
Ah, I did not know the filename has to start with attrib-basic-ep - I assumed any name was fine. I will try again with that name then.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
fabburl
Ah, I did not know the filename has to start with attrib-basic-ep - I assumed any name was fine. I will try again with that name then.
While minimally documenated it s covered in the readme... Also, may I suggest downloading/installing verson 4.0.30 whch translates those requirements to the admin window...
-
Re: EasyPopulate 4.0 Support Thread
hello,
I'm using zen cart v1.5.4 and latest easy populate version. The installation went smoothly but I don't know how to enable the Custom Products Fields.
I've read that I should add extra plugins for this ( you mentioned that for short descriptions and upc you've designed it) but I could find only this:
https://www.zen-cart.com/search.php?searchid=3539052
I've also read that you just have to enter the field in the feed and it automatically generates the field?
I also see that I can use the User Defined Products Fields. Should I just generate the UPC field inside it and ignore the custom product fields?
I've also found that I should have true false buttons for each field into the configuration/easy populate 4 section?
https://www.zen-cart.com/showthread....-Thread/page42
Can you please tell me how I can do it? I didn't try any of the versions because I don't want to mess up.
Please let me know the best way to proceed.
If it's field related can you please tell me what title I should enter for the row?
-
Re: EasyPopulate 4.0 Support Thread
To my knowledge, Easy populate does not give you Custom Product Fields. But if you have coded them and added them yourself, you can make easy populate recognize them by adding them in the configuration for easy populate under admin, where you see the custom products field. For example, if you have created the field SKU, then if you enter in the configuration file, easy populate will add a column for that when it creates your CVS file.
So are you looking to create a custom field?
-
Re: EasyPopulate 4.0 Support Thread
I do want to make one thing clear, *I* did not write this code and have only continued to add to it.
As lruskauf stated, EP4 does not create new fields in the database, it accesses them and recognizes select fields to support "common" new fields.
If when you export say the full products and review the headers of the csv file to find that a field is not there but known to be in the products table, the "missing" field can be identified. To have a field from the products table exported/imported (when not already part of the export) goto the configuration window for EP4, edit the custom fields entry, add the field name as it is identified in the products table. (Ie., do not include the first v_ that is shown in the csv file)
Regarding the indicators on the tools->Easy Populate v4 window, they indicate true if the associated field/feature exists in the database.
-
Re: EasyPopulate 4.0 Support Thread
For what it's worth, in an effort to expand the use of EP4 outside of it's current English based and partially incorporated German based language, I attempted to establish an account on the italian version of the ZC site seeing that there was someone there having difficulty with EP4. I may not be fluent in italiian, but figure that there are enough tools to translate that at least I could provide some suport.. Anyways, I am hoping that if there are those that can help translate some of the text of EP4 that they may offer their translatons for incorporaton, or if they have already done so that they offer the rewritten version, I will incorporate the translation(s).
Thanks.
-
Re: EasyPopulate 4.0 Support Thread
Hello,
EP4 works like a charm for me!
But i have a problem and i hope anyone can help me with this.
I would like to add meta tags for alot of categories (around 4000).
With EP4 i can export Categories Only (with Metatags). But when i fill in all the meta tags and upload it, i get the error message No product model.
Categories Only (with Metatags) .csv shows the v_categories_name_2 only as a single name (no ^) , so it also creates new categeories on first level.
Is it possible to add the Meta tags to categories only based on Category ID instead of product model?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
RonaldNavarro689
......The installation went smoothly but I don't know how to enable the Custom Products Fields......
These are the plugins that you can add to your shop. If you go to Short Description plugin and install, obviously following the instruction, you will find that 'Product Short Descriptions' has turned from 'false' to 'True'
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
JvRossem
Hello,
EP4 works like a charm for me!
But i have a problem and i hope anyone can help me with this.
I would like to add meta tags for alot of categories (around 4000).
With EP4 i can export Categories Only (with Metatags). But when i fill in all the meta tags and upload it, i get the error message No product model.
Categories Only (with Metatags) .csv shows the v_categories_name_2 only as a single name (no ^) , so it also creates new categeories on first level.
Is it possible to add the Meta tags to categories only based on Category ID instead of product model?
This particular upload option is filename dependent as the instructions indicate and the unaltered options of version 4.0.30 offer. The filename prefix must contain the letters categorymeta-ep in any sequence of capitalization.
Import of a file named this way would not reassign a product to a new category.
Suggestion is to select Categories Only (with Metatags) from the tools->Easy Populate 4 window, review the entries provided there. Copy this file renaming/modifying the date information or adding beyond that, modifying the data in the fle, uploading and then importing the new file.... Then report any issues that may be had...
In summary, categories do not have model numbers, therefore the issue experienced is related with incorrect operation of the plugin. In this case the prefix of the filename is important as it acts like a switch to process the data for a specific action.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
This particular upload option is filename dependent as the instructions indicate and the unaltered options of version 4.0.30 offer. The filename prefix must contain the letters categorymeta-ep in any sequence of capitalization.
Import of a file named this way would not reassign a product to a new category.
Suggestion is to select Categories Only (with Metatags) from the tools->Easy Populate 4 window, review the entries provided there. Copy this file renaming/modifying the date information or adding beyond that, modifying the data in the fle, uploading and then importing the new file.... Then report any issues that may be had...
In summary, categories do not have model numbers, therefore the issue experienced is related with incorrect operation of the plugin. In this case the prefix of the filename is important as it acts like a switch to process the data for a specific action.
Thank you for your help! I named the file CategoryMeta-EP and all category metas where added without any problems!
-
Re: EasyPopulate 4.0 Support Thread
I have just installed for v1.54. Am getting error: Easy Populate "Uploads Folder" missing!
Your uploads folder is missing. Your configuration indicates that your uploads folder is named mydemostore/temp/ Error Opening Upload Directory: mydemostore/temp/
I did go to configuration and modify upload folder, and set permissions to 755. It is located in my store folder, not admin. What else am I missing to correct this error?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
sparrowce
I have just installed for v1.54. Am getting error: Easy Populate "Uploads Folder" missing!
Your uploads folder is missing. Your configuration indicates that your uploads folder is named mydemostore/temp/ Error Opening Upload Directory: mydemostore/temp/
I did go to configuration and modify upload folder, and set permissions to 755. It is located in my store folder, not admin. What else am I missing to correct this error?
As compared to the root of your store, your upload directory is whatever is in the configuration window for EP4 in the Uploads Directory added to the directory path DIR_FS_CATALOG as identified in the admin configure.php file.
So if the field reads mydemostore/temp/ then it is search for at DIR_FS_CATALOG . 'mydemostore/temp/'
-
Re: EasyPopulate 4.0 Support Thread
Is EasyPopulate and Easy Populate CSV the same product?
I downloaded Easy Populated CSV (easy_populate_csv_for_zencart_v1.5.x_v1.2.6.zip) and followed the installation instructions. When I go to Admin->Tools->Easy Populate I get a message box saying "Warning Easy Populate Configuration Missing. Please install your configuration by clicking here". But when you click on the HERE link it wants to execute "<domain>/estore/zenadmin/easypopulate.php?langer=installnew" and says an error occurred. If I go to Admin->Configuration there is nothing there for Easy Populate.
What am I missing?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
citapinc
Is EasyPopulate and Easy Populate CSV the same product?
I downloaded Easy Populated CSV (easy_populate_csv_for_zencart_v1.5.x_v1.2.6.zip) and followed the installation instructions. When I go to Admin->Tools->Easy Populate I get a message box saying "Warning Easy Populate Configuration Missing. Please install your configuration by clicking here". But when you click on the HERE link it wants to execute "<domain>/estore/zenadmin/easypopulate.php?langer=installnew" and says an error occurred. If I go to Admin->Configuration there is nothing there for Easy Populate.
What am I missing?
No they are not the same product, though both have a langer "heritage" in their history... They are two separate variants and Easy Populate CSV has its own support thread. This thread is for EP4, although both provide CSV files. If there are issues with Easy Populate CSV, the I suggest seeking out assistance on that forum. Otherwise, this version of EasyPopulate has been stable and functional. See the first post of the thread for the location to download the accepted version. Otherwise I have been providing advance copies of the version to be accepted as posted in this thread....
-
Re: EasyPopulate 4.0 Support Thread
That was it, thank you! I was listing the store directory/temp folder, and the store directory was already in the path you mentioned in configure.php
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
sparrowce
That was it, thank you! I was listing the store directory/temp folder, and the store directory was already in the path you mentioned in configure.php
Glad that fixed/cleared it up...
Fyi, an upcoming version change is going to have an admin switch to identify if the temp files are in the store's directory or the admin directory and then from there the path is entered. The idea is that the admin directory would not be directly entered into the database (not currently there in a default install, why add it?) Also there are those that have found a legitimate use of it being in one side or the other as well as other locations on the server.
Hopefully won't be too (or more) confusing.
-
Re: EasyPopulate 4.0 Support Thread
Update: export went fine, modified some product descriptions, uploaded the modified .csv file, got the message the file uploaded successfully - but when I checked the products I'd modified, none had changed. They still had their old description. Maybe I am not understanding how this works. This is the last part of my 1.54 demo test before going live with it and switching off 1.39h. In 1.39h, I used the old Easy Populate, and very often used this method to modify descriptions or prices. But it is not working for me, and maybe things have changed. I am really wanting a way to bulk modify the catalog like I did in 1.39h. Are my expectations wrong, or do I need to look deeper in the install part? Thank you.
-
Re: EasyPopulate 4.0 Support Thread
Do you have linked product? Meaning does the same model# appear multiple times in your file? If so, the last version of the modified information is what will stay "visible". In other words first version was changed, but then the second was not and so on import the description was modified away from the original and then back to it...
-
Re: EasyPopulate 4.0 Support Thread
Thanks . . . no linked products, and no duplicate model numbers that I am seeing. As a side question, I don't see that the product ID is part of the download. That seems to be a unique ID that would match records one for one. Just curious as to why this isn't used, and is there a way to add it to the download? I use the ID for my direct links to products on my ezpages and it would be helpful to have it in the export. I will do some more testing tomorrow. Appreciate the info about linked products and model numbers, that is good to know.
-
Re: EasyPopulate 4.0 Support Thread
Please take a moment to read through the info in the download... It is just enough to explain the software, but not so much to take an eternity.
The software is expected to work as you have described that you would like it to do; however, from this end any further "guesses" will be just that... Either no one uses the software or no one has legitimately been unable to update/modify product descriptions and as a result moved on to something else...
The only hard and fast issue seen has been with working with a few specific languages: russian, I think japanese, can't remember which else, but if not mistaken some of those issues really come from Open Office and saving the languaged file(s)... Been a while since I last tried to figure out the cause of that...
-
Re: EasyPopulate 4.0 Support Thread
OK silly question time:
I want to change the category that a lot of my products are in, so, if I use this plugin to download all my products, change the category of the products then upload. The question is will I duplicate the products in the different categories or will the category be over written by the new category?
Told you it is a silly question! :blush:
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
adb34
OK silly question time:
I want to change the category that a lot of my products are in, so, if I use this plugin to download all my products, change the category of the products then upload. The question is will I duplicate the products in the different categories or will the category be over written by the new category?
Told you it is a silly question! :blush:
Actually, not as silly as you may think. Normally this will create a linked product (duplicate but not so much a duplicate as it maintains the same products_id).
There currently is no "remove a product from a category" type feature... If a product being processed on import is in the category "assigned", then nothing is done, if it is not in the category that is assigned/determined in the process, then the product is added to the category (if the category didn't exist before, then it is created before this addition).
Removal from a category is somewhat of a two step process. The product's master_categories_id in the products table needs to reflect an existing category and the table products_to_categories needs to have the entry for the products_id removed for the category from which it is leaving and if not already associated with the new category an entry made... I did not find any code that did a delete on the products_to_categories table on import and there is nothing that specifically modifies an existing master_categories_id entry other than a product update with master_categories_id as a user defined field. The only other instance of affecting the master_categories_id is upon initial insert of a product as it must have/maintain a master_categories_id assigned.
So, removal of a product from one category (ie part of a process to move a product from one category to another) is not yet in the code... Perhaps can come up with something like another status switch that would "reassign" the master_categories_id to the chosen category and remove the linked product from the products_to_categories table in relation to the previous master category (status of 9 deletes a product, perhaps a different number could be used to do a move). It would not *directly* resolve issues associated with other linked product, but it would support a move action... Technically if the product were moved through each respective linked category, then there would remain but one category associated with the product (this could be accomplished in a single file upload where each line of the file had the product moved to each linked category and then a final move to the desired end category...)
Perhaps if considered further necessary (large issue with linked product) an additional option (dropdown, link, whatever) to address just bulk linked product changes would help...
I would suggest though in the interim not counting on the above to happen/be implemented quickly... Work on this is generally a free time dependent project, though now that a path is seen, it may not be as long as originally anticipated and there are other factors that could make it go faster. :)
-
Re: EasyPopulate 4.0 Support Thread
[QUOTE=mc12345678;1290615]Actually, not as silly as you may think...... (abbreviated) QUOTE]
I do understand this is a work in progress and some options are not available.
I have had a thought on this;
What is your [key]_id? If you identify one then set up the upload so that it over writes the that [key]_id and if not there then add. I know this does not over come the duplicated product?
I do not know what it is called, but, when you look at a downloaded file there is a number in the very first column just labelled 'id' could you tie everything to that?
andy
-
Re: EasyPopulate 4.0 Support Thread
When you want to MOVE ALL products to a new category - this is what works for me.
I would try it with a category that has very few products (and even do as practice
because there is nothing more tedious that removing items ONE by @#$@%# One
and besides, what does a former blonde know "for sure"
Use EZPop to download the category you are "closing out"
I like to save it to the desktop with a name that will remind what it is "just in case" you need to put stuff back
much less taxing than a full back up
after that, you are using other functions of Zen
Make a note of the old category NUMBER - this will correspond to the number 8 in the explanation
Create new Category & note that number as well - this will correspond to the 22 in the explanation
select any product that you want in the new category
Click on the C for copy
from the copy menu on your right
scroll down and select
Multiple Categories Link Manager
Scroll donw to
Global Category Link Changes and Master Category ID Reset
Using the first function: Copy ALL Products in a category as linked...
Enter Old Category Number (and I really wish that word was there )
In the box next to "Select All Products in Category"
Enter NEW Category Number in the "Link to Category"
Click" copy products as Linked
(note it would be REALLY Nice to be able to Copy products as Duplicates
Next, (third function down) Enter the NEW category number
in the box:
Reset the Master Categories ID for All Products in Category:
Click: Reset Master...
Finally ( and this is where I usually manage to screw up)
Middle function:
Remove ALL Products in a Category that are LINKED....
Enter OLD number in Select All Products in Categoy
enter NEW number in Remove from being linked
Now check your work in case I (as I often might) have the placement of old and new confused.
-
Re: EasyPopulate 4.0 Support Thread
If I want to adjust a column in the data base which is not exported by default (for example the column STOCK_LIMITED) can I include a header for it in the CSV file and import or do I need to add that somewhere in the code?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
If I want to adjust a column in the data base which is not exported by default (for example the column STOCK_LIMITED) can I include a header for it in the CSV file and import or do I need to add that somewhere in the code?
If the field (column) STOCK_LIMITED is in the products table, then it is easily included by entering the field in the custom_fields option under configuration->Easy Populate 4 and it will be included in applicable exports and imports.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Blenderite
If I want to adjust a column in the data base which is not exported by default (for example the column STOCK_LIMITED) can I include a header for it in the CSV file and import or do I need to add that somewhere in the code?
You also need to enter it in the admin under configuration->ep4
Enter any extra fields as user defined.
-
Re: EasyPopulate 4.0 Support Thread
Further, if don't know the location of the field in the database, there is no harm in adding the field in the user defined option and then exporting the full products option. If the field appears, then it is in the products table, if not then more "investigation" is necessary. When entering the field name, enter it as it appears in the database table (typically without v_)
-
Re: EasyPopulate 4.0 Support Thread
Quote:
One of those things that not everyone uses, so it seems that it was left off as a default like option, but is something still possible.
I've always written my import routines to show all fields and let the user determine which field they don't want to import. Most users who use import tools like this are your more advanced users who have an understanding of what fields are and how to remove them off the CSV file if not needed.
Therefore I'd rather see ALL fields in the CSV file than MOST USED fields.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
citapinc
I've always written my import routines to show all fields and let the user determine which field they don't want to import. Most users who use import tools like this are your more advanced users who have an understanding of what fields are and how to remove them off the CSV file if not needed.
Therefore I'd rather see ALL fields in the CSV file than MOST USED fields.
So I believe that it was this aspect that was considered by the original author/rewriter (chadder) in that the option to add fields was made available through the configuration menu... It has also been identified by some that export (well seems to have been more of an import issue) of all fields regardless of "desire" takes additional time, space, and effort to remove the undesired option(s)...
There is also the level of support aspect to be provided when/if all fields are exported and the issues involved with making changes and then importing them again... For example, while I'm about to release a version that will work off of products_id, there is little that can be offered as error buffers to prevent someone from mangling their database... Backup before uploading... That's about the most that can be offered... Or at least at the moment the most that I can offer on a volunteer basis...
Yes, up front the products table could be evaluated on each export and all fields added to the export file... The entire database could be so processed, but is that what is needed? Or are things like that needed by the few that either can modify the code to accomplish the desired task or seek assistance to make it happen? As I said more than 2 years ago, EP4 is so adaptable and compartmentalized enough that either one compartment can be modified to obtain the desired results or duplicated to provide the modified results... There are still a few minor things to work out, but it is quite a power house... I've also been thinking about how chadder and I can work the instructions a little more in favor of a "I want to do this" type style rather than a this is how this feature works style... Reason? Well look at the number of times that the filename has been an issue in the last several pages... It's in the instructions (limited that they are), but I have refrained from going that short of a response...
Afterall, someone identified that there was an issue with specials when this code was run on PHP 5.6 I think it was because of the way dates were handled on import... That was good feedback and would like to see issues like that identified more publicly as I had to dig to find that someone had identified that problem... There have been things added based on others needs and inquiries, but I do have a concern of adding too many/too many more switches to support "branches"... I'm beginning to consider adding notifiers and observers so that various "features" can be added through file uploads instead... More to contemplate on that one though..
-
Re: EasyPopulate 4.0 Support Thread
Is there a sample file floating around that I could use to start putting together my products list?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
outeredge2
Is there a sample file floating around that I could use to start putting together my products list?
Not to be smart, but if you export your products list you'll have your own personal sample file... (Covered in instructions on how to use and learn to use the program)
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
mc12345678
Not to be smart, but if you export your products list you'll have your own personal sample file... (Covered in instructions on how to use and learn to use the program)
Not being smart at all..... I appreciate the response. Will look for it.
Question:
What is the difference between EasyPopulate 4.0 and Easy Populate 1.2.5.4? Which is better and easier to use?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
outeredge2
Not being smart at all..... I appreciate the response. Will look for it.
Question:
What is the difference between EasyPopulate 4.0 and Easy Populate 1.2.5.4? Which is better and easier to use?
I humbly can not answer the question of "which is easier" as I have not used the other version in a great deal of time if at all... I think I came across the issues that have not been addressed in that version and then when seeing what features were available in this one I made my decsion and as you can see do things to keep it afloat and fnd ways to make improvements (though really little has been needed to accomplish that because of the work put nto it.)
But if not mistaken the other version doesn't support attributes, so I've heard. If a rumor, please disspell it... On the topic of attributes through the need of someone else and their permission some functionality was added to work with SBA (primarily as reworked by potteryhouse.)
So hopefully the regular users of the program will chime in as they are the ones deal with it (or the other) routinely.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
adb34
OK silly question time:
I want to change the category that a lot of my products are in, so, if I use this plugin to download all my products, change the category of the products then upload. The question is will I duplicate the products in the different categories or will the category be over written by the new category?
Told you it is a silly question! :blush:
Quote:
Originally Posted by
mc12345678
Actually, not as silly as you may think. Normally this will create a linked product (duplicate but not so much a duplicate as it maintains the same products_id).
There currently is no "remove a product from a category" type feature... If a product being processed on import is in the category "assigned", then nothing is done, if it is not in the category that is assigned/determined in the process, then the product is added to the category (if the category didn't exist before, then it is created before this addition).
Removal from a category is somewhat of a two step process. The product's master_categories_id in the products table needs to reflect an existing category and the table products_to_categories needs to have the entry for the products_id removed for the category from which it is leaving and if not already associated with the new category an entry made... I did not find any code that did a delete on the products_to_categories table on import and there is nothing that specifically modifies an existing master_categories_id entry other than a product update with master_categories_id as a user defined field. The only other instance of affecting the master_categories_id is upon initial insert of a product as it must have/maintain a master_categories_id assigned.
So, removal of a product from one category (ie part of a process to move a product from one category to another) is not yet in the code... Perhaps can come up with something like another status switch that would "reassign" the master_categories_id to the chosen category and remove the linked product from the products_to_categories table in relation to the previous master category (status of 9 deletes a product, perhaps a different number could be used to do a move). It would not *directly* resolve issues associated with other linked product, but it would support a move action... Technically if the product were moved through each respective linked category, then there would remain but one category associated with the product (this could be accomplished in a single file upload where each line of the file had the product moved to each linked category and then a final move to the desired end category...)
Perhaps if considered further necessary (large issue with linked product) an additional option (dropdown, link, whatever) to address just bulk linked product changes would help...
I would suggest though in the interim not counting on the above to happen/be implemented quickly... Work on this is generally a free time dependent project, though now that a path is seen, it may not be as long as originally anticipated and there are other factors that could make it go faster. :)
Below is the code described above that I have prepared... I keep looking at it to ensure that each possibility is addressed and while I see that some conditions seem to be over described, I didn't want to eliminate the potential code needed to address the possibility of that condition. Would appreciate any operational testing feedback.. I've set up some tests that seem to have worked but could use some independent verification.
So beginning in EP4 version 4.0.29 the following code begins at line 1508. The code begins at other locations for earlier versions but until now has remained relatively consistent code.
Quote:
The expectation of the below code is that if the status of a product is set to 7 (instead of the typical 0 to disable, 1 to enable, or 9 to delete), then the category of that row will become the master category for that item and the product will be removed from the previous master category. With the appropriate series of applicable add and move database entries a product's linked categories can be stripped, the master category revised to the desired category.
I chose the number 7 to be non-adjacent to the number 9, but I also am concerned that for those using a number pad without looking at the pad that they may incorrectly enter 9 instead of 7; however, also hope that the difference in shape (sharp corners (7) versus rounded (9) or what is likely to be a majority (1 or 0) will stand out a little..) Could use a two+ digit status indicator or maybe a "word", but I'm going with what I got at the moment.
Find:
Code:
//==================================================================================================================================
// Assign product to category if linked
// chadd - need to dig into further
if (isset($v_categories_id)) { // find out if this product is listed in the category given
$result_incategory = ep_4_query('SELECT
'.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id,
'.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id
FROM
'.TABLE_PRODUCTS_TO_CATEGORIES.'
WHERE
'.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND
'.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id);
if (($ep_uses_mysqli ? mysqli_num_rows($result_incategory) : mysql_num_rows($result_incategory)) == 0) { // nope, this is a new category for this product
$res1 = ep_4_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)
VALUES ("'.$v_products_id.'", "'.$v_categories_id.'")');
if ($res1) {
zen_record_admin_activity('Product ' . (int)$v_products_id . ' copied as link to category ' . (int)$v_categories_id . ' via EP4.', 'info');
}
} else { // already in this category, nothing to do!
}
}
//==================================================================================================================================
And replace with:
Code:
//==================================================================================================================================
// Assign product to category if linked
// chadd - need to dig into further
if (isset($v_categories_id)) { // find out if this product is listed in the category given
$result_incategory = ep_4_query('SELECT
'.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id,
'.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id,
'.TABLE_PRODUCTS.'.master_categories_id
FROM
'.TABLE_PRODUCTS.'
LEFT JOIN
'.TABLE_PRODUCTS_TO_CATEGORIES.' ON ('.TABLE_PRODUCTS.'.products_id = '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id AND '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id.')
WHERE
'.TABLE_PRODUCTS.'.products_id='.$v_products_id);
$result_incategory = ($ep_uses_mysqli ? mysqli_fetch_array($result_incategory) : mysql_fetch_array($result_incategory));
if (!zen_not_null($result_incategory['products_id']) || sizeof($result_incategory) <= 0 /* ($ep_uses_mysqli ? mysqli_num_rows($result_incategory) : mysql_num_rows($result_incategory)) == 0 */) { // nope, this is a new category for this product
if ($items[$filelayout['v_status']] == 7) {
/* $result_incategory = ep_4_query('SELECT
'.TABLE_PRODUCTS.'.master_categories_id
FROM
'.TABLE_PRODUCTS.'
WHERE
'.TABLE_PRODUCTS.'.products_id='.$v_products_id);
$result_incategory = ($ep_uses_mysqli ? mysqli_fetch_array($result_incategory) : mysql_fetch_array($result_incategory)); */
//do category move action.
// if the master_categories_id != categories_id, then for "safety" sake, should successfully insert the product to the category before deleting it from the previous category. Should also verify that the master_categories_id is set, because if it is not then there is a bigger issue. As part of the verification, if it is not set, then don't try to delete the previous, just add it and provide equivalent information.
if ((int) $result_incategory['master_categories_id'] != (int) $v_categories_id) {
//move is eminent
if ($result_incategory['master_categories_id'] > 0) {
//master_category is assigned to the product do the move.
// Ensure the product still is on the way to the move and available.
$res1 = ep_4_query('INSERT INTO ' . TABLE_PRODUCTS_TO_CATEGORIES . ' (products_id, categories_id)
VALUES (' . $v_products_id . ', ' . $v_categories_id . ')');
if ($res1) {
//Successfully inserted the product to the category, now need to remove the link from the previous category.
$res1 = ep_4_query('UPDATE ' . TABLE_PRODUCTS . ' set master_categories_id = ' . $v_categories_id . '
WHERE products_id = ' . $v_products_id);
$res2 = ep_4_query('DELETE FROM ' . TABLE_PRODUCTS_TO_CATEGORIES . ' WHERE products_id = ' . $v_products_id . ' AND categories_id =
' . $result_incategory['master_categories_id']);
if ($res1 && $res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' moved to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else if ($res1 && !$res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' master_categories_id changed to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else if (!$res1 && $res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' deleted from category ' . (int) $result_incategory['master_categories_id'] . ' and added to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else if (!$res1 && !$res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' copied as link to category ' . (int) $v_categories_id . ' via EP4.', 'info');
}
}
} /* EOF Master Category is set */ else {
//master_category is not assigned, assign the category to the master category and do the move.
$res1 = ep_4_query('INSERT INTO ' . TABLE_PRODUCTS_TO_CATEGORIES . ' (products_id, categories_id)
VALUES (' . $v_products_id . ', ' . $v_categories_id . ')');
if ($res1) {
//Successfully inserted the product to the category, now need to remove the link from the previous category.
$res1 = ep_4_query('UPDATE ' . TABLE_PRODUCTS . ' set master_categories_id = ' . $v_categories_id . '
WHERE products_id = ' . $v_products_id);
if ($res1) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' moved to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' copied as link to category ' . (int) $v_categories_id . ' via EP4.', 'info');
}
}
} // EOF Master category is not defined.
} // End if master and category different, nothing else to do as no where to go because both are the same...
} /* EOF status == Move */ else {
$res1 = ep_4_query('INSERT INTO ' . TABLE_PRODUCTS_TO_CATEGORIES . ' (products_id, categories_id)
VALUES (' . $v_products_id . ', ' . $v_categories_id . ')');
if ($res1) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' copied as link to category ' . (int) $v_categories_id . ' via EP4.', 'info');
}
} // Don't move the product
} else { // already in this category, nothing to do! // Though may need to do the move action so there is still possibly something to do...
if ($items[$filelayout['v_status']] == 7) {
// $result_incategory = ($ep_uses_mysqli ? mysqli_fetch_array($result_incategory) : mysql_fetch_array($result_incategory));
//do category move action.
// if the master_categories_id != categories_id, then for "safety" sake, should successfully insert the product to the category before deleting it from the previous category. Should also verify that the master_categories_id is set, because if it is not then there is a bigger issue. As part of the verification, if it is not set, then don't try to delete the previous, just add it and provide equivalent information.
if ($result_incategory['master_categories_id'] != $result_incategory['categories_id']) {
//move is eminent
if ($result_incategory['master_categories_id'] > 0) {
//master_category is assigned to the product complete the move.
// Ensure the product still is on the way to the move and available.
// $res1 = ep_4_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)
// VALUES ("'.$v_products_id.'", "'.$v_categories_id.'")');
$res1 = ep_4_query('UPDATE ' . TABLE_PRODUCTS . ' set master_categories_id = ' . $v_categories_id . '
WHERE products_id = ' . $v_products_id);
/* if ($res1) */
//Successfully updated the product to the category, now need to remove the link from the previous category.
$res2 = ep_4_query('DELETE FROM ' . TABLE_PRODUCTS_TO_CATEGORIES . ' WHERE products_id = ' . $v_products_id . ' AND categories_id =
' . $result_incategory['master_categories_id']);
if ($res1 && $res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' moved from category ' . (int)$result_incategory['master_categories_id'] . ' to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else if ($res1 && !$res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' master_categories_id changed from category ' . (int)$result_incategory['master_categories_id'] . ' to category ' . (int) $v_categories_id . ' via EP4.', 'info');
} else if (!$res1 && $res2) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' deleted from category ' . (int) $result_incategory['master_categories_id'] . ' and added to category ' . (int) $v_categories_id . ' via EP4.', 'info');
}
} else {
//master_category is not assigned, assign the category to the master category and do the move.
// $res1 = ep_4_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)
// VALUES ("'.$v_products_id.'", "'.$v_categories_id.'")');
//Successfully inserted the product to the category, now need to remove the link from the previous category.
$res1 = ep_4_query('UPDATE ' . TABLE_PRODUCTS . ' set master_categories_id = ' . $v_categories_id . '
WHERE products_id = ' . $v_products_id);
if ($res1) {
zen_record_admin_activity('Product ' . (int) $v_products_id . ' master_categories_id established as category ' . (int) $v_categories_id . ' via EP4.', 'info');
}
}
} // End if master and category different, nothing else to do as no where to go because both are the same...
//continue;
}
}
}
//==================================================================================================================================
This is expected to be included in the upcoming 4.0.31 code...
-
Re: EasyPopulate 4.0 Support Thread
Sorry forgot to mention the file: admin/easypopulate_4_import.php beginning at line 1508.
-
Re: EasyPopulate 4.0 Support Thread
is there an Easy Populate for ZC1.54 that works?
thanks
-
Re: EasyPopulate 4.0 Support Thread
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Looper
is there an Easy Populate for ZC1.54 that works?
thanks
Quote:
Originally Posted by
lruskauff
Yes, ep4
Instructions to obtain the generally accepted version are provided in post 1 of this thread. A new version has been uploaded to test at an alternate forked location, details to follow while verifying all changes/improvements have been properly identified.
-
Re: EasyPopulate 4.0 Support Thread
Thanks for responses. I'll give it another try today
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Looper
Thanks for responses. I'll give it another try today
If you have any difficulty installing/operating it please post details so that the issue can be duplicated and corrected... Depending on what is being seen/how the store is setup the latest version posted may correct your issue if you have had problems with this version of EP which by the statement above seems to be the case. Anyways, please post if was successfully installed or if not details of possibly reproducing the issue.
-
Re: EasyPopulate 4.0 Support Thread
mc12345678,
install went good. i downloaded a file and excel 2013 opened fine. So i edited one products name description, and price. saved to my temp file in the csv format. then i upload and all seems good. however when i refresh my browser and check the item to see if the corrections are there, nothing changed. Am i missing something under "Product & Pricing Export/Import Options:"?
Looper
-
Re: EasyPopulate 4.0 Support Thread
Uploaded version 4.0.31 to github at: https://github.com/mc12345678/EasyPopulate-4.0
The configuration window is changed, recommendation for upgrade is to make note of the settings on the configuration window, then on tools->Easy Populate 4, top right corner select remove EP4, then install EP4 from the middle of the top of the screen..
Several things added/changed.
1) the file folder location has been modified to not require the admin folder to be typed in. There is now a switch in the configuration panel to pick the folder as either the store directory or the admin directory. Directory paths are based on the settings in the admin/includes/configure.php file regarding ssl being used, the use of the server paths as well as the file paths..
2) Added the category move feature described in the last couple of posts. What this does is: move a product from one category to the next and assign the master_categories_id for that product to the category in the row of data.
3) Modified the code in several places to ensure that the database was accessed using the datatype of specific data being searched... (ZC function bindVars)
4) Adjusted line spacing/row spacing to try to convert to the ZC standard of code format and simplify readability.
5) Added a few notifiers to potentially support future development.
6) incorporated an additional function (ep_4_rmv_chars) into the functions file to work with removing special characters instead of it being duplicated multiple times throughout the code. This function is/has been called where the code was performing the same function in the "main" body.
7) Modified how blank image data is captured/stored and added an admin switch. Previously if a product did not have an image assigned, then EP4 would set the image path for a product to the blank image if there was a blank image defined to be shown in such a situation... The problem is, because a specific path is/was defined if the image to be shown when "blank" is changed (possibly to a new filename), then products with such an assignment would still show the old image (specifically assigned) rather than the ZC admin assigned image (shown when no image is defined for a product and for other cases such as an image's file missing.)
8) Added the ability to use the products_id field as the unique key to process information instead of having to use the products_model field as well as a path to add additional fields to serve as a primary key, though still requiring additional coding to add the additional fields. WARNING: backup BEFORE using the products_id for import. Improper use/application of the products_id could cause significant database data corruption in that content expected for products_id X may appear as what is supposed to be at products_id Y. These errors would be user caused and could be corrected by restoring to the backup made just before the upload Understand that if there have been transactions processed between when the backup was made and then restored, those transactions will be lost if something is not done to preserve them... Let me just say that this is somewhat of a releasing the beast action. It has been asked for over the years, but hadn't been done other than through what seems to be a version 3 that was published somewhere... The default install of this plugin selects products_model for the primary key, and this is even the case if the option in the configuration panel is "removed", not present, or not installed (for those that install this on others systems and want to minimize the things they can do to break their process/store). Did I mention to backup before using this feature on import? Backing up is covered in the instruction. It is covered here. I take no responsibility in the improper use of this program/feature that may cause significant problems with your store including an impact on sales because of improper use of this feature even if it is considered that there is not sufficient direct instruction on how to use it properly. It has always been strongly encouraged that this code be tested in a development atmosphere before being used on a live store including performing the actions on that development store that are expected to be performed on the live store and then verifying the response/information is accurate.
9) Resequenced the configuration menu items to account for some of the new functionality rather than simply add to the end of the list.
10) Have attempted to obtain support from the italian ZC market; however, for whatever reasons of the admins at that site, they have thus far declined providing me the ability to post on the forum where an individual is/was actively searching for help on EP4. I can say that if you try to create an account and choose to have the site displayed in English that their "human validation" question requires an Italian response and will reject an answer provided in English. How's that for validating that someone is human when the human understands the foreign language and provides a response back in the language displayed/identified as the language of choice? And then subsequently a human says, oh you are a robot because I see you answered the question incorrectly... (Mind you if it said in the language of this question or something similar, then sure... I guess though that they do not wish anyone from outside of Italy to provide support to the Italians) Anyways, if someone would like to take a stab at translating the English (or German) to appropriate Italian or other languages as used on computers, please don't hesitate to offer the language files associated... I do still have a little bit of incorporation to do from an existing German translated version, but to be honest, I'd rather push out what I have at the moment, do some other work on other things, and then come back to complete incorporation of the translation.. It's also not exactly the most exciting action.. Unfortunately it wasn't considered upon initial and subsequent development so it is happening now.. :)
Okay, I think I have combed the files completely for the changes from version 4.0.30 and have captured the meat of the changes above. Once I get some independent confirmation of functionality, I will incorporate/ask for incorporation into the main download tree. Really don't want new users to become discouraged with the code knowing that some features are still being tested...
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Looper
mc12345678,
install went good. i downloaded a file and excel 2013 opened fine. So i edited one products name description, and price. saved to my temp file in the csv format. then i upload and all seems good. however when i refresh my browser and check the item to see if the corrections are there, nothing changed. Am i missing something under "Product & Pricing Export/Import Options:"?
Looper
Items bolded are addressed below and in sequence with their occurrence in the paragraph.
1. downloaded a file - Prefix of downloaded file?
2. temp file - Prefix of file or just provide the full name of file?
3. after upload, was the file imported? (Please remember details are important, we are not able to see your computer screen while you do the things described.)
4. missing something - Well, also depends on which of the four options were chosen for export as to when importing what fields will be updated/modified...
Also, while not impossible to use Excel, there are potential issues with its use instead of Open Office which is the recommended editor. Excel tends to cause some issues with 1) quotation and upload of data and 2) dates as the saved date format should be YYYY-MM-DD where YYYY represents the four digit year, MM represents the two digit month (ie 05) and DD represents the two digit day (ie 24) and sometimes it does not save in that format... (I tend to omit the date column(s) if I have to use Excel in place of Open Office)
-
1 Attachment(s)
Re: EasyPopulate 4.0 Support Thread
Success File uploaded successfully: Full-EP2015Aug30-162632.csv
-
Re: EasyPopulate 4.0 Support Thread
Uploading only puts the file on the server for it to then be used for other operations... For example, if it is known that the file is going to have a large number of rows and from past experience importing that many rows will be a problem, it is possible to split the file after it is uploaded and before it is imported...
Upload puts on server, import puts in database. Much like export pulls from database (puts on server), download pulls from server (brings to local computer)...
Not quite there yet.. Find the file in the list down on the screen, select import to the right of the filename... (after you have made your backup in case there are any issues. :) )
-
Re: EasyPopulate 4.0 Support Thread
mc12345678,
that did it. many thanks!!! :)
-
Re: EasyPopulate 4.0 Support Thread
got it. many thanks!!) I am still using 4.0.30 version
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Looper
got it. many thanks!!) I am still using 4.0.30 version
That's okay, seeing what the issue was, 4.0.31 would not have resolved the situation any better. :)
On that note, regarding the version information that is in your signature. It may help someone right now troubleshoot an issue right now, but a year down the road, when someone sees the problem that you had (assuming such problem might relate to info in your signature) then today's message and problem may not line up with tomorrows configuration. Bottom line, the signature should not be the sole means of identifying version information. Version information applicable to a problem/solution should be included in the text of the message that generally will not change.
-
Re: EasyPopulate 4.0 Support Thread
:)
not sure i understand, something wrong with my signature?
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
Looper
:)
not sure i understand, something wrong with my signature?
Not for the purposes of the issues identified so far in this forum.
Point is, if you do come across any issues that need to be corrected, please be sure to include that information (and other that is covered in the posting tips) in the bulk of the message. It will help those helping you (in case the signature is not up-to-date) and those in the future (as the signature gets changed to reflect other information).
-
Re: EasyPopulate 4.0 Support Thread
Hi MC , fancy meeting you here . Zen Cart 1.5.4 ,yesterdays EP4 update . SBA 1.5.4 .When I import SBA-Stock-EP2015 whether edited in office libre or excel I get this error on every product.
MySQLi error 1062: Duplicate entry '' for key 'idx_customid'
When executing:
UPDATE products_with_attributes_stock SET
quantity = 1, customid = ''
WHERE (
stock_id = 122 )
Perhaps you could help an inaccurate and unreliable operator to get back on the right track. Sorry, had to laugh at your comment on the SBA thread , I probably have made a stupid mistake somewhere.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
cefyn
Hi MC , fancy meeting you here . Zen Cart 1.5.4 ,yesterdays EP4 update . SBA 1.5.4 .When I import SBA-Stock-EP2015 whether edited in office libre or excel I get this error on every product.
MySQLi error 1062: Duplicate entry '' for key 'idx_customid'
When executing:
UPDATE products_with_attributes_stock SET
quantity = 1, customid = ''
WHERE (
stock_id = 122 )
Perhaps you could help an inaccurate and unreliable operator to get back on the right track. Sorry, had to laugh at your comment on the SBA thread , I probably have made a stupid mistake somewhere.
Liked that, huh? :)
So, the obvious solution is to provide a unique customid for each and every product variant... But if that were the only solution then how could the SBA plugin work without having a unique customid for each and every variant?
Couple of things going on here, I just had to figure out a good way to resolve it... See, the customid is designated as a unique key in the table definition for SBA, which means that every customid (that has data) is supposed to be different from every other customid. But unique keys (different than a primary key) are supposed to also be allowed the value NULL...
Okay, so it could be set to null... But then there is the issue that some servers treat '' as null or reject null expecting ''... So sure could omit the customid from the update if it is not provided, but then what if it were being reset to blank/NULL? Still needs to get updated to blank/NULL without losing the other properties of the entry...
Why does it seem that this issue has "snuck in"? When this feature was initially developed, I was advised that there would be a unique customid applied to each and every product (and was provided an example file dataset to match), so.. Naturally when I was testing it I followed suit and had a unique customid applied to each such product... No issues, right? Well, no one till now had pointed out the flaw which was that the case of populating the SBA database with stock quantities failed for product that did not have a customid (same thing will happen if it does have a customid but it is not unique compared to all other customid entries). Not sure I totally agree with the later requirement, but seems there was a need for it so I don't want to go mess that up...
So, I could upload a revision 4.0.31a to fix the issue above... It's not so significant to warrant a complete revision number change I think, just a bug fix... or I could provide the below code fix.. :) The problem is seen in both the stock and the detailed imports, so corrections are provided for both below.
Now, as for sorting by name.... :) If going to add that as a feature, then probably should consider all the methods of sorting, or provide a way/instruction on how to setup the export of the SBA file to be sorted by name... (to make it quicker)... Afterall, the stock export is all about doing an inventory in a store that uses SBA, whereas the detailed SBA export is all about the SBA only aspect of the data... For some both data dumps are relatively the same, but for others that use SBA to "highlight" some product and not on all product, then the detailed SBA data relatively speaking will have far fewer rows than the sba stock dump... (Yes, I know that it is possible to have many many variants for a single product causing this "number of rows" discussion to be way off...)
For the detailed import fix, find in admin/easypopulate_4_import.php approximately line 397:
Code:
$sql = $db->bindVars($sql, ':customid:', $items[$filelayout['v_customid']], 'string');
and replace with:
Code:
$sql = $db->bindVars($sql, ':customid:', (zen_not_null($items[$filelayout['v_customid']]) ? $items[$filelayout['v_customid']] : 'NULL'), (zen_not_null($items[$filelayout['v_customid']]) ? 'string' : 'passthru'));
For the stock import fix, find in admin/easypopulate_4_import.php approximately line 494:
Code:
} elseif ($items[(int)$filelayout['v_SBA_tracked']] == "X") {
Replace:
Code:
} elseif ($items[(int) $filelayout['v_SBA_tracked']] == "X") {
$sql = "UPDATE " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " SET
quantity = " . $items[(int) $filelayout['v_products_quantity']] . ($ep_4_SBAEnabled == '2' ? ", customid = '" . $items[(string) $filelayout['v_customid']] . "' " : "") . ") . "
WHERE (
stock_id = " . $items[$filelayout['v_table_tracker']] . " )";
if ($result = ep_4_query($sql)) {
zen_record_admin_activity('Updated products with attributes stock ' . (int) $items[$filelayout['v_table_tracker']] . ' via EP4.', 'info');
$display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_UPDATE_PRODUCT, $items([int) $filelayout['v_products_model']]) . $items[(int) $filelayout['v_products_quantity']] . ($ep_4_SBAEnabled == '2' ? " " . $items[(string) $filelayout['v_customid']] : "");
$ep_update_count++;
if ($sync) {
$stock->update_parent_products_stock((int) $query[$items[(int) $filelayout['v_products_model']]][(int) $filelayout['v_table_tracker']]);
// $messageStack->add_session('Parent Product Quantity Updated', 'success');
unset($query[$items[(int) $filelayout['v_products_model']]]);
}
} else { // error Attribute entry not found - needs work!
$display_output .= sprintf('<br /><font color="red"><b>SKIPPED! - SBA Tracked Quantity ' . ($ep_4_SBAEnabled == '2' ? 'and CustomID ' : '') . 'on Model: </b>%s - Not Found!</font>', $items[(int) $filelayout['v_products_model']]);
$ep_error_count++;
} // if
} //end if Standard / SBA stock
With:
Code:
} elseif ($items[(int) $filelayout['v_SBA_tracked']] == "X") {
$sql = "UPDATE " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " SET
quantity = " . $items[(int) $filelayout['v_products_quantity']] . ($ep_4_SBAEnabled == '2' ? ", customid = :customid: " : "") . "
WHERE (
stock_id = " . $items[$filelayout['v_table_tracker']] . " )";
$sql = $db->bindVars($sql, ':customid:', (zen_not_null($items[$filelayout['v_customid']]) ? $items[ $filelayout['v_customid']] : 'NULL'), (zen_not_null($items[$filelayout['v_customid']]) ? 'string' : 'passthru'));
if ($result = ep_4_query($sql)) {
zen_record_admin_activity('Updated products with attributes stock ' . (int) $items[$filelayout['v_table_tracker']] . ' via EP4.', 'info');
$display_output .= sprintf(EASYPOPULATE_4_DISPLAY_RESULT_UPDATE_PRODUCT, $items[$filelayout['v_products_model']]) . $items[$filelayout['v_products_quantity']] . ($ep_4_SBAEnabled == '2' ? " " . $items[$filelayout['v_customid']] : "");
$ep_update_count++;
if ($sync) {
$stock->update_parent_products_stock((int) $query[$items[(int) $filelayout['v_products_model']]][(int) $filelayout['v_table_tracker']]);
// $messageStack->add_session('Parent Product Quantity Updated', 'success');
unset($query[$items[(int) $filelayout['v_products_model']]]);
}
} else { // error Attribute entry not found - needs work!
$display_output .= sprintf('<br /><font color="red"><b>SKIPPED! - SBA Tracked Quantity ' . ($ep_4_SBAEnabled == '2' ? 'and CustomID ' : '') . 'on Model: </b>%s - Not Found!</font>', $items[(int) $filelayout['v_products_model']]);
$ep_error_count++;
} // if
} //end if Standard / SBA stock
-
Re: EasyPopulate 4.0 Support Thread
That's fantastic MC , the EP4 export/import SBA facility works perfectly with these edits. Thank you so much for the time and trouble you have taken to help me out.
-
Re: EasyPopulate 4.0 Support Thread
Quote:
Originally Posted by
cefyn
That's fantastic MC , the EP4 export/import SBA facility works perfectly with these edits. Thank you so much for the time and trouble you have taken to help me out.
Absolutely no problem, it's a shame that anything had to be done at all as that feature has been available for quite some time now and no one has commented about the issues involved.. Doesn't have to be a big production, and as have seen I only discovered the issue when it was commented about on some other forum... :)
I do recall that at the time of development there was a bit of a clock ticking and only some of the specific functionality was requested (meaning anything extra was a "bonus" but not a development requirement). I do know that a basic import/export will eventually follow; however, I've been wanting to wait until SBA structure and building is settled/finalized... It's expected to be somewhat complicated (meaning lot's of code to put together/write) and I'd rather write it one time and be done not having to revise it significantly because of significant changes in the SBA code/processing/structure.
For anyone reading, hopefully can see how easy it can be to have an issue corrected with proper information, methods of duplicating the issue and posing the question(s)/issue(s) to the proper location...
-
Re: EasyPopulate 4.0 Support Thread
-
Re: EasyPopulate 4.0 Support Thread
Hi all! So I have ZC v154 and have used Easy Populate 4 for around a year with no issues, and before that another version of EP for many years, so I know the ins and outs. I recently downloaded an EP file using the manufacturer filter so I could just update one category of products. I edited the file and uploaded it, and when I import the file I'm getting the error "No model field in record. This line was not imported". I know for a fact that the v_products_model fields are all filled in, I didn't change anything in that column.
So, I went onto GitHub and saw there was a newer version of EP4, so I installed that. It now looks different in my back end because of the updated version, but it is still doing the same error when I import the files (and I've tried a few files).
Ok, I've done a little more experimenting, and if I create a new EP file in my admin and import that, it imports fine and says the products have been updated. If I take this file and download it to my computer and then upload it again and import it, it also works. So it's somehow in editing my file, or renaming it, this edited file is the one that then says no model field in record. The only column I'm editing is the description, so I'm not sure what's happening.
Any ideas??? Thanks!
-
Re: EasyPopulate 4.0 Support Thread
Flename of revised file?
Looked at upload file with plain text editor to see that quotes are appropriately applied after save?
-
Re: EasyPopulate 4.0 Support Thread
Ok, I'm a dork. I've been working on this for days. I just came back to my latest edited file and realized that just ONE of my model id fields had become blank somehow. So I'm not sure what was happening with the previous day's errors, but I think that upgrading to the newest version of EP4 helped, then I somehow deleted on of the model ID fields. Anyway, I just fixed that field, and uploaded/imported, and it worked!!!!!
Yeah, I'm a dork.....
Sorry for any confusion!!
-
Re: EasyPopulate 4.0 Support Thread
No, actually the way that you presented it indicated that it was something in the process on your side, so glad it was something easy to address. :) course thought was that all items in the list were an issue not just a single line. But hopefully there won't be a need to seek help in the future. :P of course if ever do, know where to swing by for assistance. :)
-
Re: EasyPopulate 4.0 Support Thread