Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Dec 2005
    Location
    Portishead, UK
    Posts
    36
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    Has anyone come up with a simple solution to this problem?

    I don't really want to install this contribution as it's overkill for what I'm after. If there is an easy way of using the "Display Only" option to not display the Attribute on an item, I feel that this would be the simplest. Has anyone done this as I'm not sure where to start.

    Any help would be greatly appreciated.

    Cheers.
    ...there is nothing worse than aggresive stupidity...

  2. #12
    Join Date
    Jan 2007
    Posts
    15
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    I've tried the stock by attribute mod, but it doesn't work for what I need... it doesn't disable the attribute at all when that stock level hits 0. seems to only like positive numbers.. the mod keeps levels at 1 in the store even though it says 0 in the admin section...

    has this been figured out yet? can we add a disable attribute function under attributes controller? so that it disables(hides/unhides) that one attribute for that specific product? please, any help would be most appreciative...

  3. #13
    Join Date
    Jan 2007
    Posts
    15
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    my mistake, fortunately it does say it's out once in the shopping cart... can we show this before they click add to cart?

  4. #14
    Join Date
    Mar 2008
    Posts
    17
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    This mod would be perfect if the attribute = 0 it is not displayed. it makes me look stupid if I do not go in there and disable it before someone else gets in there and tries to buy it

  5. #15
    Join Date
    Apr 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    Quote Originally Posted by hpsales View Post
    What I do for a product that has multipule attributs that sell out and later get restocked is to minipulate in the products_attribute table the field 'attributs_display_only'. The attribute still is visable but is not selectible if set to '1'. When it gets restocked, simply reset the control bit to a '0'.

    This can be done with a simple SQL script UPDATE command or of course you can set/reset the raw database. Since I have over 9000 items, half of which have attributs of which hundreds change daily, my inventory program writes the script for updating everything so I don't have a sample script. But that's a way to do it without deleting the attribute.
    I had this issue today and I found the above advice posted by hpsales to be the easiest thing to do.

    Here is the SQL update statement I used:

    Update `products_attributes` SET `attributes_display_only` = 1 WHERE `products_attributes_id` = XXXX ;
    You just need to figure out the products_attributes_id for the attributes you want to temporarily deactivate. (There's probably an easier way to do it, but I just went into the attributes controller and put my mouse pointer over the "edit" button for the attribute I wanted to deactivate and it showed the attribute in the Firefox status bar).

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

    Default Re: Hiding Attributes when out of stock in that size

    There doesn't appear to be a solution to this then. The only thing you've come up with above is to manually disable or manually deactivate an attribute when it's out of stock.

    There has to be a way of modifying the code in the php files so that attributes with stock level=0 are automatically hidden or deleted?

    It's a mammoth task to manually disable/delete attributes every time a particular size for a particular item goes out of stock.

    Has anyone figured out which part of the code could be manipulated to achieve automation?

  7. #17
    Join Date
    Jan 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    I too have been googling/searching for solutions.

    I would be happy if the attribute remained viewable, but had an (out of stock) thing beside it or something...

    and the items that are still in stock could have numbers beside them stating how many there are aswell....

    I see it on so many shops, woulda thought it would be quite easy... only just started dealing with attributes though...

    TIA.
    Nyssa

  8. #18
    Join Date
    Jun 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    Any comment from the developers? Will this appear in the next version of zen cart?
    John Crumpton, Technical Director of Double Sided
    Zen cart shop: Buy happie loves it

  9. #19
    Join Date
    Jun 2009
    Location
    Australia
    Posts
    20
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    Hi all,

    I've been searching for a solution for this as well, and have come across this thread. I have installed Stock by Attributes.

    I haven't been able to come up with a solution, but my observations below may hopefully trigger something with another zen carter.

    In the CUSTOM\modules\attributes.php there is this piece of code;

    [FONT="Courier New"]<div class="wrapperAttribsOptions">
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    <div class="back"><?php echo "\n" . $options_menu[$i]; ?></div>
    <!-- <br class="clearBoth" />-->
    </div>[/FONT]

    This is where the HTML drop down box gets written, and it is the $options_name variable which consist of the attributes items that are found in the drop down box.

    Given my VERY limited programming knowledge - I would think that when the php code loops through the $options_name variable to parse the HTML, a simple "If stock = 0, then skip attribute" is required.

    From what I see the CUSTOM\modules\tpl_modules_attributes.php is the file that holds all of the processing of the attributes.

    That's me thinking out aloud, will attempt to dissect the code to try and figure this one out.

    Any ideas? or pointers to add?

    erko

  10. #20
    Join Date
    Jun 2009
    Location
    Australia
    Posts
    20
    Plugin Contributions
    0

    Default Re: Hiding Attributes when out of stock in that size

    Just an update...

    I've pinpointed exactly where the loop of the drop down box is written.. was looking in the wrong place..

    It's in ..

    \includes\functions\html_output.php

    Code being (around line 504);

    [FONT="Courier New"] for ($i=0, $n=sizeof($values); $i<$n; $i++) {

    $field .= ' <option value="' . zen_output_string($values[$i]['id']) . zen_output_string($values[$i]['qty']) . '"';

    if ($default == $values[$i]['id']) {
    $field .= ' selected="selected"';
    }

    $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";[/FONT]

    Now, I just need to add the if statement around it. The syntax will be;

    [FONT="Courier New"] for ($i=0, $n=sizeof($values); $i<$n; $i++) {

    if zen_output_string($values[$i]['QTY'] >= 1 {
    $field .= ' <option value="' . zen_output_string($values[$i]['id']) . zen_output_string($values[$i]['qty']) . '"';
    }

    if ($default == $values[$i]['id']) {
    $field .= ' selected="selected"';
    }

    $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";[/FONT]

    but I need to know how to call the stock qty variable for the particular attribute. The code [FONT="Courier New"]zen_output_string($values[$i]['QTY'][/FONT] is a placeholder and is NOT correct.

    anyone can help here??

    erko

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. products with attributes stock won`t substract stock by size
    By EMPIRE SA in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 4 Aug 2011, 12:11 PM
  2. Replies: 5
    Last Post: 3 Aug 2011, 08:15 AM
  3. Stock by Attribute setup and product has stock when added to card says out of stock
    By kwrosenzweig in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Jun 2011, 06:18 PM
  4. Hiding products that R out of stock
    By amrami in forum Customization from the Admin
    Replies: 5
    Last Post: 3 Feb 2011, 05:31 PM
  5. Hiding Out of Stock Items in Admin Catalog
    By getengelby in forum Basic Configuration
    Replies: 4
    Last Post: 14 Mar 2010, 05:25 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