Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Location
    Rochester, NY
    Posts
    8
    Plugin Contributions
    0

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    It looks like this was the major edit in the Orders.PHP (which was my major concern)

    // kuroi: SbA
    $option_name_array = explode(":", $order->products[$i]['attributes'][$j]['option']);
    $option_Name = $option_name_array[0];
    // end: sbA
    echo '<br /><nobr><small>&nbsp;<i> - ' . $option_Name . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);


    Thank you so much. This version of the Stock-by-attribute is much cleaner and easier for me sift through. I'm going to bet that the rest of the files will also be so I will say thanks now. If I have any other questions I'll come back. Thanks again!

  2. #2
    Join Date
    Jul 2008
    Location
    Rochester, NY
    Posts
    8
    Plugin Contributions
    0

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    OK, All worked as expected except...

    I have configured products with a two-option selection. When a customer adds a product they must select

    -flavor option (1 - 4)
    -strength option (a - d)

    The problem lies where production option combination for, say, 3b does not exist or has 0 stock. The customer is allowed to select it anyway... which is confusing because the message will appear stating that there is not enough qty on hand... Now I could change the message but that still leaves the customer guessing as to what is in stock... or I could display my stock, but my stock is very low and I would prefer not to advertise this.

    I would rather not display a combination of options that have 0 stock or do not exist so the customer cannot select it in the first place. Is this possible to do?

  3. #3
    Join Date
    Sep 2008
    Location
    North Highlands, California 95660
    Posts
    286
    Plugin Contributions
    1

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    See if this helps you out:

    open /includes/modules/attributes.php and replace this:

    PHP Code:
    $sql "select    pov.products_options_values_id,
                            pov.products_options_values_name,
                            pa.*
                  from      " 
    TABLE_PRODUCTS_ATTRIBUTES " pa, " TABLE_PRODUCTS_OPTIONS_VALUES " pov
                  where     pa.products_id = '" 
    . (int)$_GET['products_id'] . "'
                  and       pa.options_id = '" 
    . (int)$products_options_names->fields['products_options_id'] . "'
                  and       pa.options_values_id = pov.products_options_values_id
                  and       pov.language_id = '" 
    . (int)$_SESSION['languages_id'] . "' " .
                    
    $order_by
    with this:

    PHP Code:
    $sql=    "SELECT  pov.products_options_values_id,
                                pov.products_options_values_name,
                                pa.*,
                                pwas.*
                    FROM   " 
    TABLE_PRODUCTS_OPTIONS_VALUES " pov, " TABLE_PRODUCTS_ATTRIBUTES " pa LEFT JOIN " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " pwas ON pwas.stock_attributes = pa.products_attributes_id
                    WHERE   pa.products_id = '" 
    . (int)$_GET['products_id'] . "'
                       and    pa.options_id = '" 
    . (int)$products_options_names->fields['products_options_id'] . "'
                    and    (pwas.quantity > 0 or pwas.quantity IS NULL)
                      and    pa.options_values_id = pov.products_options_values_id
                     and       pov.language_id = '" 
    . (int)$_SESSION['languages_id'] . "' " .
                    
    $order_by

  4. #4
    Join Date
    Sep 2008
    Location
    North Highlands, California 95660
    Posts
    286
    Plugin Contributions
    1

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    Or you may want to install the Dynamic Drop Downs for SBA mod, it has an option in it to: Prevent Adding Out of Stock to Cart

  5. #5
    Join Date
    Jul 2008
    Location
    Rochester, NY
    Posts
    8
    Plugin Contributions
    0

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    creinold,

    Thank you. I will try it out and let you know. My novice understanding of PHP and SQL tell me that this looks like it if I run out of stock on an attribute item it will not include it in the selectable items. I don't think I'll be able to put this mod tonight, but I will let you know.

    Thanks again!

  6. #6
    Join Date
    Jul 2008
    Location
    Rochester, NY
    Posts
    8
    Plugin Contributions
    0

    Default Re: Stock by Attribute for ZC 1.3.9c/d changes to core files

    Has it been this long since I last posted? I'm so sorry. As I expected, your code worked perfectly. Thank you so much!

 

 

Similar Threads

  1. Need to change core files for this?
    By sunrise11 in forum Templates, Stylesheets, Page Layout
    Replies: 20
    Last Post: 9 May 2011, 04:33 AM
  2. So I Edited The Core Files
    By Battlefront Games in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 25 Aug 2010, 04:37 PM

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