title: What is the difference between isSaleable() and isAvailable()?
body: <p>I'm working on the display of the stock availability on the (individual) product page of my Magento theme, and there's something I don't completely understand about this.</p>
  <p>I see two methods being used in the templates to check whether a product is available for sale:</p>
  <pre class="lang-php prettyprint-override"><code>    Mage_Catalog_Model_Product::isAvailable()
      Mage_Catalog_Model_Product::isSaleable()
  </code></pre>
  <p><strong>My own findings:</strong><br />
  I see that <code>isSalable()</code> (which in turn is called by <code>isSaleable()</code>) calls <code>isAvailable()</code> but also dispatches two events (<code>catalog_product_is_salable_before</code> and <code>catalog_product_is_salable_after</code>).</p>
  <p>On the frontend, I've noticed that in Magento's base template <code>isAvailable()</code> is used to decide whether to display the product as &quot;in stock&quot; or &quot;out of stock&quot;; <code>isSaleable()</code> is used to decide something like whether to show an &quot;Add to Cart&quot; button.</p>
  <p>On the backend, I've noticed that when the stock quantity becomes zero and backorders are <em>not</em> allowed, the stock availability of a product goes to &quot;out of stock&quot;.
  When the stock quantity becomes zero and backorders <em>are</em> allowed, the stock availability of the product remains unchanged.</p>
  <p><strong>Question:</strong><br />
  The properties &quot;stock availability&quot; and &quot;stock quantity&quot; are obviously linked with each other and the mentioned PHP methods. I would like to know:</p>
  <ul>
  <li><p>what the <em>semantic</em> difference between the PHP methods <code>isAvailable()</code> and
  <code>isSaleable()</code> is and why I would use one over the other;</p>
  </li>
  <li><p>what it is I appear not yet to know about their relation with these properties and Magento's behavior.</p>
  </li>
  </ul>
  <p>Thank you.</p>
  <p><strong>EDIT:</strong><br />
  I've tried every relevant combination of stock quantity (-1,0,1), stock availability (in/out of), and backorders (on/off) for a product and this is the result:</p>
  <pre>
  St.Qu  BckOrd  St.Av  isSalable()  isSaleable()  isAvailable()
     -1       0      0            0             0              0
     -1       0      1          N/A           N/A            N/A
     -1       1      0            0             0              0
     -1       1      1            1             1              1
      0       0      0            0             0              0
      0       0      1          N/A           N/A            N/A
      0       1      0            0             0              0
      0       1      1            1             1              1
      1       0      0            0             0              0
      1       0      1            1             1              1
      1       1      0            0             0              0
      1       1      1            1             1              1
  </pre>
  <p>Just for the sake of completeness:</p>
  <pre class="lang-php prettyprint-override"><code>St.Av 0  = out of stock
  St.Av 1  = in stock
  BckOrd 0 = no backorders allowed
  BckOrd 1 = backorders are allowed
  
  </code></pre>
  <p>It is the stock availability switch in Magento that controls the return value of all of the PHP methods, but when backorders are off and stock quantity drops below 1, the stock availability will automatically be reset to 'out of stock' (hence the <code>N/A</code> rows).</p>