title: Magento programmatically add product website not showing
body: <p>I wonder if anyone can help me with this. I've tried both methods below to programmatically add a product to a website (tick to a website an existing product, not create one) but neither made the product available on front-end. Back-end added fine.</p>
  
  <p>Method 1</p>
  
  <pre><code>$product = Mage::getModel('catalog/product')-&gt;load(6318);
  $product-&gt;setWebsiteIds(array(1));
  $product-&gt;setStatus(1);
  $product-&gt;save();
  </code></pre>
  
  <p>Method 2</p>
  
  <pre><code>$websiteId = array(1);
  
  $productId = array(6318);
  
  $actionModel = Mage::getSingleton('catalog/product_action');
  $actionModel-&gt;updateWebsites($productId, $websiteId, 'add');
  </code></pre>
  
  <p>Tried with reindex as well but nothing.</p>
  
  <pre><code>$process = Mage::getModel('index/indexer')-&gt;getProcessByCode('catalog_product_attribute');
  $process-&gt;reindexAll();
  </code></pre>
  
  <p>I have done full cache clearing as well as full reindex from back-end but nothing.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks a lot!
  Leo</p>