Zen Cart Logo
Forums / Addon Admin Tools / EasyPopulate 4.0 Support Thread

EasyPopulate 4.0 Support Thread

Sticky

Views: 733,330

Results 3,241 to 3,260 of 3,671
8 Apr 2021, 7:31 PM
#3241
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

EasyPopulate 4.0 Support Thread

mc12345678:

Good question, looks like may need some more information. Seems that the code being used may be a little dated, there had been an update to revise the text response to indicate the primary key setting (in this case would expect to see 'v_products_id' instead of - Model). Sure the update is/was in the language files to an extent, but...

So, information that may further help now that I've looked over the current processing "plan".

  • Version number (and/or date downloaded) identified with the software?
  • Any observer(s) listening to EP4_IMPORT_FILE_EARLY_ROW_PROCESSING that may have modified what could then be the global variable $continueNextRow to be set to a falsey value?
  • Is debug logging turned on in the configuration settings? If so (default) then there should be some record in the generated debug .txt log in the EP4 main screen towards the "bottom" of the list of files. That is unless the admin/includes/functions/extra_functions/easypopulate_4_functions.php is old enough (pre Oct 3, 2016) to still have the typo of write_debug_log($string) instead of write_debug_log_4($string).
  • Is there more than one product being deleted in the file, and does at least one other product delete successfully (presumably an earlier listed product)? For that matter is there more than one row of data in the file other than the header row?

I did see an updated version was available after to posted.

Easy Populate 4.0.36.ZC - 07-05-2016
No observers added.
Debug logging is on but the log file is dated 2/2/2021
I only had on product in the file as I was testing before doing them all (200)

I have since deleted the products via phpMyAdmin but will continue testing with test product(s) as needed.

8 Apr 2021, 7:56 PM
#3242
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

jeking:

I did see an updated version was available after to posted.

Easy Populate 4.0.36.ZC - 07-05-2016
No observers added.
Debug logging is on but the log file is dated 2/2/2021
I only had on product in the file as I was testing before doing them all (200)

I have since deleted the products via phpMyAdmin but will continue testing with test product(s) as needed.
Well, on the "used phpMyAdmin" to delete product, understand that EP4 uses the ZC zen_remove_product function which removes A LOT of data and even files from the server. Simply removing product from the products table does not clean up the site the same way.

I'll take a look at what that version does/did as far as processing, but I may also suggest looking at the ZC logs folder to see if there was an issue logged there as one of the actions is to unlink photos and while I wouldn't expect that to be a problem in a setup ZC site, it wouldn't be the first time that I've seen a problem crop up because of that even if the operation is prefixed to prevent generating an error.

As for the potential of generating a debug log entry, I rushed in my review. A log entry would only be made if a variable hard coded in admin/easypopulate_4.php had been changed to true. That issue leads me to consider making a change to allow setting that through the configuration menu by adding an option choice to the existing debug logging variable.

My guess for the issue (as still need to look back at that version) is that the remove product code wasn't updated to handle the alternate key. A work around to that would be to temporarily assign a products_model to those product being deleted (using the same blank_new or products_id setting) then change over to products_model and import a file with those product to be deleted and having those temporary products_model values... The model could be the products_id if models are not otherwise being used or have some sort of "prefix"/"suffix" that would ensure uniqueness...

8 Apr 2021, 10:36 PM
#3243
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

mc12345678:

Well, on the "used phpMyAdmin" to delete product, understand that EP4 uses the ZC zen_remove_product function which removes A LOT of data and even files from the server. Simply removing product from the products table does not clean up the site the same way.

My guess for the issue (as still need to look back at that version) is that the remove product code wasn't updated to handle the alternate key. A work around to that would be to temporarily assign a products_model to those product being deleted (using the same blank_new or products_id setting) then change over to products_model and import a file with those product to be deleted and having those temporary products_model values... The model could be the products_id if models are not otherwise being used or have some sort of "prefix"/"suffix" that would ensure uniqueness...

I can update to the current version and try again. Your theory makes a lot of sense. I wish my client would use Model Numbers, but that's another story.

"used phpMyAdmin" - yes, and good point. I removed the products from all of the tables in which I found the product_id.

8 Apr 2021, 11:54 PM
#3244
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

Maybe you could make model numbers for them and then upload and then update that field to null after that?

9 Apr 2021, 12:01 AM
#3245
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

MC12345678 .... seems like you mentioned to me somewhere that this EZ4.0 could load attributes.... can it also load attribute pictures?

