Page 104 of 113 FirstFirst ... 45494102103104105106 ... LastLast
Results 1,031 to 1,040 of 1125
  1. #1031
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I sometimes get confused as to where a prefix would go.

    This sql patch from the latest SBA update. Is this sql code ok to use for a cart that uses no prefix? The configure file shows no prefix is in use.

    PHP Code:
    CREATE TABLE products_with_attributes_stock (
            
    stock_id INT NOT NULL AUTO_INCREMENT ,
            
    products_id INT NOT NULL ,
            
    stock_attributes VARCHAR255 NOT NULL ,
            
    quantity FLOAT NOT NULL ,
            
    sort INT NOT NULL ,
            
    PRIMARY KEY ( `stock_id` )
            );

    INSERT INTO configuration (configuration_titleconfiguration_keyconfiguration_value
           
    configuration_descriptionconfiguration_group_idsort_order
           
    last_modifieddate_addeduse_functionset_function
           
    VALUES ('Show available stock level in cart when less than order''STOCK_SHOW_LOW_IN_CART''false'
                   
    'When customer places more items in cart than are available, show the available amount on the shopping cart page:',
                   
    '9',
                   
    '6',
                   
    NULL,
                   
    now(),
                   
    NULL,
                   
    "zen_cfg_select_option(array('true', 'false'),"
           
    ),
           (
    'Display Images in Admin''STOCK_SHOW_IMAGE''false'
                   
    'Display image thumbnails on Products With Attributes Stock page? (warning, setting this to true can severly slow the loading of this page):',
                   
    '9',
                   
    '6',
                   
    NULL,
                   
    now(),
                   
    NULL,
                   
    "zen_cfg_select_option(array('true', 'false'),"
           
    ); 

  2. #1032
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I am installing SBA 1.4.12 on a test cart 139h with a prefix of zen_

    I installed the sql patch as provided in admin > tools > install sql patches and the table insertion appears to go well.

    PHP Code:
    Query Results:
    CREATE TABLE zen_products_with_attributes_stock stock_id INT NOT NULL AUTO_INCREMENT products_id INT NOT NULL stock_attributes VARCHAR255 NOT NULL quantity FLOAT NOT NULL sort INT NOT NULL PRIMARY KEY stock_id ) );
    INSERT INTO zen_configuration (configuration_titleconfiguration_keyconfiguration_valueconfiguration_descriptionconfiguration_group_idsort_orderlast_modifieddate_addeduse_functionset_functionVALUES ('Show available stock level in cart when less than order''STOCK_SHOW_LOW_IN_CART''false''When customer places more items in cart than are available, show the available amount on the shopping cart page:''9''6'NULLnow(), NULL"zen_cfg_select_option(array('true', 'false')," ), ('Display Images in Admin''STOCK_SHOW_IMAGE''false''Display image thumbnails on Products With Attributes Stock page? (warning, setting this to true can severly slow the loading of this page):''9''6'NULLnow(), NULL"zen_cfg_select_option(array('true', 'false')," ); 
    phpmyadmin shows the table: zen_products_with_attributes_stock is there

    The problem I run into is this:


    When stock by attributes is applied to a product it works fine but if I try to update product stock amounts in bulk on the stock by attributes main page and click the save button I get this error message

    PHP Code:
    1146 Table 'myusername_databasename.products_with_attributes_stock' doesn't exist
    in:
    [UPDATE products_with_attributes_stock SET quantity = '
    125' WHERE products_with_attributes_stock.stock_id =1 LIMIT 1]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields. 
    any ideas why this is happening? Could it be the code in one or more of the files needs to have the prefix added?

  3. #1033
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    ok I went through the files and added the prefix zen_ to line 227

    PHP Code:
     $sql "UPDATE zen_products_with_attributes_stock SET quantity = '$value' WHERE zen_products_with_attributes_stock.stock_id =$id LIMIT 1"
    This seems to have fixed the bulk update problem. Unless I run into an unforseen consequence.

    While this (seems) to work I can't imagine this is the correct fix because if I applied this to the package to install elsewhere...well, not everyone has the same prefix.

    Am I on the right track.

    Can anyone comment on this?

    Does this error happen to anyone else?

  4. #1034
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    well it would be a good idea to state which file I edited wouldn't it

    zc_admin/includes/classes/products_with_attributes_stock.php

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

    Default Re: Stocks by attributes

    Better would be
    PHP Code:
    $sql "UPDATE " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " SET quantity = '$value' WHERE stock_id =$id LIMIT 1"
    for the reason you said.
    Kuroi Web Design and Development | Twitter

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

  6. #1036
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by kuroi View Post
    Better would be
    PHP Code:
    $sql "UPDATE " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " SET quantity = '$value' WHERE stock_id =$id LIMIT 1"
    for the reason you said.
    Thank you very much!!

    That did the trick.

  7. #1037
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    one last thing:

    The link for, Sync All Quantities. When this link is clicked, the stock for all items is changed to 0. Is this supposed to happen?

    That could be a problem for anyone who does know the results.

  8. #1038
    Join Date
    Mar 2011
    Location
    Marinha Grande, Portugal
    Posts
    2
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hello Guys,
    My name is Joćo Raposo, I'm new to Zen Cart, I am using the Zen Cart to install a new page for my company but I have one problem.
    I had read so much threads and I only see user Siezer talking about what I want but I can't speak it so...
    I would like too now if someone can change this add-on Stock by attributes to have a check box on each general attributes (Ex. Color, Size,etc...) to allow or not allow to insert stock on stock attributes to that general attribute.
    This is because I had some attributes that I don't want to include with stock option. (Ex. Number of printings, Number of printing colors,etc...).
    This is possible? Can some one help me?

    Best Regards for all...
    Joćo Raposo
    Marinha Grande, Portugal

  9. #1039
    Join Date
    Mar 2011
    Posts
    7
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    can anyone help me with this problem?
    http://www.zen-cart.com/forum/showthread.php?t=176953 :-s thanks.

  10. #1040
    Join Date
    Jan 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hello everybody,

    I'm trying the SBA module (thanks for the job done) with ZC version 1.3.9 f

    I have this issue if a customer add several products in the shopping cart:

    If the FIRST product added is in stock everything works ok.
    If the FIRST product added is out of stock all the other products added later are marked '***' out of stock even if they are in stock.

    Could it be a bug? Am i the only one with this problem?

    Thanks in advance

 

 

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