Results 1 to 10 of 10
  1. #1

    red flag Easy Popluate and Stocks By Attribute Error

    I am using a fresh install of Zen Cart 1.3.8. I installed Easy Populate and Stocks By Attribute and both worked fine. I then downloaded and installed the Easy Populate and Stocks by Attribute contribution which is only a new easypopulate.php file for the admin folder. When I go to Tools -> Easy Populate and click on "Download Model/Price/Qty/Pwas .csv file to edit" I get the following error:


    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/h/s/s/***/html/admin/easypopulate.php on line 803

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s/***/html/admin/easypopulate.php:803) in /home/content/h/s/s/***/html/admin/easypopulate.php on line 1149

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s/***/html/admin/easypopulate.php:803) in /home/content/h/s/s/***/html/admin/easypopulate.php on line 1150

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s/***/html/admin/easypopulate.php:803) in /home/content/h/s/s/***/html/admin/easypopulate.php on line 1154

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/h/s/s/***/html/admin/easypopulate.php:803) in /home/content/h/s/s/***/html/admin/easypopulate.php on line 1158
    v_products_model,v_specials_price,v_specials_date_avail,v_specials_expires_date, v_products_price,v_products_quantity,pwas_attrib_id,pwas_products_quantity,v_opt ions_name

    Please help!

  2. #2

    Default Re: Easy Popluate and Stocks By Attribute Error

    Line 803

    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){

  3. #3

    Default Re: Easy Popluate and Stocks By Attribute Error

    Anyone?

  4. #4
    Join Date
    May 2006
    Posts
    119
    Plugin Contributions
    0

    Default Re: Easy Popluate and Stocks By Attribute Error

    Still no ideas, or did someone figure this out and forget to post about it ;-)

    ??

    I have been reading and searching... I have the same error, same experience as the others here - EP works, Stock by attributes works, EP w/ stock by attributes... error. I did not get the 'header errors' - just this is in my csv file:


    <br />
    <b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/xxxxxx/...admin/easypopulate.php</b> on line <b>803</b><br />
    v_products_model v_specials_price v_specials_date_avail v_specials_expires_date v_products_price v_products_quantity pwas_attrib_id pwas_products_quantity v_options_name
    Only on that one download option (the one added by EP w/stock by attributes)

  5. #5
    Join Date
    May 2006
    Posts
    119
    Plugin Contributions
    0

    Default Re: Easy Popluate and Stocks By Attribute Error

    Ok, in the error log I find this:

    Code:
    MySQL error 1146: Table 'XXXXX.products_with_attributes_stock' doesn't exist
    When executing:
    SELECT
    			p.products_id as v_products_id,
    			p.products_model as v_products_model,
    			p.products_price as v_products_price,
    			p.products_tax_class_id as v_tax_class_id,
    			p.products_quantity as v_products_quantity,
    			pa.products_attributes_id as pwas_attrib_id,
    			pwas.quantity as pwas_products_quantity,
    			pov.products_options_values_name as v_options_name
    			FROM
    			XXXX_products as p
    			JOIN
    			XXXX_products_attributes as pa
                on  p.products_id = pa.products_id
                JOIN
                aami_products_options_values as pov
                on      pa.options_values_id = pov.products_options_values_id
                join    products_with_attributes_stock PWAS
                on      PWAS.stock_attributes = pa.products_attributes_id
    and the table prefix is NOT listed correctly - it should have the database name and the PREFIX on it... like:
    Code:
    XXXXX.<prefix>_products_with_attributes_stock
    a hint as to the problem??? mayhaps??? Maybe it is not going to find the table it is looking for, since there is no prefix??

    And if that is the problem, how to fix it???

    I tried the same install on another shop, same error. Shop is 1.3.8p3

  6. #6
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Easy Popluate and Stocks By Attribute Error

    Hey guys, did anyone solve this issue?
    I believe i found a solution, but would like to hear from someone who's having this issue to verify.

  7. #7

    Default Re: Easy Popluate and Stocks By Attribute Error

    I have the same issue. What is the solution? Then I can test it.
    thx.

  8. #8
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Easy Popluate and Stocks By Attribute Error

    Quote Originally Posted by manage-it View Post
    I have the same issue. What is the solution? Then I can test it.
    thx.
    Naaaah, I was totally wrong, the solution I found actually didn't work. I kept getting errors and eventually gave up on the idea...

    I do remember there was something to do with the table's prefix that was causing problems, you might start there.

    Sorry I don't know more...

  9. #9
    Join Date
    May 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: Easy Popluate and Stocks By Attribute Error

    In case anyone is still using this plug in and experiencing the problem. (This was for Easy Populate version 1-2-5-7 but may also apply to early versions, I'm not sure.)
    Try this...

    In the easypopulate.php file in the admin change line 137:
    from:
    PHP Code:
    if(strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0
    to this:
    PHP Code:
     if(defined("EASYPOPULATE_CONFIG_CUSTOM_FIELDS") && (strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0)) 
    or if you just want to comment out the existing line so that it will still be in the file but will be ignored then do this:

    PHP Code:
    //if(strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0)
    if(defined("EASYPOPULATE_CONFIG_CUSTOM_FIELDS") && (strlen(EASYPOPULATE_CONFIG_CUSTOM_FIELDS) > 0)) 
    (The reason: It looks like that constant variable EASYPOPULATE_CONFIG_CUSTOM_FIELDS isn't defined if you weren't using custom fields, but there is a logical test being applied to it. So first check that it is defined and if it is then check to see if it has a value.)

    I also noticed on line 544;
    PHP Code:
    $custom_layout_sql '  '
    that most likely should be:
    PHP Code:
    $custom_filelayout_sql '  '
    (The reason: $custom_layout_sql is not used anywhere else, and fix $custom_filelayout_sql is only being set in the code if certain conditions apply, but is always present in the query even if the conditions don't apply therefore should be assigned the empty string in case the condition does not apply.)

    Those should fix the Complete.csv download (it did for me!), and possibly more. I applied this solution as soon as I got the first error on the Copmpete.csv download, so I'm not sure how many other errors it may have fixed.

    Good luck!

  10. #10
    Join Date
    May 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: Easy Popluate and Stocks By Attribute Error

    Oh, and if you are using the Stock By Attribute version of the easypopulate.php then about line 549 you'll need to change:

    PHP Code:
    join    products_with_attributes_stock PWAS
    on      PWAS
    .stock_attributes pa.products_attributes_id 
    to

    PHP Code:
    JOIN products_with_attributes_stock pwas
    on      pwas
    .stock_attributes pa.products_attributes_id 
    (The reason: in that query, one of the select fields is pwas.quantity, but the table pwas didn't exist, just PWAS. As you may have deduced by reading this, you could have alterantively kept the lines above the same and instead changed pwas.quantity as pwas_products_quantity, to PWAS.quantity as pwas_products_quantity,. Either option should word, but I did not test the alternative one.)

    Note - Changing join to JOIN didn't fix anything, that was just to add consistency to the style of the query.

 

 

Similar Threads

  1. v154 Easy Popluate & digital products
    By Gordon56 in forum General Questions
    Replies: 1
    Last Post: 27 Mar 2015, 09:55 PM
  2. Attribute challenge: Can a product use 2 different attribute stocks??
    By parkogpudder in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 28 Jan 2010, 11:53 PM
  3. Help!!! Uploading with Easy Popluate Tool
    By pce.photography in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Oct 2009, 01:30 AM
  4. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg