title: Check If Product Exists
body: <p>I have some php code which I use SKU for it:</p>
  
  <pre><code>$sku = $id
  $_product=Mage::getModel('catalog/product')-&gt;loadByAttribute('sku',$sku); //Get Product by ID (ASIN)
  $qtyStock = Mage::getModel('cataloginventory/stock_item')-&gt;loadByProduct($_product)-&gt;getQty(); //if in stock
  $_prodcats = $_product-&gt;getCategoryIds(); 
  </code></pre>
  
  <p>What I would like to add to this code if $sku is wrong (Not found in database with $_product line) to be able to change it manually for example if the $sku is not existent change it to $sku = "909010";</p>
  
  <p>Thank you for the help</p>