Page 339 of 356 FirstFirst ... 239289329337338339340341349 ... LastLast
Results 3,381 to 3,390 of 3558
  1. #3381
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    As you know, I've been trying to eliminate php undefined variable and undefined index notices during operation of the zxpos add-on. zxpos uses zen cart as a point of sale system does as much processing as possible in the browser, so ajax and jscripts are used extensively. The products we plan to sell with the point of sale system are mostly products with attributes, hence all the interaction with you and SBA. The error I've been chasing lately is an undefined index in shopping_cart.php in function in_cart_product_mixed_changed_shopping_cart which occurs when the product quantity is changed on the zxpos main page. The error is caused because the products_mixed_quantity field is set to 1. After setting the field to 0, the error goes away and everything seems to work properly. But the processing path taken for updating quantity on the zxpos main page is completely different from the path when the quantity is changed on the normal zen cart shopping cart page or on the product info page. There are no undefined index notices and in fact, function in_cart_product_mixed_changed_shopping_cart is not entered at all, at least for my products, even when products_mixed_quantity is set to 1 in the database.

    At this point, I have eliminated the error I was chasing and can't afford to spend more time finding out why the path is the way it is for the point of sale add-on. Thanks again for all the help and advice, and for your support of SBA.

    Dave

  2. #3382
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by Dave224 View Post
    As you know, I've been trying to eliminate php undefined variable and undefined index notices during operation of the zxpos add-on. zxpos uses zen cart as a point of sale system does as much processing as possible in the browser, so ajax and jscripts are used extensively. The products we plan to sell with the point of sale system are mostly products with attributes, hence all the interaction with you and SBA. The error I've been chasing lately is an undefined index in shopping_cart.php in function in_cart_product_mixed_changed_shopping_cart which occurs when the product quantity is changed on the zxpos main page. The error (WHICH? CONTENT OF THE ERROR?) is caused because the products_mixed_quantity field is set to 1. After setting the field to 0, the error goes away and everything seems to work properly. But the processing path taken for updating quantity on the zxpos main page is completely different from the path when the quantity is changed on the normal zen cart shopping cart page or on the product info page. There are no undefined index notices and in fact, function in_cart_product_mixed_changed_shopping_cart is not entered at all, at least for my products, even when products_mixed_quantity is set to 1 in the database.

    At this point, I have eliminated the error I was chasing and can't afford to spend more time finding out why the path is the way it is for the point of sale add-on. Thanks again for all the help and advice, and for your support of SBA.

    Dave
    You know in the "search"... providing information allows others to figure out the why. Right now there is an issue that happens on some cart somewhere and a specific setting is involved... No problem, whatever.

    That said I remember having a conversation with DrByte about setting various variables within that code section to mitigate the possibility of notices, I thought I had a commit/issue submitted on it, but at the moment can not find it.

    Note though, not knowing even what the notice is about as in which line, which variable, etc means it could be anything anywhere and that the assistance offered gets returned in kind.

    BTW, I happen to know that the code author of that section would really like to resolve any issues with it.
    Last edited by mc12345678; 25 May 2021 at 11:24 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3383
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by mc12345678 View Post
    ...
    That said I remember having a conversation with DrByte about setting various variables within that code section to mitigate the possibility of notices, I thought I had a commit/issue submitted on it, but at the moment can not find it.
    ...
    Found it. Issue was raised by carlwhat, conversation ensued, solution was identified and proposed that appears to be adopted in ZC 1.5.8 (which could apply to 1.5.7 as well):
    shopping cart notices on product update by mc12345678 · Pull Request #4181 · zencart/zencart (github.com)
    Don't know if it would fix the above issue(s) though.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #3384
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    The error was an undefined offset notice in includes/classes/shopping_cart.php on or around lines 2593 and 2594 where 'total_change' and 'last_changed' are set. Code follows:
    Code:
    $changed_array = array(
             'state'=>false,
             'changed' => $product_changed,
             'total_change' => $product_total_change[$pr_id],
             'last_changed' => $product_last_changed[$pr_id],
             'increase' => $product_increase,
             'decrease' => $product_decrease,
           );
    Dave

  5. #3385
    Join Date
    Nov 2005
    Location
    France
    Posts
    577
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Just downloaded the latest version via GitHub and I noticed the 1.5.7 specific admin folder only has one file, packingslip.php
    1.5.6 has edits on attributes_controller.php, invoice.php, and orders.php.

    Is this the only core file edit required for 1.5.7?

    1.5.7 specific includes folder only has edits for templates, and yet 1.5.6 had an edit in modules/YOUR_TEMPLATE/attributes.php
    Is this no longer required?

    As well as the above queries, having installed the module, I'm getting the following log file generated when viewing products_with _attributes_stock page in admin.

    PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1 :: select count(distinct p.products_id) as total FROM products p, products_description pd WHERE pd.language_id=1 AND p.products_id = pd.products_id AND (p.products_id IN ( )) ==> (as called by) /Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php on line 39

    It looks like it's missing part of the query.

  6. #3386
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by strelitzia View Post
    Just downloaded the latest version via GitHub and I noticed the 1.5.7 specific admin folder only has one file, packingslip.php
    1.5.6 has edits on attributes_controller.php, invoice.php, and orders.php.

    Is this the only core file edit required for 1.5.7?

    1.5.7 specific includes folder only has edits for templates, and yet 1.5.6 had an edit in modules/YOUR_TEMPLATE/attributes.php
    Is this no longer required?

    As well as the above queries, having installed the module, I'm getting the following log file generated when viewing products_with _attributes_stock page in admin.

    PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1 :: select count(distinct p.products_id) as total FROM products p, products_description pd WHERE pd.language_id=1 AND p.products_id = pd.products_id AND (p.products_id IN ( )) ==> (as called by) /Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php on line 39

    It looks like it's missing part of the query.
    First off, need to look into what is causing that logged issue, certainly something is amiss there, even if the value within the parentheses should be 0, it well shouldn't be because no products_id should be 0. That said, there have been occurrences of databases losing their auto-numbering and then therefore a new product gets assigned to the products_id of 0.

    As to the fileset, yes, there is only one admin file that is modified and it is only modified to support the use of an image swap plugin that needed to have the notifier that was included. I was asked to incorporate it long ago and so it remains in support of that site's use and potential further development for the community.

    There *are* a few files on the catalog side if you want to use the provided dynamic dropdowns. Basically, after I did more testing and had seen additional "issues" of not keeping each ZC file up-to-date, I did what I could to divorce the code of the plugin from the core/template of ZC without losing any of the existing features of the plugin... There are some ways to remove the tpl_modules_attributes.php modifications, but its going to take me some work because for one, once I do that the "background" for displaying the information is going to get a serious overhaul. There are other better "dropdown" tools out there that could be incorporated with/against javascript/jQuery and that's the path/route that would need to be taken to basically remove the edits from that file.

    As to not needing the other files for ZC 1.5.7 that are included in ZC 1.5.6? Well, I finally took advantage of some ZC version specifics... ZC V1.5.7 added a new style of observers and a few more observers were added in general. Now, if one hasn't updated to the latest of 1.5.7(c) then there may be some "features" missing. But because older versions don't have all of the same notifiers and do not process notifiers the same way, they currently need the extra edits and files (until either they also get updated or everyone upgrades. :))

    Anyways, please read this post for more of the details that I likely missed above: https://www.zen-cart.com/showthread....68#post1380068
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #3387
    Join Date
    Nov 2005
    Location
    France
    Posts
    577
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Thanks for the detailed response there.

    One thing I have noticed, line 995 of admin/products_with_attributes_stock.php appears to have a misplaced {

    The line in question is
    Code:
    /*if (zen_not_null($action))*/ {
    Now, I'll admit I didn't go over every line before it, given that the preceding code is all related to the header section of the page, it seems odd to see an opening brace here.

    On another note, the file seems to have a LOT of commented out lines. Is this deprecated from older versions?
    The reason for asking is that I was considering updating the page to use the newer admin divs and form fields, cleaning out the unrequited code whilst I was in there.
    I realise that you may have avoided the page styling updates to maintain backward compatibility, but I don't work with anything but the latest ZC version, so having the newer styling would be more in keeping with the default zc pages.

  8. #3388
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by strelitzia View Post
    Thanks for the detailed response there.

    One thing I have noticed, line 995 of admin/products_with_attributes_stock.php appears to have a misplaced {

    The line in question is
    Code:
    /*if (zen_not_null($action))*/ {
    Now, I'll admit I didn't go over every line before it, given that the preceding code is all related to the header section of the page, it seems odd to see an opening brace here.

    On another note, the file seems to have a LOT of commented out lines. Is this deprecated from older versions?
    The reason for asking is that I was considering updating the page to use the newer admin divs and form fields, cleaning out the unrequited code whilst I was in there.
    I realise that you may have avoided the page styling updates to maintain backward compatibility, but I don't work with anything but the latest ZC version, so having the newer styling would be more in keeping with the default zc pages.
    It wouldn't be a line before it, but instead a line about 420 after it. Line 1416 containes the closing parentheses. At some point I realized that it seemed like the zen_not_null check was unnecessary, but I didn't have a handy ide available at the time and when I did get in with one, it wanted to readjust almost all of the code to proper spacing, blah, blah, blah... So I just commented out the "functional" part I no longer needed.

    So other comments? Well, yeah, old code that was being used, but has been replaced or otherwise worked around... prob... this software has been in such a flux over the years that I didn't want to make it impossible to upgrade and in socases the concept was great, and in other cases as much as I try to test, there almost always seems to be something that doesn't bother how I use it, but does for someone else...

    Personally, go ahead and do whatever with the admin formatting. I'm personally disappointed that there is no "structure" that things can be fit into and that there is so much busy work necessary to get things to look the way they do. Id be glad to use what you come up with and likely would just split the code up/out so that different versions can have different formatting. That's just me because I worry more about if/how things work than how they look. I also appreciate art, so don't get me wrong there.

    Now, as to that earlier error message, there has to be more to that message because what I see is that there is a problem with the split page class as called from who knows what query, what data on the uri, etc... could I have the other sanitized info?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #3389
    Join Date
    Nov 2005
    Location
    France
    Posts
    577
    Plugin Contributions
    8

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by mc12345678 View Post
    Now, as to that earlier error message, there has to be more to that message because what I see is that there is a problem with the split page class as called from who knows what query, what data on the uri, etc... could I have the other sanitized info?
    The entirety of the error log is below

    [28-May-2021 00:45:28 Europe/Paris] Request URI: /myadmin/index.php?cmd=products_with_attributes_stock, IP address: ::1
    #1 trigger_error() called at [/Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:170]
    #2 queryFactory->show_error() called at [/Users/developeer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:142]
    #3 queryFactory->set_error() called at [/Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:269]
    #4 queryFactory->Execute() called at [/Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php:39]
    #5 splitPageResults->__construct() called at [/Users/developer/Sites/localhost/mysite/myadmin/includes/classes/products_with_attributes_stock.php:607]
    #6 products_with_attributes_stock->displayExcessRows() called at [/Users/developer/Sites/localhost/mysite/myadmin/products_with_attributes_stock.php:1512]
    #7 require(/Users/developer/Sites/localhost/mysite/myadmin/products_with_attributes_stock.php) called at [/Users/developer/Sites/localhost/mysite/myadmin/index.php:11]
    --> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1 :: select count(distinct p.products_id) as total FROM products p, products_description pd WHERE pd.language_id=1 AND p.products_id = pd.products_id AND (p.products_id IN ( )) ==> (as called by) /Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php on line 39 <== in /Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php on line 170.

  10. #3390
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.5.1+

    Quote Originally Posted by strelitzia View Post
    The entirety of the error log is below

    [28-May-2021 00:45:28 Europe/Paris] Request URI: /myadmin/index.php?cmd=products_with_attributes_stock, IP address: ::1
    #1 trigger_error() called at [/Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:170]
    #2 queryFactory->show_error() called at [/Users/developeer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:142]
    #3 queryFactory->set_error() called at [/Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php:269]
    #4 queryFactory->Execute() called at [/Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php:39]
    #5 splitPageResults->__construct() called at [/Users/developer/Sites/localhost/mysite/myadmin/includes/classes/products_with_attributes_stock.php:607]
    #6 products_with_attributes_stock->displayExcessRows() called at [/Users/developer/Sites/localhost/mysite/myadmin/products_with_attributes_stock.php:1512]
    #7 require(/Users/developer/Sites/localhost/mysite/myadmin/products_with_attributes_stock.php) called at [/Users/developer/Sites/localhost/mysite/myadmin/index.php:11]
    --> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1 :: select count(distinct p.products_id) as total FROM products p, products_description pd WHERE pd.language_id=1 AND p.products_id = pd.products_id AND (p.products_id IN ( )) ==> (as called by) /Users/developer/Sites/localhost/mysite/myadmin/includes/classes/split_page_results.php on line 39 <== in /Users/developer/Sites/localhost/mysite/includes/classes/db/mysql/query_factory.php on line 170.
    Looks like in admin/includes/classes/products_with_attributes_stock.php Line 557 should change: isset to !empty

    Seems the same applies to line 564 as well.
    Changing
    isset(
    To:
    !empty(
    Alternatively could go ahead and initialize that variable from the code making the call. Instead of defaulting its value to an array, it could be defaulted to null and then made whatever is desired on that.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR