Zen Cart Logo
Forums / All Other Contributions/Addons / How can I add extra fields to Easy Populate?

How can I add extra fields to Easy Populate?

Locked

Views: 5,719

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
13 Apr 2007, 7:20 AM
#1
mikecass avatar

mikecass

New Zenner

Join Date:
Sep 2004
Posts:
27
Plugin Contributions:
0

How can I add extra fields to Easy Populate?

I want to add extra fields to the easy populate contribution. I would like to add UPC and others to the import. Can anyone help with this?

Thanks

16 Apr 2007, 8:51 PM
#2
scrat avatar

scrat

Zen Follower

Join Date:
Dec 2005
Posts:
451
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

Unless you have a good understanding in writing PHP and Mysql you will struggle. I have looked at the advance version and it still does not have the field for UPC.

In up and coming versions of Zen. there will be UPC included, but EP will have to be updated to upload this, and you may have to buy the advanced version in the future unless someone less rewrites version 1.2.5.4

Sorry much much help:(

16 Nov 2008, 1:36 PM
#3
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

Scrat:

Unless you have a good understanding in writing PHP and Mysql you will struggle. I have looked at the advance version and it still does not have the field for UPC.

In up and coming versions of Zen. there will be UPC included, but EP will have to be updated to upload this, and you may have to buy the advanced version in the future unless someone less rewrites version 1.2.5.4

Sorry much much help:(

Actually it is really really easy, i did it within 30 mins - 60 mins.

Here is a copy of the coding, this will give you an idea what has to change. The only file that you need to change is easypopulate.php that is located in "catalog\admin".

http://www.agelessartifacts.com/private/easypopulate.rar

27 Nov 2008, 12:59 AM
#4
edwardtilbury avatar

edwardtilbury

Zen Follower

Join Date:
Sep 2007
Posts:
169
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

I backed up my old easypopulate.php file and uploaded this, all I got was a blank screen.

I'm using Easy Populate Advanced 3.0.3 for Zen Cart...

Is there an updated version?

27 Nov 2008, 4:49 AM
#5
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

edwardtilbury:

I backed up my old easypopulate.php file and uploaded this, all I got was a blank screen.

I'm using Easy Populate Advanced 3.0.3 for Zen Cart...

Is there an updated version?

Sorry, should have said that this is for the standard version and not the advanced version.

3 Jan 2009, 4:01 AM
#6
litesprof avatar

litesprof

New Zenner

Join Date:
Oct 2007
Posts:
16
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

Delights:

Sorry, should have said that this is for the standard version and not the advanced version.

I am receiving this error after installing your file.

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in public_html/admin/easypopulate.php on line 718

3 Jan 2009, 4:59 AM
#7
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: How can I add extra fields to Easy Populate?

litesprof:

I am receiving this error after installing your file.

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in public_html/admin/easypopulate.php on line 718

One thing about adding to EP, It is easy to add, but if you don't have the added product variables in your product tables, then you will get a MySQL error.

This is the added items..

            'v_products_material'
            'v_products_finish' 
            'v_products_height' 
            'v_products_width' 
            'v_products_length' 
```If none are used throughout your site, then you will get errors.  If it's not built in, then it wont be easy to add...
4 Jan 2009, 4:20 AM
#8
litesprof avatar

litesprof

New Zenner

Join Date:
Oct 2007
Posts:
16
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

I am using easypopulate 1.254 and I downloaded the file from delights http://www.agelessartifacts.com/priv...sypopulate.rar i thought the file would work once i uploaded. I dont know anything about coding. How would i edit easypopulate to have the UPC code. or do i just have to add this information in easypopulate.php in the admin.

       'v_products_material'
        'v_products_finish' 
        'v_products_height' 
        'v_products_width' 
        'v_products_length'

thank you,
litesprof
https://www.glmelectronics.com
https://www.globalgpsnavigation.com

4 Jan 2009, 4:20 AM
#9
litesprof avatar

litesprof

New Zenner

Join Date:
Oct 2007
Posts:
16
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

davewest:

One thing about adding to EP, It is easy to add, but if you don't have the added product variables in your product tables, then you will get a MySQL error.

This is the added items..

        'v_products_material'
        'v_products_finish' 
        'v_products_height' 
        'v_products_width' 
        'v_products_length' 



I am using easypopulate 1.254 and I downloaded the file from delights <http://www.agelessartifacts.com/priv...sypopulate.rar> i thought the file would work once i uploaded. I dont know anything about coding. How would i edit easypopulate to have the UPC code. or do i just have to add this information in easypopulate.php in the admin.

           'v_products_material'
            'v_products_finish' 
            'v_products_height' 
            'v_products_width' 
            'v_products_length'

thank you,
litesprof
<https://www.glmelectronics.com> 
<https://www.globalgpsnavigation.com>
4 Jan 2009, 5:24 AM
#10
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: How can I add extra fields to Easy Populate?

litesprof:

How would i edit easypopulate to have the UPC code. or do i just have to add this information in easypopulate.php in the admin.

As Scrat pointed out, you need to know some programing to see where you need to add code. Depending how you plan to use the UPC will decide how the code is done. Adding something like a suggested price vs something used for tracking. I use a item number for tracking and I edited EP to use it instead of a model number for tracking and creating products.

Ether way you need to add the UPC to the cart, admin and product table to make it work, so it's not just a one page edit.

29 Nov 2009, 5:46 AM
#12
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

After an unsuccessful attempt at using 1.2.5.6.csv version of Easy Populate back in October, I removed it, reinstalled 1.2.5.4, and added the ASA module to obtain the UPC, ISBN, and keywords fields in my database. I then added those fields to Easy Populate, by following the tutorial of adding wherever the v_products_weight occurred.

Although my products have uploaded successfully (on my test WAMP server), my php error log is filling with the following:

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Zencart\nized_ict9\easypopulate.php on line 1460"

" An SQL error has occured. Please check your input data for tabs within fields and delete these. If this error continues, please forward your error log to the Easy Populate maintainer"

The MySQL_fetch_array error was occurring at EasyPopulate.php line 1465, until I changed UPC and ISBN to lower case.

Now it occurs at line 1460. At line 1460 the php file says:

WHERE
p.products_id = ptoc.products_id AND. . .

Should I be going through my "products to categories" table line-by-line to match with products? (I did delete some products where the model number had had characters " " added by Easy Populate version 1.2.5.6.csv which I couldn't remove.)

Great mods and they do help one understand more about Zen Cart, bit-by-bit.

29 Nov 2009, 5:27 PM
#13
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

I have put my modified Easy Populate php file through WinMerge and the file appears correct. There is nothing special appearing at line 1640 which is mentioned as the error position in the warning message which logs into my php log file for every single product.

I checked the "categories to products" table and each numbered product has a category. I would have expected that a stray category would be present without a category number.

I do not know what else to try to troubleshoot this error. I would like to clear my php error log of these redundant messages and stop them from occurring. Is there a protocol to further troubleshoot such error messages?

29 Nov 2009, 9:15 PM
#14
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

I spent a morning researching the following warning which appeared on my EasyPopulate upload:

"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Zencart\password\Easypopulate.php on line 1460"

In case it will benefit someone, here are the results of my research:

I found a clue at http://php.net/manual/en/Language.types.resource.php, where resource was defined: "A resource is a special variable, holding a reference to an external resource."

This gave me the information that the error is not in my Easypopulate.php but in the external data/resource it is referencing. This was my biggest question.

After scrutinizing the "products to categories" table and my categories in Zencart Admin, I found my new product upload no longer had products in 1 category.

Inexplicably, it also somehow duplicated another category and category number so that one subcategory had zero and its duplicate had the products.

The PHP manual at the site above states that usually a resource with no more references is detected automatically by php and discarded.

The exception is when the database uses a "persistent connection."

I suppose next steps would be to (1) drop the unused category and see if the error goes away on re-upload, and (2) research whether my WAMP server has a persistent connection.

I hope this helps someone.

29 Nov 2009, 10:22 PM
#15
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

Error report as to the above post: On re-check, there was no duplicate category, but there was a second category that no longer has products from the supplier.

So, 2 defunct categories could fit into a scenario where external resources would "not yield a valid result resource" when called by the mysql_fetch_array(). . . .

30 Nov 2009, 1:52 PM
#16
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: How can I add extra fields to Easy Populate?

Update: On upload of a totally different set of products, the warning/error message in the preceding 2 messages is still appearing.

I'm looking for a suggestion on how to troubleshoot this problem.

Also, any advice on how to clean out the php log of these numerous repetitive errors would be appreciated, although in time I hope to research that also. Thanks.