Page 259 of 359 FirstFirst ... 159209249257258259260261269309 ... LastLast
Results 2,581 to 2,590 of 3589
  1. #2581
    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

    Found the solution like 2 hours ago, but haven't had a chance to write it up for others to reproduce. Involves changing a for loop into a foreach loop.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2582
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

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

    Quote Originally Posted by mc12345678 View Post
    Found the solution like 2 hours ago, but haven't had a chance to write it up for others to reproduce. Involves changing a for loop into a foreach loop.
    If you want to point me at it I'll test it here

  3. #2583
    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 badarac View Post
    If you want to point me at it I'll test it here
    Let me see if I have enough resources immediately available.

    I know it's in the includes/functions/extra_functions file.
    Then in zen_get_sba_stock_attribute there is the
    Code:
    for ($j =0; $j < $k; $j++)
    If changed to like:
    Code:
    foreach ($attribute_list as $j => $attrib_data)
    I'm not sure if I'm set on the second part of the variable, but for current operation and coding it doesn't matter, the stock of a multi-attribute (combined) variant did get reduced. I had tried a couple of other things as well, but when I restored the for loop it broke it, when I used foreach it worked...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #2584
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

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

    Quote Originally Posted by mc12345678 View Post
    Let me see if I have enough resources immediately available.

    I know it's in the includes/functions/extra_functions file.
    Then in zen_get_sba_stock_attribute there is the
    Code:
    for ($j =0; $j < $k; $j++)
    If changed to like:
    Code:
    foreach ($attribute_list as $j => $attrib_data)
    I'm not sure if I'm set on the second part of the variable, but for current operation and coding it doesn't matter, the stock of a multi-attribute (combined) variant did get reduced. I had tried a couple of other things as well, but when I restored the for loop it broke it, when I used foreach it worked...
    That worked fine. Thanks!

    Here's the code to change at line 243 from
    PHP Code:
        if (isset($attribute_list) && is_array($attribute_list) && ($k sizeof($attribute_list) > 0)) {
          if (
    $from == 'order') {
            for (
    $j 0$j $k$j++) { // Change this line to fix update stock 
            
    if (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[$attribute_list[$j]['option_id']] = $attribute_list[$j]['value_id'];
              }
            }
            
    $attribute_list $temp_attributes
    Change it to
    PHP Code:
        if (isset($attribute_list) && is_array($attribute_list) && ($k sizeof($attribute_list) > 0)) {
          if (
    $from == 'order') {
                   foreach (
    $attribute_list as $j => $attrib_data) { //Changed to fix update stock 
              
    if (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[$attribute_list[$j]['option_id']] = $attribute_list[$j]['value_id'];
              }
            }
            
    $attribute_list $temp_attributes
    Last edited by badarac; 20 Jul 2016 at 08:20 PM.

  5. #2585
    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

    So I committed that solution to the github repo, though I continued to use spaces instead of tabs. Still need/want to verify that quantities for all entries decrease as expected if the product is made up of multiple individual attributes...

    Again, thank you for the backup, comment, and testing... I did find a few other minor improvements, but that type of thing I think is going to continue as I now get more of a chance to review the code rather than either write new or rewrite existing code. Starting to slip little things in like buttons to move from one area to another to make manipulation/navigation easier, going to modify some of the admin portion of the SBA editing area so that can grow a little and maybe add some additional fields, either add a switch or an indicator if a set of attributes are using the simple SBA dropdown option and allow that setting to be modified (for all such attributes, or could specialize it for just that/those attributes on that product, etc), looking to move those extra functions into a class instead so that at least things are consolidated and since it seems the SBA "code" really is only used by SBA, otherwise there's a few pieces of information to be displayed which could come from SBA. Lot's of little things, but want to tidy up a little and get some additional consistency on the customid. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #2586
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    605
    Plugin Contributions
    0

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

    SBA is something I really could use, but do I understand that it's not compatible with Zencart v.155? Would it be better for me to wait until 1.6 is released? I don't have such huge inventory that it will be a major problem right now, but that is likely to change.

  7. #2587
    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 HeleneWallis View Post
    SBA is something I really could use, but do I understand that it's not compatible with Zencart v.155? Would it be better for me to wait until 1.6 is released? I don't have such huge inventory that it will be a major problem right now, but that is likely to change.
    Umm... Did you happen to look back a "page" (assuming your view supports page viewing?) Or at post 2571?

    It has not been issued to the ZC site yet for ZC 1.5.5, but that is because there are a few known things still being worked on, but in general it is pretty darn close. Trying to touch a few odds and ends that seem easy to address, and then should be able to get the instructions updated that potteryhouse worked on and submit as an updated plugin compatible with ZC 1.5.1 through 1.5.5.

    Current location is on github.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #2588
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    5
    Plugin Contributions
    0

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

    Help, I'm trying to get Stock_By_Attributes_Combined-master working on the new ZC 1.5.5.
    But somewere I get stucked.

    It's all working fine untill I try to put something in the basket. Then the store gives a faillure.

    Fatal error: 1054:Unknown column 'Array' in 'where clause' :: select products_attributes_id
    from products_attributes
    where options_values_id = Array
    and products_id = 1

    order by products_attributes_id ==> (as called by) /customers/4/8/9/phaedram.nl/httpd.www/includes/functions/extra_functions/products_with_attributes.php on line 378 <== in /customers/4/8/9/phaedram.nl/httpd.www/includes/classes/db/mysql/query_factory.php on line 167


    Can someone please give me a hint where to look for?

  9. #2589
    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

    So, looking at the code that is available right now, it seems like that area of the includes/functions/extra_functions/products_with_attributes.php file is supposed to be provided a value that is fed to an array and then the array is imploded (which takes each array item, and puts it together with the previous) thus no array is left behind...

    What is unique about the product? Is it some sort of special product type? What plugin(s) are also installed. Can't reproduce the issue unless the attribute(s) of the product are themselves some sort of array of additional attributes or the like.

    How about a Web address?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #2590
    Join Date
    Jul 2016
    Location
    Amsterdam
    Posts
    5
    Plugin Contributions
    0

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

    The webstore is: http://www.phaedram.nl

    And other plugin's are: edit orders, super orders, ideal and dutch translation. These plugins work just fine.
    And also Stock by attribute, that is until I try to put a item in the basket.

    Tjalling
    Last edited by Tjalling; 25 Jul 2016 at 08:12 PM. Reason: better weblink

 

 

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