![]() |
Eliminate out of stock options
I've developed a small mod to eliminate out of stock options from displaying on the product page. Note this eliminates options, not variants. For example, if you have a product with 3 colors (red, green, blue) and 3 sizes (S, M, L) and your stock looks like this:
Code:
Red Green Blue There are two files to change. In modules/Product_Options/customer_options.php find: Code:
if(!empty($product_options)) Code:
if (is_array($product_options)) { Code:
<OPTION value="{$o.optionid}"{if $o.selected eq 'Y'} selected{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} ({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1}{else}{$o.price_modifier}%{/if}){/if}</OPTION> Code:
{if $o.any_stock} This was developed and tested on 4.0.14 but should drop in easily in other versions. Hope this helps someone out. |
Re: Eliminate out of stock options
Hey Ralph...quick question...you say this eliminates options, not variants. However, since options don't have a stock value associated with them, not sure that makes any sense? Basically I have a client who wants to eliminate out of stock variants from displaying...is that what this does?
|
Re: Eliminate out of stock options
It eliminates option values where all variants that include that value have no stock. If you have a single option class for a product then the net effect is to eliminate out of stock variants. If you have multiple option classes for a product there will still be option value combinations that can be out of stock.
To eliminate all out of stock variants it requires some somewhat complex UI changes that I haven't found the time to tackle yet. The two most common are:
|
Re: Eliminate out of stock options
Got it, thanks! I think someone could make a decent chunk of change if they wrote a 'dynamic option' mod where one option controls what is displayed in the next option.
|
Re: Eliminate out of stock options
Quote:
Hello, Do you happen to know how to do the above like nordstrom.com? I am looking for mod just like this ASAP and am willing to pay a reasonable price for it. Thanks in advance! |
Re: Eliminate out of stock options
Has anyone done this? I need this like yesterday? :)
Quote:
|
Re: Eliminate out of stock options
Does anyone know if this will work with 4.1.8?
Quote:
Well, since I have dug this thread out of the back room, apparently no one wanted to make a good chunk of change! :) I sure wish I knew enough to be able to make this happen. But for now, if the original post will work with 4.1.8, I will use it. Any help is better than none. |
Re: Eliminate out of stock options
I have used it on 4.1.8 successfully, yes.
|
Re: Eliminate out of stock options
Were there any modifications you had to make to the original post? I can not seem to get it to work on the test server.
|
Re: Eliminate out of stock options
I'll need to dig back into the code. I'm adding it to a site this week, I'll post back here with the results.
|
Re: Eliminate out of stock options
Thank you Balinor. I greatly appreciate it.
|
Re: Eliminate out of stock options
Anyone drop this into 4.1.9.. or finally develop a more robust mod?
Mostly I don't want people to hit ADD TO CART when a product is out of stock, only to get the product added anyway with default options. I know about the Product Variants Chart mod, however I think that is overkill for what I need. I just want the functionality applied to the dropdown. |
Re: Eliminate out of stock options
Thanks Balinor ... I had to double check.
|
Re: Eliminate out of stock options
Works fine with 4.1.9, just used it yesterday in fact. Exactly as posted above.
|
Re: Eliminate out of stock options
don't seem to work with 4.2.2 :( sorry this is a very old thread, was sent to it from another more recent thread, just realised.....
|
All times are GMT -8. The time now is 02:18 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.