Page 340 of 342 FirstFirst ... 240290330338339340341342 LastLast
Results 3,391 to 3,400 of 3418
  1. #3391
    Join Date
    Jul 2012
    Posts
    16,044
    Plugin Contributions
    17

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

    Quote Originally Posted by mc12345678 View Post
    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.
    Confirmed, for those two locations, changing isset to !empty fixed the issue.
    in admin/includes/classes/products_with_attributes_stock.php
    from:
    Code:
            if (isset($ReturnedProductID) && is_array($ReturnedProductID)) {
              foreach ($ReturnedProductID as $key => &$singleID) {
                $singleID = (int)zen_db_input($singleID);
              }
              unset($singleID);
              $w = " AND (p.products_id IN (" . implode(',', $ReturnedProductID) . " )) ";
              $ReturnedProductID = array_pop($ReturnedProductID);
            } elseif (isset($ReturnedProductID)) {
    To:
    Code:
            if (!empty($ReturnedProductID) && is_array($ReturnedProductID)) {
              foreach ($ReturnedProductID as $key => &$singleID) {
                $singleID = (int)zen_db_input($singleID);
              }
              unset($singleID);
              $w = " AND (p.products_id IN (" . implode(',', $ReturnedProductID) . " )) ";
              $ReturnedProductID = array_pop($ReturnedProductID);
            } elseif (!empty($ReturnedProductID)) {
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #3392
    Join Date
    Nov 2005
    Posts
    503
    Plugin Contributions
    6

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

    Quote Originally Posted by mc12345678 View Post
    Confirmed, for those two locations, changing isset to !empty fixed the issue.
    I was just about to confirm the same.
    Thanks for your assistance on this McNumbers

  3. #3393
    Join Date
    Jul 2012
    Posts
    16,044
    Plugin Contributions
    17

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

    Quote Originally Posted by strelitzia View Post
    I was just about to confirm the same.
    Thanks for your assistance on this McNumbers
    Thanks for pointing it out and look forwards to the admin revisions. I updated the github fileset around the time I posted my verification.

    I was able to confirm operation because I have/had a record that triggers the alternate group of information (which was showing when I went through testing). I "disabled" capturing the information to validate that the expected text "place holder" was shown. Not saying I really like the default text that is there, but I wanted something to be shown so that if/when a problem occurred one may recognize the discrepancy.

    Further note that generally speaking I don't expect that this area of code will need to be accessed in a store that implemented SBA at/after the point that option names/values were monitored for deletion. It was prior to that point in time that deletion of option names/values from the standard part of the store did not carry into SBA. As a result a product that was previously tracked by SBA and had variants present before attribute deletion would appear to still be tracked by SBA even if it no longer had attributes. (When that happens a mydebug log gets generated during attempts to checkout) A little more can be read up on that in dbltoe's recent posts a few pages back (337 based on my current use of 10 posts per page).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #3394
    Join Date
    Nov 2005
    Posts
    503
    Plugin Contributions
    6

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

    Quote Originally Posted by mc12345678 View Post
    Thanks for pointing it out and look forwards to the admin revisions
    I have a quick query regarding the initial products_with_attributes_stock page.

    Below the text Stock By Attributes - Top there is a dropdown where I can select a category. Making a selection here will open the products_filter select which displays all the products within that category.
    I'm trying to figure out the difference between the 'Search' button above the select, and the 'display' button to the right of the select.
    Both seem to have the same end result of displaying the selected product. Can one of these be removed, or is there another purpose for one or the other that I am unaware of?
    If one can be removed, which button label would you prefer to stay. IMO, 'display' seems to make more sense as you are not actually searching for anything at this point, merely making an option selection from what's presented in the select.

  5. #3395
    Join Date
    Nov 2005
    Posts
    503
    Plugin Contributions
    6

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

    @mc12345678
    A quick preview of the modified layout for the first section of the page (pending your response re the 'search' button.

    Name:  Screenshot 2021-05-29 at 01.47.54.jpg
Views: 61
Size:  33.8 KB

  6. #3396
    Join Date
    Nov 2005
    Posts
    503
    Plugin Contributions
    6

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

    I've come across an issue that appears to be SBA related as prior to it being installed there was no such problem.
    Site is running ZC 1.5.7c with the latest version of SBA from Github
    Admin>Configuration>Stock>Allow Checkout set to 'false'

    If there are any products in the cart that DO NOT have variants set, these can be either products with, or without attributes, it is not possible to proceed from shopping cart to checkout.

    The following error gets logged.

    [08-Jun-2021 22:39:26 Europe/London] Request URI: /index.php?main_page=checkout_shipping, IP address: 82.5.203.28
    #1 explode() called at [/home/mysite/public_html/includes/functions/functions_general_shared.php:147]
    #2 zen_get_prid() called at [/home/mysite/public_html/includes/functions/functions_lookups.php:174]
    #3 zen_get_products_stock() called at [/home/mysite/public_html/includes/classes/observers/class.products_with_attributes_stock.php:1869]
    #4 products_with_attributes_stock->updateNotifyHeaderStartCheckoutShipping() called at [/home/mysite/public_html/includes/classes/class.base.php:118]
    #5 base->notify() called at [/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php:11]
    #6 require(/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/mysite/public_html/index.php:35]
    --> PHP Warning: explode() expects parameter 2 to be string, array given in /home/mysite/public_html/includes/functions/functions_general_shared.php on line 147.

    Any suggestions on this issue?

  7. #3397
    Join Date
    Jul 2012
    Posts
    16,044
    Plugin Contributions
    17

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

    Quote Originally Posted by strelitzia View Post
    I've come across an issue that appears to be SBA related as prior to it being installed there was no such problem.
    Site is running ZC 1.5.7c with the latest version of SBA from Github
    Admin>Configuration>Stock>Allow Checkout set to 'false'

    If there are any products in the cart that DO NOT have variants set, these can be either products with, or without attributes, it is not possible to proceed from shopping cart to checkout.

    The following error gets logged.

    Code:
    [08-Jun-2021 22:39:26 Europe/London] Request URI: /index.php?main_page=checkout_shipping, IP address: 82.5.203.28
    #1  explode() called at [/home/mysite/public_html/includes/functions/functions_general_shared.php:147]
    #2  zen_get_prid() called at [/home/mysite/public_html/includes/functions/functions_lookups.php:174]
    #3  zen_get_products_stock() called at [/home/mysite/public_html/includes/classes/observers/class.products_with_attributes_stock.php:1869]
    #4  products_with_attributes_stock->updateNotifyHeaderStartCheckoutShipping() called at [/home/mysite/public_html/includes/classes/class.base.php:118]
    #5  base->notify() called at [/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php:11]
    #6  require(/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/mysite/public_html/index.php:35]
    --> PHP Warning: explode() expects parameter 2 to be string, array given in /home/mysite/public_html/includes/functions/functions_general_shared.php on line 147.
    Any suggestions on this issue?
    Reproduced with same setting of limiting stock to what is available (not allowing checkout if stock is out).

    Brief review of the code of the observer indicates that because I've changed to using an array internally for this area of code, that at/before any return from the function should set the products_quantity and the handled flag. Further, because of the early escape reasons for leaving the function and that there is a reason within SBA code to effectively duplicate the return logic from zen_get_products_stock, I will create a separate internal class method that will effectively use the code from the ZC software. Not at all what I really want(ed) to do, but doing this removed(s) the need to modify the core code. Anyways, I expect to have something in a few hours. Have some other things to which to tend.

    I can say that testing of product with/without variants and attributes was performed it appears with the above configuration set to true. That works, but... does not support all stores and would permit overselling when that is not acceptable/desired...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #3398
    Join Date
    Jul 2012
    Posts
    16,044
    Plugin Contributions
    17

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

    Quote Originally Posted by strelitzia View Post
    I've come across an issue that appears to be SBA related as prior to it being installed there was no such problem.
    Site is running ZC 1.5.7c with the latest version of SBA from Github
    Admin>Configuration>Stock>Allow Checkout set to 'false'

    If there are any products in the cart that DO NOT have variants set, these can be either products with, or without attributes, it is not possible to proceed from shopping cart to checkout.

    The following error gets logged.

    Code:
    [08-Jun-2021 22:39:26 Europe/London] Request URI: /index.php?main_page=checkout_shipping, IP address: 82.5.203.28
    #1  explode() called at [/home/mysite/public_html/includes/functions/functions_general_shared.php:147]
    #2  zen_get_prid() called at [/home/mysite/public_html/includes/functions/functions_lookups.php:174]
    #3  zen_get_products_stock() called at [/home/mysite/public_html/includes/classes/observers/class.products_with_attributes_stock.php:1869]
    #4  products_with_attributes_stock->updateNotifyHeaderStartCheckoutShipping() called at [/home/mysite/public_html/includes/classes/class.base.php:118]
    #5  base->notify() called at [/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php:11]
    #6  require(/home/mysite/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/mysite/public_html/index.php:35]
    --> PHP Warning: explode() expects parameter 2 to be string, array given in /home/mysite/public_html/includes/functions/functions_general_shared.php on line 147.
    Any suggestions on this issue?
    Quote Originally Posted by mc12345678 View Post
    Reproduced with same setting of limiting stock to what is available (not allowing checkout if stock is out).

    Brief review of the code of the observer indicates that because I've changed to using an array internally for this area of code, that at/before any return from the function should set the products_quantity and the handled flag. Further, because of the early escape reasons for leaving the function and that there is a reason within SBA code to effectively duplicate the return logic from zen_get_products_stock, I will create a separate internal class method that will effectively use the code from the ZC software. Not at all what I really want(ed) to do, but doing this removed(s) the need to modify the core code. Anyways, I expect to have something in a few hours. Have some other things to which to tend.

    I can say that testing of product with/without variants and attributes was performed it appears with the above configuration set to true. That works, but... does not support all stores and would permit overselling when that is not acceptable/desired...
    How about this commit: https://github.com/mc12345678/Stock_...4432003eba31ca
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #3399
    Join Date
    Nov 2005
    Posts
    503
    Plugin Contributions
    6

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

    I'll have a look at that in a moment and report back .

    One other question. In the shopping cart it displays the image assigned to the attribute for the selected variant. Unless I missed it in admin somewhere, I don't see any way to override this as an option. The site where SBA is being used has icons to represent different strengths of a product, so having this display as the product image in cart is not a desirable option in this use case.
    If it's not admin switchable, can you point me to the file where this is controlled so I can modify the behaviour? Perhaps add it as a configurable option if not already.

  10. #3400
    Join Date
    Jul 2012
    Posts
    16,044
    Plugin Contributions
    17

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

    Quote Originally Posted by strelitzia View Post
    I'll have a look at that in a moment and report back .

    One other question. In the shopping cart it displays the image assigned to the attribute for the selected variant. Unless I missed it in admin somewhere, I don't see any way to override this as an option. The site where SBA is being used has icons to represent different strengths of a product, so having this display as the product image in cart is not a desirable option in this use case.
    If it's not admin switchable, can you point me to the file where this is controlled so I can modify the behaviour? Perhaps add it as a configurable option if not already.
    General design consideration had been to use/consider attribute swap to replace the main product image with the image for the selected attribute(s). The only control at the moment on the above particular feature was whether to show the image of the product on the shopping cart or not. Seeing as it is desired to show the image on the cart, an alternative "test" is/would be necessary to accomodate.

    At the moment the "easiest" fix without touching the database (either adding options onto an existing switch or adding another admin option) would be to comment out one line of code:
    In includes/classes/observers/class.products_with_attributes_stock.php line 1796 in the old version or 1833
    Code:
    //        $productArray[$i]['productsImage'] = (IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $productArray[$i]['attributeImage'][count($productArray[$i]['attributeImage']) - 1], $productArray[$i]['productsName'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : '');
    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