Page 38 of 113 FirstFirst ... 2836373839404888 ... LastLast
Results 371 to 380 of 1125
  1. #371
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    Nectarina

    The SQL error is just telling you that you have run it once and don't need to run it again. As to the checkout issues, please read post 366 just a little way above yours.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  2. #372
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Stocks by attributes

    I encounter a minor problem here: stock by attribute work great until I add a second att, which is readonly type. Now I always get the out of stock msg when I try to check out, any idea?

    Thanks.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #373
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Stocks by attributes

    Well, I get why it doesnt work: when I add stock, this mod kinda forces me to include that readonly att as well, but on the store side, since it's a readonly att, it doesnt have any value to be passed along with the form.

    Now we have to exclude readonly attributes to be counted for stock. Huhm
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #374
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Stocks by attributes

    Hah, I solved my own problem, I rewrote the code a bit to put in a switch so that I can exclude readonly attributes. A quick dirty hack which can be further improved:
    file edited: admin/includes/classes/products_with_attributes_stock.php
    There can be a better way to do this, like putting a checkbox next to each attribute so we can check off to exclude it, but well, I need a quick solution for now.

    PHP Code:
    <?php
        
    class products_with_attributes_stock
        
    {    
            function 
    get_products_attributes($products_id$languageId=1$exclude_hidden=true)
            {
                global 
    $db;
            
                
    $query '    select 
                                patrib.products_attributes_id, patrib.options_values_price, patrib.price_prefix,
                                 popt.products_options_name, pval.products_options_values_name
                             from '
    .TABLE_PRODUCTS_ATTRIBUTES.' as patrib, '.TABLE_PRODUCTS_OPTIONS.' as popt, '.TABLE_PRODUCTS_OPTIONS_VALUES.' as pval
                             where
                                 patrib.products_id = "'
    .$products_id.'" AND patrib.options_id = popt.products_options_id
                                 AND popt.language_id = "'
    .$languageId.'" and popt.language_id = pval.language_id
                                and patrib.options_values_id = pval.products_options_values_id'
    ;
                if(
    $exclude_hidden)
                    
    $query .= ' AND popt.products_options_type <> 5';
                
    $attributes $db->Execute($query);
                
                if(
    $attributes->RecordCount()>0)
                {
                    while(!
    $attributes->EOF)
                    {
                        
    $attributes_array[$attributes->fields['products_options_name']][] =
                            array(
    'id' => $attributes->fields['products_attributes_id'],
                                  
    'text' => $attributes->fields['products_options_values_name']
                                              . 
    ' (' $attributes->fields['price_prefix']
                                            . 
    '$'.zen_round($attributes->fields['options_values_price'],2) . ')' );
                        
    $attributes->MoveNext();
                    }
        
                    return 
    $attributes_array;
        
                }
                else
                {
                    return 
    false;
                }
            }
        
            function 
    update_parent_products_stock($products_id)
            {
                global 
    $db;

                
    $query 'select sum(quantity) as quantity from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id = "'.(int)$products_id.'"';
                
    $quantity $db->Execute($query);
                
    $query 'update '.TABLE_PRODUCTS.' set  products_quantity="'.$quantity->fields['quantity'].'" where products_id="'.(int)$products_id.'"';
                
    $db->Execute($query);
            }
        
        
            function 
    get_attributes_name($attribute_id$languageId=1)
            {
                global 
    $db;

                
    $query 'select patrib.products_attributes_id, popt.products_options_name, pval.products_options_values_name
                             from '
    .TABLE_PRODUCTS_ATTRIBUTES.' as patrib, '.TABLE_PRODUCTS_OPTIONS.' as popt, '.TABLE_PRODUCTS_OPTIONS_VALUES.' as pval
                             where patrib.products_attributes_id = "'
    .$attribute_id.'"
                                AND patrib.options_id = popt.products_options_id
                                 AND popt.language_id = "'
    .$languageId.'"
                                and popt.language_id = pval.language_id
                                and patrib.options_values_id = pval.products_options_values_id'
    ;
                                
                
    $attributes $db->Execute($query);
                if(!
    $attributes->EOF)
                {        
                    
    $attributes_output = array('option' => $attributes->fields['products_options_name'],
                                               
    'value' => $attributes->fields['products_options_values_name']);
                    return 
    $attributes_output;
                }
                else
                {
                    return 
    false;
                }
            }
        }

    ?>
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #375
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    @yellow1912

    Thanks for posting your solution. There's plenty of scope to improve this mod. But I wouldn't recommend that anybody spend too much time on it, unless absolutely necessary (as it was for you here), as it will be rendered obsolete by Zen Cart 1.4.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #376
    Join Date
    Oct 2007
    Posts
    107
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Ok...

    Installed this mod....

    Then realised I had installed wrong version (installed version for Zen 1.38)...

    Mod doesn't work, allows me to check out with more products than I have told Zen are available. Assume the problems lies with installing the wrong version...

    How do I uninstall the wrong version so I can start again with the correct version...

    Many thanks

    Arkie...

  7. #377
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    Quote Originally Posted by Arkwright View Post
    realised I had installed wrong version (installed version for Zen 1.38)...

    Mod doesn't work, allows me to check out with more products than I have told Zen are available. Assume the problems lies with installing the wrong version...

    How do I uninstall the wrong version so I can start again with the correct version...
    Although there would be problems arising from installing version 4.7 instended for Zen cart 1.3.8 onto your 1.3.7 cart, from the symptoms that you describe, it sounds more like you have an incomplete installation.

    Seen a few of these recently, where FTP programs appear to have copied all of the files across, but in practise haven't overwitten existing files.

    The good news is that since the only changes for 1.3.8 were to files that were also in 1.3.7 and the were no database changes, you don't need to uninstall, you can simply copy the files from version 4.6 onto your site. But do check that they arrive safely by checking your FTP programs error log and the dates modified on your server.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #378
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: Stocks by attributes

    Is it possible to have the drop downs be dynamic based on stock? For example if I have shirts in sizes large and small but only have green in the small and not orange. Could the color drop downs on the product display only green if I have selected small?

  9. #379
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    You might want to try the latest version of StockAttribute by danielcor which uses AJAX to dynamically update the stock levels depending upon customer selections. However, it's based on an older version of Zen Cart and a slightly buggy version of the Attribute Stock mod from which the mod to which this thread refers was derived.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #380
    Join Date
    Oct 2007
    Posts
    107
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by kuroi View Post
    Although there would be problems arising from installing version 4.7 instended for Zen cart 1.3.8 onto your 1.3.7 cart, from the symptoms that you describe, it sounds more like you have an incomplete installation.

    Seen a few of these recently, where FTP programs appear to have copied all of the files across, but in practise haven't overwitten existing files.

    The good news is that since the only changes for 1.3.8 were to files that were also in 1.3.7 and the were no database changes, you don't need to uninstall, you can simply copy the files from version 4.6 onto your site. But do check that they arrive safely by checking your FTP programs error log and the dates modified on your server.
    Thanks for the reply Kuroi...

    I've uploaded all the files from 4.6. Checked my FTP error log and dates modified and everything checks out ok. No errors, dates modified as they should be...

    Unfortunately hasn't made any difference whatsoever to my problem.

    Zencart still allows a buyer to add more products than are available and allows them to go through checkout with them..

    As an aside which may or may not be connected to my problem, I assume when I add a product from scratch, I put 0 in the quantity box and then add the attribute to the product and then add stock quantities to each attribute?

    If this is the correct way to list a product and it's stock levels for each attribute, then I'm at a loss as to why I'm still having this problem...

    Any ideas?

    Thanks
    Arkie.....

 

 
Page 38 of 113 FirstFirst ... 2836373839404888 ... LastLast

Similar Threads

  1. v139h Stocks of certain products disappearing automatically
    By Lowwi in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2015, 09:09 PM
  2. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM
  3. Stocks by attributes
    By hcd888 in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 08:52 AM
  4. Multiple stocks per product
    By jaycode in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2007, 11:55 AM
  5. Products with attribute stocks
    By Svanis in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2006, 03:19 AM

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