Page 40 of 359 FirstFirst ... 3038394041425090140 ... LastLast
Results 391 to 400 of 3589
  1. #391
    Join Date
    Mar 2008
    Location
    Stuart FL USA
    Posts
    28
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Re: 2PT In Configuration>Stock Mine says "Show available stock level in cart when less than order". is that the same thing?

  2. #392
    Join Date
    Apr 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    I would like to take a moment to reflect on the concept of restocking a deleted order:

    I thought this would be a wonderful idea (even though 1.4 is going to implement inventory based on attributes, there are folks out there who need / want it now).

    It all lies in the /admin/includes/functions/general.php (and please correct me if I missed or overlooked something)

    Very simply, in the function zen_remove_order replace, the declaration line with this
    PHP Code:
    function zen_remove_order($order_id$restock false$stock_by_attribute false) { 
    In the function, in the check for $restock, add this check:

    PHP Code:
    if($stock_by_attribute == 'on')
         {
             
    $order_stock_by_att $db->Execute("select op.products_id, op.products_quantity,
                                       opa.products_options_id, opa.products_options_values_id
                                     from " 
    TABLE_ORDERS_PRODUCTS " op, " TABLE_ORDERS_PRODUCTS_ATTRIBUTES " opa
                                     where op.orders_id = '" 
    . (int)$order_id "'
                                     AND opa.orders_id = op.orders_id "
    );
            
             
             
    $options_id $order_stock_by_att->fields['products_options_id'];
             
    $options_values_id $order_stock_by_att->fields['products_options_values_id'];
             
    $prod_id $order_stock_by_att->fields['products_id'];
             while(!
    $order_stock_by_att->EOF){
        

              
              
    $attribute_stock_sql "select pas.stock_id from " .
                                                  
    TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " pas, "TABLE_PRODUCTS_ATTRIBUTES ." pa
                                                where pa.options_id = '
    $options_id'
                                                and pa.options_values_id = '
    $options_values_id'
                                                and pa.products_attributes_id = pas.stock_attributes 
                                                and pas.products_id = '
    $prod_id' ";
              
    $attribute_stock $db->Execute($attribute_stock_sql);

              
    $db->Execute("update ".TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " set 
                              quantity = quantity + " 
    .$order_stock_by_att->fields['products_quantity'] . "
                               where stock_id = '"
    .$attribute_stock->fields['stock_id']."'");
              
    $order_stock_by_att->MoveNext();
            }

         } 

    The final function should look something like this:


    PHP Code:
    function zen_remove_order($order_id$restock false$stock_by_attribute false) {
        global 
    $db;
        if (
    $restock == 'on') {
          
    $order $db->Execute("select products_id, products_quantity
                                 from " 
    TABLE_ORDERS_PRODUCTS "
                                 where orders_id = '" 
    . (int)$order_id "'");

          while (!
    $order->EOF) {
            
    $db->Execute("update " TABLE_PRODUCTS "
                          set products_quantity = products_quantity + " 
    $order->fields['products_quantity'] . ", products_ordered = products_ordered - " $order->fields['products_quantity'] . " where products_id = '" . (int)$order->fields['products_id'] . "'");
            
    $order->MoveNext();
          }
          

         if(
    $stock_by_attribute == 'on')
         {
             
    $order_stock_by_att $db->Execute("select op.products_id, op.products_quantity,
                                       opa.products_options_id, opa.products_options_values_id
                                     from " 
    TABLE_ORDERS_PRODUCTS " op, " TABLE_ORDERS_PRODUCTS_ATTRIBUTES " opa
                                     where op.orders_id = '" 
    . (int)$order_id "'
                                     AND opa.orders_id = op.orders_id "
    );
            
             
    $temp_string "";
             
    $options_id $order_stock_by_att->fields['products_options_id'];
             
    $options_values_id $order_stock_by_att->fields['products_options_values_id'];
             
    $prod_id $order_stock_by_att->fields['products_id'];
             while(!
    $order_stock_by_att->EOF){
        

              
              
    $attribute_stock_sql "select pas.stock_id from " .
                                                  
    TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " pas, "TABLE_PRODUCTS_ATTRIBUTES ." pa
                                                where pa.options_id = '
    $options_id'
                                                and pa.options_values_id = '
    $options_values_id'
                                                and pa.products_attributes_id = pas.stock_attributes 
                                                and pas.products_id = '
    $prod_id' ";
              
    $attribute_stock $db->Execute($attribute_stock_sql);

              
    $db->Execute("update ".TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " set 
                              quantity = quantity + " 
    .$order_stock_by_att->fields['products_quantity'] . "
                               where stock_id = '"
    .$attribute_stock->fields['stock_id']."'");
              
    $order_stock_by_att->MoveNext();
            }

         }


        }

        
    $db->Execute("delete from " TABLE_ORDERS " where orders_id = '" . (int)$order_id "'");
        
    $db->Execute("delete from " TABLE_ORDERS_PRODUCTS "
                      where orders_id = '" 
    . (int)$order_id "'");

        
    $db->Execute("delete from " TABLE_ORDERS_PRODUCTS_ATTRIBUTES "
                      where orders_id = '" 
    . (int)$order_id "'");

        
    $db->Execute("delete from " TABLE_ORDERS_STATUS_HISTORY "
                      where orders_id = '" 
    . (int)$order_id "'");

        
    $db->Execute("delete from " TABLE_ORDERS_TOTAL "
                      where orders_id = '" 
    . (int)$order_id "'");

      } 

    Ok, now that the function itself has been modified to adapt to what we need, we need to change the necessary calls to allow the new features to be activated.

    For me (most of my clients use Super Orders in their zen carts), I modify the /admin/super_orders.php file. Default orders page is the /admin/orders.php file.

    Look for the call of
    PHP Code:
    zen_remove_order($oID,$_POST['restock']); 
    and change that to
    PHP Code:
    zen_remove_order($oID$_POST['restock'],$_POST['restock']); 

    I hope this helps, I tested it a few times, but not thoroughly.

  3. #393
    Join Date
    Mar 2008
    Posts
    2
    Plugin Contributions
    0

    help question Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    I've installed the add-on with no problem, but I kept getting this error:

    146 Table '[...]TABLE_PRODUCTS_STOCK' doesn't exist
    in:
    [select quantity from TABLE_PRODUCTS_STOCK where products_id = '18' AND quantity > 0]

    I tried following the instructions given to someone else who had the same problem, but nothing I do on the stocks page seems to change the outcome--I still keep getting the error.

    I'm running Zen Cart 1.3.8...

    This add-on is exactly what I need, but I can't figure out what's causing this problem. I tried uninstalling everything related to the mod (I'm not sure if I did a clean job, overwrote files, dropped the relevant tables in the database), and the problem persists.

    Any advice?

    Thanks!

  4. #394
    Join Date
    Jan 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    I am having trouble at confirm checkout.
    My customers get a message:

    1146 Table 'shazzas_clothes08.sc_products_ratio' doesn't exist
    in:
    [SELECT ratio FROM sc_products_ratio WHERE products_id=116 LIMIT 1]

    Orders are sent but stock isn't getting adjusted

    Is there anything I can do to fix this as they keep clicking which dup orders


    Any help will be appreciated./

    Using Zen Cart 3.8

  5. #395
    Join Date
    Jan 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Follow up from my previous message
    I think I need to run the SQL file again to fix the tables.
    If I do will it detele all my attributes I have already done?
    Or is there another workaround?
    Thanks in Advanced
    John

  6. #396
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    help question Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    I'm not sure if this is possible or if the contrib. - would be relevant, but thought it would not hurt to post and ask - I have a shoe store - I have basically one attribute - size/width - Is it possible that if the distributor tells me let's say size 8M is out of stock but will be back in stock on 5/1/2008 - is it possible to set an date of availability for just that attribute?

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

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Quote Originally Posted by snakehips View Post
    I've installed the add-on with no problem, but I kept getting this error:

    146 Table '[...]TABLE_PRODUCTS_STOCK' doesn't exist
    in:
    [select quantity from TABLE_PRODUCTS_STOCK where products_id = '18' AND quantity > 0]

    I tried following the instructions given to someone else who had the same problem, but nothing I do on the stocks page seems to change the outcome--I still keep getting the error.

    I'm running Zen Cart 1.3.8...

    This add-on is exactly what I need, but I can't figure out what's causing this problem. I tried uninstalling everything related to the mod (I'm not sure if I did a clean job, overwrote files, dropped the relevant tables in the database), and the problem persists.
    Neither this version of Stock by Attributes nor Zen Cart's core code have a products_stock table or define a constant TABLE_PRODUCTS_STOCKS. It looks as though you must have some code floating around from another mod. Though I'm afraid that I don't know which one it might be.
    Kuroi Web Design and Development | Twitter

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

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

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Quote Originally Posted by ausjohn View Post
    Follow up from my previous message
    I think I need to run the SQL file again to fix the tables.
    If I do will it detele all my attributes I have already done?
    Or is there another workaround?
    @ ausjohn

    I think we may have covered this in another thread, but just in case ...

    products_ratio is not a stock by attributes table, so you must be using another mod, either in place of S by A, or alongside it, and the problem lies with the installation of that mod.

    To answer your question above. Were you to re-run the S by A SQL it would not delete your attributes, but would most likely delete any stock records that you have created from those attributes.
    Kuroi Web Design and Development | Twitter

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

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

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Quote Originally Posted by rwoody View Post
    I'm not sure if this is possible or if the contrib. - would be relevant, but thought it would not hurt to post and ask - I have a shoe store - I have basically one attribute - size/width - Is it possible that if the distributor tells me let's say size 8M is out of stock but will be back in stock on 5/1/2008 - is it possible to set an date of availability for just that attribute?
    It's a good idea, but the mod doesn't support it.
    Kuroi Web Design and Development | Twitter

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

  10. #400

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Quote Originally Posted by snakehips View Post
    I've installed the add-on with no problem, but I kept getting this error:

    146 Table '[...]TABLE_PRODUCTS_STOCK' doesn't exist
    in:
    [select quantity from TABLE_PRODUCTS_STOCK where products_id = '18' AND quantity > 0]!
    I am having the same error. If anyone can help, I would appreciate it! I've unistalled and resintalled twice. No luck. Please help, I really need this mod.

 

 

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