I had an interesting thought for a change in the code.... when you first create a category you assign that product's picture to that products category picture.

Thank you!

9 Apr 2021, 12:36 AM
#3246
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

shrimp-gumbo-mmmhhh:

MC12345678 .... seems like you mentioned to me somewhere that this EZ4.0 could load attributes.... can it also load attribute pictures?

Sorry, I forgot that ZC attributes don't have pictures.... I guess I am thinking of a mod I saw?

9 Apr 2021, 4:30 AM
#3248
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

jeking:

I can update to the current version and try again. Your theory makes a lot of sense. I wish my client would use Model Numbers, but that's another story.

"used phpMyAdmin" - yes, and good point. I removed the products from all of the tables in which I found the product_id.
Note, some tables use product_id, some products_id. Again, an operation best left to zen_remove_product.

Also, I got a little wrapped up in the details, but in the making of a products_model for product deletion, if trust that the products_model to be assigned represents a product to be deleted, then all to be deleted could be made the same products_model and then when using the older ZC version, could upload just one product with that same products_model to have it delete. All items with that products_model will be sought and "destroyed".

9 Apr 2021, 5:07 AM
#3249
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

shrimp-gumbo-mmmhhh:

MC12345678 .... seems like you mentioned to me somewhere that this EZ4.0 could load attributes.... can it also load attribute pictures?
It can load the path to the pictures, but pictures are not "loaded" to the store via EP4. The detailed attributes import file would be used to identify to the store the path to use to identify the attribute picture(s).

shrimp-gumbo-mmmhhh:

I had an interesting thought for a change in the code.... when you first create a category you assign that product's picture to that products category picture.

Thank you!
Certainly possible, though also may make it difficult to track down which category/categories need "updating". I mean, ideally, before uploading a file that would generate a category that category would actually already be fully identified and either ready for upload or already fully exist. Some don't even use the category picture(s) so that feature may not be of significant value to those. That said, I'll look to see what options are or can be made available at that point in the code to support that possibility if desired.
shrimp-gumbo-mmmhhh:

Sorry, I forgot that ZC attributes don't have pictures.... I guess I am thinking of a mod I saw?

DrByte:

What?
https://docs.zen-cart.com/user/admin_pages/catalog/attributes_controller/#attribute-images

Definitely with DrByte on this one. Not sure where or what led to disbelieving that attributes can have images. Certainly there are possibly issues with templates and/or configurations, presence of images where the path expects, problems in one's includes/configure.php file, etc... but the system supports their existence.

9 Apr 2021, 6:34 PM
#3250
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

mc12345678:

It can load the path to the pictures, but pictures are not "loaded" to the store via EP4. The detailed attributes import file would be used to identify to the store the path to use to identify the attribute picture(s).

Certainly possible, though also may make it difficult to track down which category/categories need "updating". I mean, ideally, before uploading a file that would generate a category that category would actually already be fully identified and either ready for upload or already fully exist. Some don't even use the category picture(s) so that feature may not be of significant value to those. That said, I'll look to see what options are or can be made available at that point in the code to support that possibility if desired.

Definitely with DrByte on this one. Not sure where or what led to disbelieving that attributes can have images. Certainly there are possibly issues with templates and/or configurations, presence of images where the path expects, problems in one's includes/configure.php file, etc... but the system supports their existence.

Great news! I understand what you are saying between load and point to....

My live site which is 1.5.7c actually does not have the swatch image available option..... I do see this option in my new test site though.

12 Apr 2021, 5:20 PM
#3251
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

jeking:

I have a question about deleting products. My client does not use model numbers, so I've got the "Import/Export Primary Key" set to "blank_new".

In my csv:
v_products_model is left empty
v_products_id is 326001
v_status is 9

When importing this file, I get: NOT FOUND! - Model: 326001 - cant delete...

I tried setting "Import/Export Primary Key" to "products_id" and got the same thing.

I don't understand why it doesn't delete the product with 326001 as the id. I did confirm the product exists by looking in the database.

I'm back, my client made the same mistake in importing so I have the same problem.

This time I am using version: Easy Populate 4.0.37.12 - 12-24-2020'
"Import/Export Primary Key" is set to products_id

I'm importing a csv file with just one row. Only difference is the v_products_id is now 326004

When I import, this is the result:

Import Results

Filename: Full-EP20-Book1.csv

Finished Processing Import File

Updated records: 0
New Imported records: 0
Errors Detected: 0
Warnings Detected: 0
Memory Usage: 50819040
Memory Peak: 87319616
Execution Time: 0 seconds.

