Magento: Showing only simple products on checkout success page -


i've displayed products ordered on checkout success (success.phtml), problem it's displaying configurable and associated simple product when want display simple one. tried doing below doesn't display anything. can't use typeof on $item doing wrong. kindly take @ code , give me hint how working properly? cheers.

<?php $order_id =   mage::getsingleton('checkout/session')->getlastrealorderid(); $order_details = mage::getmodel('sales/order')->loadbyincrementid($order_id);  foreach ($order_details->getallitems() $item): ?> <?php if ($item->getparentproductid()): ?> <h4> <?php echo $item->getname(); ?> </h4> <br /> <h4>quantity: <?php echo round($item->getqtyordered(), 0); ?> </h4> <br /> <img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->resize(200); ?>" width="200" height="200" class="media-object img-responsive" alt="<?php echo $this->getimagelabel($item, 'small_image'); ?>"/> <?php endif; ?> <?php endforeach; ?> 

basically @ type of product object, untested don't know if work, idea.

mage::getsingleton('checkout/session')->getlastrealorderid(); $order_details = mage::getmodel('sales/order')->loadbyincrementid($order_id);  foreach ($order_details->getallitems() $item): ?> <?php if ($item->getproduct()->gettypeid() == 'simple'): ?> <h4> <?php echo $item->getname(); ?> </h4> <br /> <h4>quantity: <?php echo round($item->getqtyordered(), 0); ?> </h4> <br /> <img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->resize(200); ?>" width="200" height="200" class="media-object img-responsive" alt="<?php echo $this->getimagelabel($item, 'small_image'); ?>"/> <?php endif; ?> <?php endforeach; ?> 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -