Page 277 of 359 FirstFirst ... 177227267275276277278279287327 ... LastLast
Results 2,761 to 2,770 of 3589
  1. #2761
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by fbroz View Post
    I submitted this statement in the SQL Query Executor, and the products look good:

    https://www.tokyopenshop.com/shop2/g...ec-c-p-18.html

    Do I need to reverse the assignment of the pink option value to be a stock-dependent option for this test to be valid?
    Nope, that update query made it so that the single entry (as far as I have directed) is no longer a factor in the overall stock evaluation and therefore the stock quantities associated with pink for that specific product are again controlled by what you enter in the sba admin table regardless of how it is entered (combined like you currently have, individual attribute(s) as in each option value listed individually with one or more option names and a single option name).

    Further indicates that right now as written, having nothing in the table is a problem. Because of the "business" associated with attributes, a "database" friendly alternative to constantly checking it is needed. Whether it is an admin switch to use/not use the extra feature, or a "test" in the system that is occasionally run when manipulating the admin side to validate that at least one value is present or some other solution, but at least both the current problem and a potential solution are identified. Thank you.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2762

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    mc12345678,

    I think I am getting close with my SBA implementation, but I currently don't see attributes on some products in the shopping cart page and I wonder if you have some insights. I have other mods that may be affecting this page as well.

    Products with zero or two option names associated seem fine, but products with one option name show up in the cart without their attributes listed. For example this product: https://www.tokyopenshop.com/shop2/m...cil-p-624.html

    I believe this "if" is failing in the tpl_shopping_cart_default.php file in my template

    Code:
      if (isset($product['attributes']) && is_array($product['attributes'])) {
    Here are my current settings that I think might be relevant to SBA:

    Click image for larger version. 

Name:	Screen Shot 2017-08-30 at 3.46.06 PM.jpg 
Views:	46 
Size:	40.6 KB 
ID:	17260Click image for larger version. 

Name:	Screen Shot 2017-08-30 at 3.46.50 PM.jpg 
Views:	49 
Size:	25.5 KB 
ID:	17259

    Thanks in advance for any help!

  3. #2763
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by fbroz View Post
    mc12345678,

    I think I am getting close with my SBA implementation, but I currently don't see attributes on some products in the shopping cart page and I wonder if you have some insights. I have other mods that may be affecting this page as well.

    Products with zero or two option names associated seem fine, but products with one option name show up in the cart without their attributes listed. For example this product: https://www.tokyopenshop.com/shop2/m...cil-p-624.html

    I believe this "if" is failing in the tpl_shopping_cart_default.php file in my template

    Code:
      if (isset($product['attributes']) && is_array($product['attributes'])) {
    Here are my current settings that I think might be relevant to SBA:

    Click image for larger version. 

Name:	Screen Shot 2017-08-30 at 3.46.06 PM.jpg 
Views:	46 
Size:	40.6 KB 
ID:	17260Click image for larger version. 

Name:	Screen Shot 2017-08-30 at 3.46.50 PM.jpg 
Views:	49 
Size:	25.5 KB 
ID:	17259

    Thanks in advance for any help!
    Actually, and unfortunate for the formal lack of instruction, but basically, in the Dynamic Dropdowns section, the single_dropdown per the original dynamic dropdown instruction does not work properly and that if anything the multiple dropdowns option should be chosen. As written elsewhere in this thread, the single selection feature had already been developed and was functional, it was the multiple attributes that needed to be further implemented and Dynamic Dropdowns was the closest public application that supported it, but it also had its own other "issues". For some, they have worked out those issues, for others, they have used it as originally described. In trying not to break apart others work, I developed an alternative selection that offered the features that were missing and worked to get the desired results.

    That said, the better option for single option name attributes to a product is to leave dynamic dropdowns set to the default setting for enable dynamic dropdowns (for multiple attributes only or the value of 2), to restore the Product Info Single Attribute Display Plugin to multiple_dropdowns (though it will not have an effect with the setting above set) and then to modify the option name type (in Option Names Manager) to the SBA Select List (Dropdown) Basic option type instead of the standard Dropdown option.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #2764
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,582
    Plugin Contributions
    29

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    This was working fine. I'm not sure when the problem started. This occurs only on one, not very popular product.

    When clicking Add to Cart, I get:
    WARNING: An Error occurred, please refresh the page and try again.

    Error log contains:
    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 'and products_id = 110
    OR (options_id = 3 AND options_values_' at line 4 :: select products_attributes_id
    from products_attributes
    where options_values_id =
    and products_id = 110
    OR (options_id = 3 AND options_values_id = 0 AND products_id = 110)
    order by products_attributes_id ==> (as called by) /home/agag/public_html/includes/functions/extra_functions/products_with_attributes.php on line 350 <== in /home/agag/public_html/includes/classes/db/mysql/query_factory.php on line 167

    Zen Cart 1.5.1a
    SBA Version 1.5.4 for Zen Cart Version 1.5.5a

    The item has one attribute which is not tracked by SBA, the option type is Text. When I do add it, I get the same error. If I add a second attribute, no error. It will add to cart.
    https://www.shopasgoodasgold.com/don...bandanna-p-110

  5. #2765
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by jeking View Post
    This was working fine. I'm not sure when the problem started. This occurs only on one, not very popular product.

    When clicking Add to Cart, I get:
    WARNING: An Error occurred, please refresh the page and try again.

    Error log contains:
    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 'and products_id = 110
    OR (options_id = 3 AND options_values_' at line 4 :: select products_attributes_id
    from products_attributes
    where options_values_id =
    and products_id = 110
    OR (options_id = 3 AND options_values_id = 0 AND products_id = 110)
    order by products_attributes_id ==> (as called by) /home/agag/public_html/includes/functions/extra_functions/products_with_attributes.php on line 350 <== in /home/agag/public_html/includes/classes/db/mysql/query_factory.php on line 167

    Zen Cart 1.5.1a
    SBA Version 1.5.4 for Zen Cart Version 1.5.5a

    The item has one attribute which is not tracked by SBA, the option type is Text. When I do add it, I get the same error. If I add a second attribute, no error. It will add to cart.
    https://www.shopasgoodasgold.com/don...bandanna-p-110
    The version of that file is from Mar 27, 2016 or earlier (older). There is some code that was added above there at a later time to address that potential result, and actually as the plugin stands, that file no longer contains execution code (all commented out), but the installer has not been updated to remove it. If you wish to continue using that version of the software, there is a single fix for that area of the code:
    At/around line 320 change:
    Code:
            if ($multi) {
              $first_search = 'where options_values_id in (' . implode(',', $temp_attributes) . ')';  // This helps make a list of items where the options_values_id is compared to each individual attribute ("x","y","z")
            } else {
              $first_search = 'where options_values_id = ' . implode(',', $temp_attributes);  // This helps make a list of items where the options_values_id is compared to each individual attribute ("x","y","z")
    //            $first_search = 'where options_values_id = "' . $attribute . '"';
            }
    to the following by adding the below highlighted if statement:

    Code:
            if ($multi) {
              $first_search = 'where options_values_id in (' . implode(',', $temp_attributes) . ')';  // This helps make a list of items where the options_values_id is compared to each individual attribute ("x","y","z")
            } else {
              $first_search = 'where options_values_id = ' . implode(',', $temp_attributes);  // This helps make a list of items where the options_values_id is compared to each individual attribute ("x","y","z")
              if (implode(',', $temp_attributes) == "") {
                $first_search = 'where options_values_id = 0';  // This helps make a list of items where the options_values_id is compared to each individual attribute ("x","y","z")
              }
    //            $first_search = 'where options_values_id = "' . $attribute . '"';
            }

    Also, above that code area is some missing sanitization that is shown in the current version of that function which is located in includes/classes/class.products_with_attributes_class_stock.php around line 453 of that file as available from github.

    Code:
              } elseif ($optvalid == 0) {
                $specAttributes[$optid] = (int)$optvalid;
              } elseif (is_array($optvalid)) {
                if ($multi == false && count($optvalid) > 1) {
                  $multi = true;
                }
                foreach($optvalid as $optid2=>$optvalid2) {
                  $temp_attributes[] = (int)$optvalid2;
                }
              } elseif (true) { // mc12345678 Here is one place where verification can be performed as to whether a particular attribute should be added.  This is probably the best place to do the review because all aspects of the attribute are available.
                $temp_attributes[] = (int)$optvalid;
              }
    Lastly, though I stopped searching backwards to see when line 350 had become the sql execution line to present that error, this link shows all of the changes that have been made since March 27, 2016: https://github.com/mc12345678/Stock_...b5d4d...master
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #2766
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,582
    Plugin Contributions
    29

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    That fix did it, thank you!

    I do have plans to upgrade the site and SBA. Just need to find the time. Being that I support this in my free time, that has been difficult. :-)

  7. #2767
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by jeking View Post
    That fix did it, thank you!

    I do have plans to upgrade the site and SBA. Just need to find the time. Being that I support this in my free time, that has been difficult. :-)
    Roger that, I know the feeling...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #2768
    Join Date
    Jul 2011
    Posts
    35
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    I searched this thread and could not find info on this. I installed both the Dynamic Drpodown and the SBA add on to my Zen shop. I am getting a warning under the add to cart and am trying to figure out why. It is not allowing the drop down. here is the link here -->http://underworldfigures.com/index.p...products_id=67

    I am using Zen cart 1.5.0
    Last edited by Zoloworld; 13 Sep 2017 at 09:36 PM.

  9. #2769
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by Zoloworld View Post
    I searched this thread and could not find info on this. I installed both the Dynamic Drpodown and the SBA add on to my Zen shop. I am getting a warning under the add to cart and am trying to figure out why. It is not allowing the drop down. here is the link here -->http://underworldfigures.com/index.p...products_id=67
    Ok, so when you say you installed both SBA and Dynamic Dropdowns, need to back up a second. The distribution available from https://github.com/mc12345678/Stock_...butes_Combined, has or is both of those. So, the statement makes one wonder what the source of your install was.

    That said, anytime you see an error (which may actually be unrelated to the above distribution), there are some easy actions to perform as identified in this ZC provided FAQ: https://www.zen-cart.com/content.php...-and-try-again

    Whatever the case, if you would be so kind as to identify how the site got to where it is in relation to the above and then if you need assistance interpreting the associated information (preferably as it relates to the install as described above) then feel free to post the contents here (sanitize out any specific file path information of concern and please press the # button in the message box toolbar just before pasting.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #2770
    Join Date
    Jul 2011
    Posts
    35
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by mc12345678 View Post
    Ok, so when you say you installed both SBA and Dynamic Dropdowns, need to back up a second. The distribution available from https://github.com/mc12345678/Stock_...butes_Combined, has or is both of those. So, the statement makes one wonder what the source of your install was.

    That said, anytime you see an error (which may actually be unrelated to the above distribution), there are some easy actions to perform as identified in this ZC provided FAQ: https://www.zen-cart.com/content.php...-and-try-again

    Whatever the case, if you would be so kind as to identify how the site got to where it is in relation to the above and then if you need assistance interpreting the associated information (preferably as it relates to the install as described above) then feel free to post the contents here (sanitize out any specific file path information of concern and please press the # button in the message box toolbar just before pasting.
    Thank you so much for the reply.
    I downloaded it from the plug-ins section. It did not have both as I was looking after I added the SQL info. I am going to run a debug log to see if an error shows up.

 

 

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