Even though no error was mentioned, I checked anyway and found no error log.

13 Apr 2021, 1:57 PM
#3252
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

If those items are already in the database it will just update them....

13 Apr 2021, 2:37 PM
#3253
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

shrimp-gumbo-mmmhhh:

If those items are already in the database it will just update them....

But I'm using a v_status of 9, shouldn't that delete them?

13 Apr 2021, 4:48 PM
#3254
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

jeking:

I'm back, my client made the same mistake in importing so I have the same problem.

This time I am using version: Easy Populate 4.0.37.12 - 12-24-2020'
"Import/Export Primary Key" is set to products_id

I'm importing a csv file with just one row. Only difference is the v_products_id is now 326004

When I import, this is the result:

Import Results

Filename: Full-EP20-Book1.csv

Finished Processing Import File

Updated records: 0
New Imported records: 0
Errors Detected: 0
Warnings Detected: 0
Memory Usage: 50819040
Memory Peak: 87319616
Execution Time: 0 seconds.

Even though no error was mentioned, I checked anyway and found no error log.
So as you can tell I'm trying to get to a point to release a new version here in Zen Cart. Unfortunate "history" is that I began a "sub-version" by increasing the wrong version identifier (.37). At any rate, here is what I've found.

The attempt to delete a product will not execute if:

  1. obvious: The identifier from within the main key doesn't exist anywhere in the database (E.g. products_id = 5001 but there is no record with products_id = 5001)
  2. Less obvious and not so sure that was intentional, looking into it: the item in question is not populated in ALL of the products table, if the products_id is not in the products_to_categories table with a matching/associated categories table record to the record in the products_to_categories table...

Now, how this may have been possible? Well, I had found (testing solution as much as possible) that if I attempted to import product with a v_categories_name_(language_code) instead of the traditional/historic v_categories_name_(language_id) that the product would not be placed how/where it was expected. While I haven't yet uploaded all that I did yesterday to resolve this, I want to make a consistent approach to the operation.

For more "power" users I have/had started to implement a process where it was possible to import with either the language_id (1, 2, 3, etc..) or the language_code (e.g. en, de, es, etc...). At a point, I realized the possibility that someone may import with one but not the other, or "worse" import with both fields populated... So I created a "preference" option (language_id or language_code) such that if both were provided then the method indicated as a preference would be the one that would "dominate". I later discovered though that I had also incorporated that if only one of those fields/columns were included and not the one that was preferred, then the remaining column would cause changes. So... I've added two additional options such that import could/would be limited to the style designated (language_id_only or language_code_only). In this way, regardless the columns present, only the column(s) ending with that designator will be processed.

Now, in this exercise I also found a number of issues with how Zen Cart 1.5.7 "limits" operations... For example, if a product was assigned to categories_id of 0 and not linked elsewhere, then it was extremely difficult to relocate it. It couldn't be moved (Move said something about not placing it in the same place that it was along with some other information). The products link manager identified that it didn't have a master category set, but then wouldn't offer/allow any other category to be set because it seems that it wasn't yet linked to anything else (sort of defeats the purpose of using the link manager if can't establish another link). I think what I ended up doing was copying the product as a linked product and placed it in some other category (that didn't have sub-categories) and then went through one or another process to delete the product from the top category (categories_id of 0).

Now as far as the data indicating 0 action performed for all rows, the "primary" issue that might cause that report is that the desired/expected primary key field is empty in such a way that no action is to be taken (e.g. not set to blank_new and a delete action isn't performed or there isn't sufficient fields to encourage/do anything) with the secondary being as commented out in the code that in some way the associated category may not be found. I found on my test site that I too was having difficulty using any other primary key than products_model. For me I found the reason was that I had hard coded the primary key (EP4_DB_FILTER_KEY) in admin/includes/extra_configures to be something not in the standard list and without an observer to handle it.

So, what to do? There's options... Possibly the "easiest" assuming that action is quickly taken is to assign a products_id, categories_id into products_to_categories that points to a category that exists for the products_id in question. Alternatively the sql query in admin/easypopulate_4_import.php at/around lines 256-258 be changed from/to something like:
from:

                TABLE_PRODUCTS . ' as p, ' .
                TABLE_PRODUCTS_TO_CATEGORIES . ' as ptoc,' .
                TABLE_CATEGORIES . ' as subc ';
        $zco_notifier->notify('EP4_IMPORT_PRODUCT_DEFAULT_SELECT_TABLES');
        $sql .= "WHERE
          p.products_id      = ptoc.products_id AND
          ptoc.categories_id = subc.categories_id AND ";

