Jump to content

change the Add to Cart button when 0 quantity


Recommended Posts

Hi,

 

I want to change the "Add to Cart" button color and the word to like unavailable when the quantity is 0. can someone tell me how to write those if/else?

 

from the default theme product.tpl, here is the code I believe that need to modify?

 

            {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}
                <span class="exclusive">
                    <span></span>
                    {l s='Add to cart'}
                </span>
            {else}
                <p id="add_to_cart" class="buttons_bottom_block">
                    <span></span>
                    <input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />
                </p>
            {/if}

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...