Page 300 of 356 FirstFirst ... 200250290298299300301302310350 ... LastLast
Results 2,991 to 3,000 of 3558
  1. #2991
    Join Date
    Nov 2011
    Location
    Brisbane, Australia
    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
    Thought I would throw that out there in case anyone had interest, was curious etc. Welcome further input now that all of the built in attribute types are supported at least for a basic set of options. Working on version identification as well...

    Software is currently available from github at https://github.com/mc12345678/Stock_...butes_Combined or as a zip file by this link: https://github.com/mc12345678/Stock_...ive/master.zip
    Thanks for working on this. I have been trying but to no avail yet on my own!

    For the files you have here in the Combined - if I am running 1.5.5, do I just use the files in the 1_5_5 folder, or also the ones in the top level folders of admin and includes? Clearly there are overwrites if I use both. Do I just dump the files from 1.5.5 in the top folders for the full combined files?

    Thanks,
    Chris

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

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

    Quote Originally Posted by gohealth View Post
    Thanks for working on this. I have been trying but to no avail yet on my own!

    For the files you have here in the Combined - if I am running 1.5.5, do I just use the files in the 1_5_5 folder, or also the ones in the top level folders of admin and includes? Clearly there are overwrites if I use both. Do I just dump the files from 1.5.5 in the top folders for the full combined files?

    Thanks,
    Chris
    Being open source software, the possibilities are endless of what changes have been made to what files for what reasons. For a store that is "fresh" out-of-the-box, generally the files can be transferred to overwrite existing files if they exist, but, where the same file exists on the server as in the plugin, it is advised that the files either be compared to the current file or to a vanilla version of the original file. In either case, the goal is to identify what was modified to provide the associated functionality. Where changes have been made to the original file, I have tried to provide a comment in the file, though I expect I have missed one or more here and there.

    So, regarding the files needed for operation, the files in the base includes and admin folders are common to all currently posted and supported versions. There are a few template override files in the includes folder. Then, there are the files that are specific to the associated version(s). For 1.5.3 and 1.5.4, the differences were so small that it didn't seem worth trying to maintain two different folders.

    The core functionality is provided in those first two folders, after that, well, some might call some of the version specific files bells and whistles. :) the core files should be loaded first and even ideally the install executed. Operation should remain supported (though at reduced effect) until the version files are incorporated.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #2993
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

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

    I was told this would do what I need. I have a vinyl decal business. Say I have 50 colors. 100 products. I have the colors and type of vinyl all setup in attributes. this all works great. What I'm looking for is if I sale out of two colors, I want to be able to mark that color out of stock across the board and not have to update each product.

  4. #2994
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

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

    Quote Originally Posted by cubmanky View Post
    I was told this would do what I need. I have a vinyl decal business. Say I have 50 colors. 100 products. I have the colors and type of vinyl all setup in attributes. this all works great. What I'm looking for is if I sale out of two colors, I want to be able to mark that color out of stock across the board and not have to update each product.
    There's a couple of ways to get the final result (the two colors not being available), but the admin control at this time does not have necessarily a "click this" to disable the option value across all product. (If you can imagine the multiple different ways attributes can be applied, you may understand why this specific case has not yet been incorporated.)

    At any rate, the first question to this is are the 100 product truly individual product in the store? If so, do they have only the color attribute or some additional attribute? Then once a color is not available, do you want the option to still show in the list (out-of-stock or similar) or do you not want it to appear at all? Is stock actually maintained in Zen Cart for these color/product combinations or is it more of a go/no go?

    Answers to those will help me identify one or more ways that the action can be accomplished now and perhaps something developed for future use.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #2995
    Join Date
    Jan 2014
    Posts
    216
    Plugin Contributions
    0

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

    are the 100 product truly individual product in the store?
    yes each item is a new product

    If so, do they have only the color attribute or some additional attribute?
    Color only.

    Then once a color is not available, do you want the option to still show in the list (out-of-stock or similar) or do you not want it to appear at all?
    I like the out of stock option, but open to it now showing also.

    Is stock actually maintained in Zen Cart for these color/product combinations or is it more of a go/no go?
    I would say more of a go no go. Where I can go in and mark a color out of stock.

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

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

    Quote Originally Posted by cubmanky View Post
    are the 100 product truly individual product in the store?
    yes each item is a new product

    If so, do they have only the color attribute or some additional attribute?
    Color only.

    Then once a color is not available, do you want the option to still show in the list (out-of-stock or similar) or do you not want it to appear at all?
    I like the out of stock option, but open to it now showing also.

    Is stock actually maintained in Zen Cart for these color/product combinations or is it more of a go/no go?
    I would say more of a go no go. Where I can go in and mark a color out of stock.
    Ok. So. First overall issue I see for this method of implementation as it relates to the current options made available is initially populating all of the product with the associated color attribute "quickly". Now, I haven't gone through the export/import feature that potteryhouse had incorporated in a while, but it seemed to be written with single attribute (color) type functionality and likely could help with that aspect.

    So, how to address the rest. Once the color is associated with the product and a quantity of at least 1 is applied (assuming that the stock configuration settings are such not to decrease the quantity), then if want to show the out-of-stock option, a sql query would need to be written to set all of the item's attribute to a quantity of 0. If wanted to just not display the color option, then could use the catalog->iption Values manager to delete the color option from all product (problem there is that when it came back in stock it would also need to be added back to all product which can be done in much the same way but then also have to add back to the attribute tracking section).

    Now if the product had not yet been generated, there is the ability to copy attributes from an existing product to the new product including those tracked by SBA.

    If the sql route were used, a similar sql statement would be used to change the stock quantity to 1 (or whatever number) when the product came back in stock.

    It can also be set to not show the out-of-stock attributes.

    Now, I did just think/remember something. Not that long ago, I added a feature that would allow designating that an attribute was not tracked by stock (meaning can get indefinitely until it was turned off), which is a lot like you are seeking. Currently it is controlled only by sql statements, but it supports the ability of saying that an option value is in stock for all product (or all product that have a given option name (color)). The display and management of that feature hasn't been developed yet because the full possibilities haven't quite yet been realized. Didn't want to create something that was going to be difficult to expand upon and would prefer the interface to be understandable.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #2997
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

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

    Quote Originally Posted by mc12345678 View Post
    I have also loaded several other changes and improvements (that follow the above) and can be found at:
    https://github.com/mc12345678/Stock_...ombined/master
    I have applied the above changes to a v1.5.5f site, it seems that the changes to includes/classes/class.products_with_attributes_class_stock.php are causing problems. The error I get when adding a SBA attributed product to the cart (from the product info page) is
    Code:
    [23-Sep-2018 15:08:12 Europe/London] Request URI: /my-category/my-product?number_of_uploads=0&action=add_product, IP address: 127.0.0.1
    #1  trigger_error() called at [\www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php:793]
    #2  products_with_attributes_class_stock->zen_sba_attribs_no_text() called at [\www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php:787]
    #3  include(\www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php) called at [\www\mydomain.co.uk\includes\main_cart_actions.php:26]
    #4  require(\www\mydomain.co.uk\includes\main_cart_actions.php) called at [\www\mydomain.co.uk\includes\init_includes\init_cart_handler.php:44]
    #5  require(\www\mydomain.co.uk\includes\init_includes\init_cart_handler.php) called at [\www\mydomain.co.uk\includes\autoload_func.php:48]
    #6  require(\www\mydomain.co.uk\includes\autoload_func.php) called at [\www\mydomain.co.uk\includes\application_top.php:170]
    #7  require(\www\mydomain.co.uk\includes\application_top.php) called at [\www\mydomain.co.uk\index.php:26]
    
    [23-Sep-2018 15:08:12 Europe/London] PHP Warning:  SBA product can not have any attributes in \www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php on line 793
    [23-Sep-2018 15:08:12 Europe/London] PHP Stack trace:
    [23-Sep-2018 15:08:12 Europe/London] PHP   1. {main}() \www\mydomain.co.uk\index.php:0
    [23-Sep-2018 15:08:12 Europe/London] PHP   2. require() \www\mydomain.co.uk\index.php:26
    [23-Sep-2018 15:08:12 Europe/London] PHP   3. require() \www\mydomain.co.uk\includes\application_top.php:170
    [23-Sep-2018 15:08:12 Europe/London] PHP   4. require() \www\mydomain.co.uk\includes\autoload_func.php:48
    [23-Sep-2018 15:08:12 Europe/London] PHP   5. require() \www\mydomain.co.uk\includes\init_includes\init_cart_handler.php:44
    [23-Sep-2018 15:08:12 Europe/London] PHP   6. include() \www\mydomain.co.uk\includes\main_cart_actions.php:26
    [23-Sep-2018 15:08:12 Europe/London] PHP   7. products_with_attributes_class_stock->zen_sba_attribs_no_text() \www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php:787
    [23-Sep-2018 15:08:12 Europe/London] PHP   8. trigger_error() \www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php:793
    To my inexperienced eye it would appear that this code, lines 762 - 788, are behind the issue, only because reverting to the SBA's previous version of this code gives no errors.
    PHP Code:
     if (!isset($this->_isSBA[(int)$products_id]['sql'])) {
        if (
    PRODUCTS_OPTIONS_SORT_ORDER=='0') {
          
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0"), popt.products_options_name';
        } else {
          
    $options_order_by' order by popt.products_options_name';
        }

                  
    //get the option/attribute list
        
    $sql "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order,
                                  popt.products_options_type, popt.products_options_length, popt.products_options_comment,
                                  popt.products_options_size,
                                  popt.products_options_images_per_row,
                                  popt.products_options_images_style,
                                  popt.products_options_rows
                  from        " 
    TABLE_PRODUCTS_OPTIONS " popt
                  left join " 
    TABLE_PRODUCTS_ATTRIBUTES " patrib ON (patrib.options_id = popt.products_options_id)
                  where patrib.products_id= :products_id:
                  and popt.language_id = :languages_id: " 
    .
                  
    $options_order_by;

        
    $sql $db->bindVars($sql':products_id:'$products_id'integer');
        
    $sql $db->bindVars($sql':languages_id:'$_SESSION['languages_id'], 'integer');
        
    $products_options_names $db->Execute($sql);
        
    $this->_isSBA[(int)$products_id]['sql'] = $products_options_names;
        } else {
           
    $products_options_names $this->_isSBA[(int)$products_id]['sql'];
        } 
    There doesn't seem to be anything special about the product's attributes. Product is priced by attributes, one dropdown option name with three option values (the first of which is display only)
    Simon

  8. #2998
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

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

    Should have added to the above post my setup details are:

    v1.5.5.f (PHP 7.1.9)
    Database: MySQL 5.5.5-10.2.8-MariaDB
    SBA (latest from Github)
    CEON
    CSS/JS Loader
    DPU
    Flexible Attributes
    GDPR4ZC
    Lazy Loader
    SNAF
    User Tracking
    Zen Magnific
    Dynamic Filter
    OPC
    Structured Data
    Template: modified Stirling Grand
    Simon

  9. #2999
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

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

    Quote Originally Posted by simon1066 View Post
    I have applied the above changes to a v1.5.5f site, it seems that the changes to includes/classes/class.products_with_attributes_class_stock.php are causing problems. The error I get when adding a SBA attributed product to the cart (from the product info page) is
    Code:
    [23-Sep-2018 15:08:12 Europe/London] Request URI: /my-category/my-product?number_of_uploads=0&action=add_product, IP address: 127.0.0.1
    #1  trigger_error() called at [\www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php:793]
    #2  products_with_attributes_class_stock->zen_sba_attribs_no_text() called at [\www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php:787]
    #3  include(\www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php) called at [\www\mydomain.co.uk\includes\main_cart_actions.php:26]
    #4  require(\www\mydomain.co.uk\includes\main_cart_actions.php) called at [\www\mydomain.co.uk\includes\init_includes\init_cart_handler.php:44]
    #5  require(\www\mydomain.co.uk\includes\init_includes\init_cart_handler.php) called at [\www\mydomain.co.uk\includes\autoload_func.php:48]
    #6  require(\www\mydomain.co.uk\includes\autoload_func.php) called at [\www\mydomain.co.uk\includes\application_top.php:170]
    #7  require(\www\mydomain.co.uk\includes\application_top.php) called at [\www\mydomain.co.uk\index.php:26]
    
    [23-Sep-2018 15:08:12 Europe/London] PHP Warning:  SBA product can not have any attributes in \www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php on line 793
    [23-Sep-2018 15:08:12 Europe/London] PHP Stack trace:
    [23-Sep-2018 15:08:12 Europe/London] PHP   1. {main}() \www\mydomain.co.uk\index.php:0
    [23-Sep-2018 15:08:12 Europe/London] PHP   2. require() \www\mydomain.co.uk\index.php:26
    [23-Sep-2018 15:08:12 Europe/London] PHP   3. require() \www\mydomain.co.uk\includes\application_top.php:170
    [23-Sep-2018 15:08:12 Europe/London] PHP   4. require() \www\mydomain.co.uk\includes\autoload_func.php:48
    [23-Sep-2018 15:08:12 Europe/London] PHP   5. require() \www\mydomain.co.uk\includes\init_includes\init_cart_handler.php:44
    [23-Sep-2018 15:08:12 Europe/London] PHP   6. include() \www\mydomain.co.uk\includes\main_cart_actions.php:26
    [23-Sep-2018 15:08:12 Europe/London] PHP   7. products_with_attributes_class_stock->zen_sba_attribs_no_text() \www\mydomain.co.uk\includes\extra_cart_actions\stock_by_attributes.php:787
    [23-Sep-2018 15:08:12 Europe/London] PHP   8. trigger_error() \www\mydomain.co.uk\includes\classes\class.products_with_attributes_class_stock.php:793
    To my inexperienced eye it would appear that this code, lines 762 - 788, are behind the issue, only because reverting to the SBA's previous version of this code gives no errors.
    PHP Code:
     if (!isset($this->_isSBA[(int)$products_id]['sql'])) {
        if (
    PRODUCTS_OPTIONS_SORT_ORDER=='0') {
          
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0"), popt.products_options_name';
        } else {
          
    $options_order_by' order by popt.products_options_name';
        }

                  
    //get the option/attribute list
        
    $sql "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order,
                                  popt.products_options_type, popt.products_options_length, popt.products_options_comment,
                                  popt.products_options_size,
                                  popt.products_options_images_per_row,
                                  popt.products_options_images_style,
                                  popt.products_options_rows
                  from        " 
    TABLE_PRODUCTS_OPTIONS " popt
                  left join " 
    TABLE_PRODUCTS_ATTRIBUTES " patrib ON (patrib.options_id = popt.products_options_id)
                  where patrib.products_id= :products_id:
                  and popt.language_id = :languages_id: " 
    .
                  
    $options_order_by;

        
    $sql $db->bindVars($sql':products_id:'$products_id'integer');
        
    $sql $db->bindVars($sql':languages_id:'$_SESSION['languages_id'], 'integer');
        
    $products_options_names $db->Execute($sql);
        
    $this->_isSBA[(int)$products_id]['sql'] = $products_options_names;
        } else {
           
    $products_options_names $this->_isSBA[(int)$products_id]['sql'];
        } 
    There doesn't seem to be anything special about the product's attributes. Product is priced by attributes, one dropdown option name with three option values (the first of which is display only)
    I would say that you are correct in the section of code. It would seem that the issue is in the else section of that. The reason I state that is because the first part generates a result from the query and as the error message that is generated suggests, the error message should not be generated when a product is tracked by SBA.

    So that leaves one to ask, how then is it that this error is being generated? Well, in the else section, a previous sql result is being accessed. More than likely (which I'll take a closer look at), the query was fully iterated before being stored. What that means is that in order to reuse the result, the query needs to be rewound. Because this software is compatible with older ZC versions, there are two ways to do this.

    Changing:
    Code:
       } else {
           $products_options_names = $this->_isSBA[(int)$products_id]['sql'];
        }
    To:
    Code:
       } else {
           $products_options_names = $this->_isSBA[(int)$products_id]['sql'];
            if (method_exists($products_options_names, 'rewind')) {
              $products_options_names->Rewind();
            } else {
              $products_options_names->Move(0);
              $products_options_names->MoveNext();
            }
        }
    Will likely resolve the issue for ZC 1.5.5 (in the first section) and pre-ZC 1.5.5 (in the else section that has been added).

    Thank you though for reporting this, I hadn't come across such an issue after having addressed other strict associated messages. I did review the list of plugins and considering the error and where it has occurred, I don't believe that they contribute to the issue.
    Last edited by mc12345678; 23 Sep 2018 at 07:54 PM. Reason: had incorrect sequence in method_exists()
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #3000
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

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

    Thank you for the explanation of the function of that new code. I must admit I was struggling to get my head around the logic.

    I'll implement your changes and report back if any further problems.
    Simon

 

 

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