title: Small product issue on success page Magento
body: <p>I try to get product details on my checkout success page in Magento 1.9, but I don't know why I get the same product for two times. This is what I add in the <strong>app/design/frontend/base/default/template/checkout/success.phtml</strong> file</p>
  
  <pre><code>    &lt;tbody&gt;
          &lt;?php
          foreach ($items as $item):
              $_product = Mage::getModel('catalog/product')-&gt;load($item-&gt;getProductId());
              $productType = $_product-&gt;getTypeId();
              $entityId = $_product-&gt;getEntityId();
              $options = $item-&gt;getProductOptions();
              if ($productType == "bundle") {
                  $bundled_product = new Mage_Catalog_Model_Product();
                  $bundled_product-&gt;load($entityId);
                  $selectionCollection = $bundled_product-&gt;getTypeInstance(true)-&gt;getSelectionsCollection(            $bundled_product-&gt;getTypeInstance(true)-&gt;getOptionsIds($bundled_product), $bundled_product );
                  $bundled_items = array();
                  foreach ($selectionCollection as $option) {
                      $bundled_items[] = $option-&gt;product_id;
                  }?&gt;
                  &lt;tr&gt;
                      &lt;td rowspan="1"&gt;
                          &lt;img class="product_img" src="&lt;?php echo Mage::helper('catalog/image')-&gt;init($_product, 'thumbnail')-&gt;resize(75); ?&gt;" alt="product-img" /&gt;
                          &lt;?php echo $item-&gt;getName();
                          $customOptions = $options['options'];
                          if (!empty($customOptions)) {
                              foreach ($customOptions as $option) {?&gt;
                                  &lt;span class="bottom-align"&gt;
                                      &lt;?php
                                      echo '&lt;b&gt;' . $option['label'] . '&lt;/b&gt; :';
                                      echo $optionValue = $option['value'];
                                      ?&gt;
                                  &lt;/span&gt;
                                  &lt;?php
                              }
                          }
                          ?&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice($item-&gt;getPrice()); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $item-&gt;getQtyOrdered(); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $item-&gt;getSku(); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice($item-&gt;getRowTotal()); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php
              } else if (in_array($entityId, $bundled_items)) {
  
              } else {
                  ?&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;img class="product_img" src="&lt;?php echo Mage::helper('catalog/image')-&gt;init($_product, 'thumbnail')-&gt;resize(75); ?&gt;" alt="product-img" /&gt;
                          &lt;?php
                          echo $item-&gt;getName();
  
                          $customOptions = $options['options'];
                          if (!empty($customOptions)) {
                              foreach ($customOptions as $option) {
                                  ?&gt;
                                  &lt;span class="bottom-align"&gt;
                                      &lt;?php
                                      echo '&lt;b&gt;' . $option['label'] . '&lt;/b&gt; :';
                                      echo $optionValue = $option['value'];
                                      ?&gt;&lt;/span&gt;                                
                                  &lt;?php
                              }
                          }
                          ?&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice($item-&gt;getPrice()); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $item-&gt;getQtyOrdered(); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $item-&gt;getSku(); ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice($item-&gt;getRowTotal()); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php
              }
              ?&gt;
          &lt;?php endforeach ?&gt;
      &lt;/tbody&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VzroS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VzroS.png" alt="enter image description here"></a></p>