Page 65 of 113 FirstFirst ... 1555636465666775 ... LastLast
Results 641 to 650 of 1125
  1. #641
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by kellan4459 View Post
    several of us have modified it to different versions of what you are looking for. This post should help you:

    http://www.zen-cart.com/forum/showpo...&postcount=559


    You also may want to look at page 56 and 57 as I believe this is where it is discussed.

    Hope that helps.
    Hi Kellan, thanks for that link, it was very, very useful... when I go to ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES STOCK and change an attribute quantity to '0' then it does indeed disappear from the drop down menu now. So customers should no longer have the option of selecting out of stock sizes..... if only for this problem here :-

    Let me try and explain what the problem is exactly.... When someone buys something from my shop, then I go to ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES STOCK it seems to be mis-counting........

    Here, a picture paints a thousand words:




    As you can see, the total QTY after someone buys an item does change, however, the attribute QTY does not.... What baffles me is why PRODUCTS WITH ATTRIBUTES STOCK is not adding the Quantity in Stock Column to arrive at the total QTY?????

    Anyone know why it's doing this??

    For example, in the pics above someone bought the size 12 in both items... it deducted it from the total quantity but did not deduct it from the size 12 attribute quantity... I'm bamboozled by this... If it would only deduct from the attribute qty then the site would be functioning 100% perfectly..

  2. #642
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Ahaaaaaaa, figured this one out guys!!

    For anyone else having a problem with this issue, just look at re-installing the files that shipped with the stock_by_attributes mod.

    I've just cured my problems by overwriting /includes/classes/order.php with the order.php from "stock_by_attributes_4-7MULTIADD mod"

    Somehow some other mod had corrupted the data that updates the "Quantity in Stock" in ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES".

    It is now updating the Quantity in Stock Column with each sale. All working perfectly now.

    Additionally, if you want the attribute in the drop down menu to automatically disable when the attribute quantity = zero, then you have to 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

  3. #643
    Join Date
    Nov 2008
    Posts
    53
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by kellan4459 View Post
    I have changed my includes/modules/attributes.php file. Here is the code changes I have made. If you search the if line you should be able to locate it in your code.


    This is around line 119 in my code
    Code:
    if($products_options->fields['quantity'])
    					{
    						$products_text_to_use = $products_options->fields['products_options_values_name'] . ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' ' . TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ';
    					}

    This is around line 208 in my code
    Code:
    if ($products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT and $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE) {
    //       $products_options_details = $products_options->fields['products_options_values_name'];
    // gbm - replaced original line above to display attribute stock amount beside attribute
    			
           		$products_options_details = $products_options->fields['products_options_values_name'] . ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ';
          		
    	  	}
    This is around line 218 in my code
    Code:
    if ($products_options_names->fields['products_options_images_style'] >= 3) {
           		$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
    //       $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
    // gbm - replaced original line above to display attribute stock amount beside attribute
           		$products_options_details_noname = ' '. TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
          	} else {
           		$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
    //       $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
    // gbm - replaced original line above to display attribute stock amount beside attribute
           		$products_options_details_noname = ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
          	}
         }


    I also have changed the language file for product_info.php to define the following

    Code:
    define('TEXT_ATTRIBUTES_PIECES','Available');
    define('TEXT_ATTRIBUTES_PIECES_OPEN','(');
    define('TEXT_ATTRIBUTES_PIECES_CLOSE',')');
    This changes 'pieces' to 'Available'.
    This also will allow me to change the grouping symbols in one place for all of what were hard coded '[' before. In case the customer doesn't like the brackets.

    Hope this helps.
    Thanks for upgrade , it now works language independend.

    I currently use a a addition that show the soldout attrib with the text sold out or availble.
    I think it would be great if someone could integrade this upgrade in the admin panel. So you can choose to not show the attrib or show it with a specified text !! that would realy complete this modification. That's for your help !!

  4. #644
    Join Date
    Dec 2008
    Posts
    79
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Glad you both got it working.

  5. #645
    Join Date
    Oct 2006
    Location
    Surprise Arizona
    Posts
    76
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by cropinstop View Post
    If "Fast and Easy Checkout"is installed when running Stock by Attributes, the shopping cart will proceed to successful checkout when the quantity of an attribute ordered exceeds the quantity provisioned with Stock by Attributes.
    Found the solution.

    An "attribute stock exceeded" check is missing from "includes/modules/pages/checkout/header_php.php". This file is unique to the "Fast and Easy Checkout" contribution.

    Change

    // Stock Check
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
    if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
    to

    // Stock Check
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {

    // Added to allow individual stock of different attributes
    unset($attributes);
    if(is_array($products[$i]['attributes'])) {
    $attributes = $products[$i]['attributes'];
    } else {
    $attributes = '';
    }
    // End change

    if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

  6. #646
    Join Date
    Jan 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hey Kellan,

    I've read back over everything, installed the coding as per pg 56 and 57... and still having a few issues, hoping you might be able to help :)

    I got it to the point where it states (1 in stock) etc beside the item, however, when it does that it displays the attribute twice, once with nothing and once with the (1 in stock) element... I can't figure out why this is.

    Also, I don't know if I've missed this (reading so many pages makes it easy to miss things) But is there any way that I can get it so that when an option is selected in the first drop down menu, it alters what is available in the second drop down menu... ie; select a size from the first menu, and only 1 colour is avail from the second menu... I dunno whether its all wishful thinking to get this much stuff hehe.

    TIA,
    Nyssa
    (test site; http://www.sabrerose.com/testing )

  7. #647
    Join Date
    Mar 2009
    Posts
    21
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I've been banging my head over this issue for a couple of days and I really haven't found a definitive answer.

    I have stock_by_attributes installed and it seems to be running just fine. However when ever I edit my quantities, for all attributes after I hit submit I get the following error.

    [quote[
    att: 1386|1390|1389|1388|1387

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/o/n/sonjamichelle/html/catalog/admin/products_with_attributes_stock.php:193) in /home/content/s/o/n/sonjamichelle/html/catalog/admin/includes/functions/general.php on line 21
    [/quote]

    I've looked through several files to find whitespace after the ending ?> and only found one instance. Though that didn't fix the problem.

    It only does this when I choose to apply the quantity to "all". If I choose a single attribute, after hitting submit, I'm brought back to the list of products.

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

    Default Re: Stocks by attributes

    Quote Originally Posted by sonjamichelle View Post
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/o/n/sonjamichelle/html/catalog/admin/products_with_attributes_stock.php:193) in /home/content/s/o/n/sonjamichelle/html/catalog/admin/includes/functions/general.php on line 21
    You're using the multiadd variant of this mod. Unfortunately the author left a debug statement in at line 193 of admin/products_with_attributes_stock.php. It's this that is triggering the errors. You can just delete it.
    Kuroi Web Design and Development | Twitter

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

  9. #649
    Join Date
    Mar 2009
    Posts
    5
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi guys,

    I was wondering if somebody could help me with a pretty simple request.

    The site I have zencart installed on will be for vendors, and so I would like to print a table on the product info pages that lists the stock of all the possible combos of product variants. I know that sql values have to be called from the 'products with attributes stock' table and displayed in a loop, I'm just not sure of the php syntax needed to do this.

    I've done a pretty good amount of errant attempts, mainly just by copying the table display code from the admin portion and trying to display that on the product page after the bulleted list. It doesn't work.

    I will only have two attributes, size and color. Thanks for any help on this one.

  10. #650
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi the44chris.... you should post a link to your site to help anyone that would try to assist....

 

 
Page 65 of 113 FirstFirst ... 1555636465666775 ... 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