to (untested):

                TABLE_PRODUCTS . ' as p LEFT JOIN ' .
                TABLE_PRODUCTS_TO_CATEGORIES . ' as ptoc ON (p.products_id = ptoc.products_id) LEFT JOIN ' .
                TABLE_CATEGORIES . ' as subc ON (ptoc.categories_id = subc.categories_id) ';
        $zco_notifier->notify('EP4_IMPORT_PRODUCT_DEFAULT_SELECT_TABLES');
        $sql .= "WHERE ";

In this way, if there is/was a database problem with the other tables, if the item appeared in the products list, then it would at least be identified as being in the database. Note that commas in particular places have been removed, that additional text has been added as well (along with appropriate spacing to prevent text incorrectly being joined together and to remove constraints in the WHERE to ensure a satisfactory LEFT JOIN. I don't yet know what/if any other issues might result from this query change where information will be collected about product that do not have a matching or do not have an appropriate category.

Note also, that the upcoming version update is being tested on PHP 8.0 and updated where necessary to address the associated additional strictness.

13 Apr 2021, 5:59 PM
#3255
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

That's a lot of digging, thanks! I'm not comfortable testing the untested code on this live site. But I do understand the problem much better. I'll get back with my client with some options for him. I'll try again to convince him to use Model Numbers.

14 Apr 2021, 11:05 PM
#3256
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

jeking:

That's a lot of digging, thanks! I'm not comfortable testing the untested code on this live site. But I do understand the problem much better. I'll get back with my client with some options for him. I'll try again to convince him to use Model Numbers.
Model number won't specifically resolve the issue and is not specific to causing the observed response(s).

Does the store perhaps use products_sku and applied a suggested implementation that was posted earlier in this thread? Basically, if search for EP4_DB_FILTER_KEY to see if it is used outside of the core files in the root of the admin, the extra_functions folder of the admin and/or the admin's modules folder.

Note for others, the plan is/was that if an alternate filter option were desired/to be used, then it be added to the selection list in the configuration menu. The earlier "add-on" was just that, an additional set of code to show that it could be possible and how it might be implemented.

15 Apr 2021, 1:05 AM
#3257
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

mc12345678:

Model number won't specifically resolve the issue and is not specific to causing the observed response(s).

Does the store perhaps use products_sku and applied a suggested implementation that was posted earlier in this thread? Basically, if search for EP4_DB_FILTER_KEY to see if it is used outside of the core files in the root of the admin, the extra_functions folder of the admin and/or the admin's modules folder.

Note for others, the plan is/was that if an alternate filter option were desired/to be used, then it be added to the selection list in the configuration menu. The earlier "add-on" was just that, an additional set of code to show that it could be possible and how it might be implemented.

The store does not use EP4_DB_FILTER_KEY nor products_sku. I appreciate the suggestions though. I'll remove them manually again.

28 Apr 2021, 8:15 PM
#3258
greybeard_it_guy avatar

greybeard_it_guy

New Zenner

Join Date:
Mar 2021
Location:
So Cal
Posts:
16
Plugin Contributions:
0

Re: EasyPopulate 4.0 Support Thread

Long story behind this, but if I were to import into the products table with product_id that were not consecutive, would that be a problem? In other words, I might import product_id 5442, skip 5443, and then next use 5444.

Would Zen Cart have a problem with these gaps in the product_id?

28 Apr 2021, 9:07 PM
#3259
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

greybeard_it_guy:

Long story behind this, but if I were to import into the products table with product_id that were not consecutive, would that be a problem? In other words, I might import product_id 5442, skip 5443, and then next use 5444.

Would Zen Cart have a problem with these gaps in the product_id?
My answer is based on say a "fresh" install where numbers are not being "recycled"... no, Zen Cart would not specifically have a problem with numbers not being consecutive.

29 Apr 2021, 12:58 AM
#3260
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: EasyPopulate 4.0 Support Thread

mc12345678:

My answer is based on say a "fresh" install where numbers are not being "recycled"... no, Zen Cart would not specifically have a problem with numbers not being consecutive.
I should have added though, remember that the "world" (wide web) "knows" your product by specific products_id.

Note that skipping a products_id is similar to deleting a historic (old) product. Generally speaking ALWAYS skipping a number would in a way effectively reduce the possible number of product in half, but, unless you have more than 49,999,999,999 of the maximum possible 99,999,999,999 products ever to be in the store (not necessarily all at once), this shouldn't be an issue. :)