Jump to content

Problem With Out Of Stock Settings


Recommended Posts

Hi master

i've a little problem here, iam using presta 1.6.

For example 1 have 3 combination of the product S, M, L

 

the product with size S is out of stock, M and L is still available

but in my product slider it says my product out of stock. 

 

1.png

Of course it will provide a different understanding by the user, they must be think my product is out of stock

until they came to the product pages and see if the out of stock is only for S size.

 

i'll try to enable "allow ordering out of stock product" in preferences -> product.

Yes the add to cart button is available, but its available for any condition. If all my combination is out of stock, 

add to cart button is still available and user can order (i dont want this) or if only my S Size is out of stock, 

add to cart button in default grab the S size in the checkout pages when user click add to cart button whereas 

there are still other products in stock (M & L).

 

I want add to cart button is still available when other combination is in stock, if user click add to cart button if S

size is out of stock then sistem in default grab Available combinations in the checkout pages (M or L size) and add to 

cart button in product slider change to out of stock like that picture if it is all combination is not available again.

 

thanks, really w8 your answer

Link to comment
Share on other sites

I guess it is the problem with the theme.

As theme takes default attribute of the product. 

If you would mark M as default it should not show 'out of stock', but its not a good solution, because someday M can be out of stock too.

 

I guess the best solution would be to edit theme and remove showing of the status at all.

Link to comment
Share on other sites

You should find product_list.tpl

in:

[your_shop]/themes/[your_theme]

 

Open the file and look for:

class="exclusive ajax_add_to_cart_button "

There should be some condition what to do if product has quantity and what to do if does not have.

I can not say more exact as I do not see the code.

 

Delete conditions that show out of stock. 

I am not sure if you can do it yourself or you will need a help of developer.

Link to comment
Share on other sites

 <div class="button-container fly_3 clearfix">
                    {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
                        {if ($product.allow_oosp || $product.quantity > 0)}
                            {if isset($static_token)}
                                <a class="exclusive ajax_add_to_cart_button " href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">
                                    <span class="wrap_bg">
                                        <i class="icon-shopping-cart icon-0x icon-mar-lr2"></i>
                                        <span class="wrap_text">{l s='Add to cart'}</span>
                                    </span>
                                </a>
                            {else}
                                <a class="exclusive ajax_add_to_cart_button " href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$product.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">
                                    <span class="wrap_bg">
                                        <i class="icon-shopping-cart icon-0x icon-mar-lr2"></i>
                                        <span class="wrap_text">{l s='Add to cart'}</span>
                                    </span>
                                </a>
                            {/if}						
                        {else}
                            <a href="#" class="exclusive ajax_add_to_cart_button ">
                                <span class="wrap_bg">
                                    <i class="icon-shopping-cart icon-0x icon-mar-lr2"></i>
                                    <span class="wrap_text">{l s='Out of stock'}</span>
                                </span>
                            </a>
                        {/if}
                    {/if}
                    <div class="tab_button">
                     <a class="addToWishlist wishlistProd_{$product.id_product|intval}" href="#" rel="{$product.id_product|intval}" onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', false, 1); return false;">
                    <i class="icon-heart"></i>
                    {l s='' mod='blockwishlist'}
                    </a>
                    {if isset($comparator_max_item) && $comparator_max_item}
                        <a class="add_to_compare" href="{$product.link|escape:'html':'UTF-8'}" data-id-product="{$product.id_product}">{l s=''}
                            <span class="wrap_bg">
                                <i class="icon-plus icon-0x icon-mar-lr2"></i>
                                <span class="wrap_text">{l s=''}</span>
                            </span>
                        </a>
                    {/if}
                    {if isset($quick_view) && $quick_view}
                        <a class="quick-view" href="{$product.link|escape:'html':'UTF-8'}" rel="{$product.link|escape:'html':'UTF-8'}">
                            <span class="wrap_bg">
                                <i class="icon-eye-open icon-0x icon-mar-lr2"></i>
                                <span class="wrap_text">{l s='quick view'}</span>
                            </span>
                        </a>
                    {/if}
                    </div>
                </div>
            </div>

That was the code, any suggested what part i've been to change?

big thanks for all of you guys :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...