php - how to combine the two for each -
please me, make 2 foreach. , appearance double.
<?php $_product = $this->getproduct(); if ($this->getitems()->getsize()) { $related_prods = mage::getmodel('catalog/product') ->getcollection() ->addattributetoselect('condition') ->addattributetofilter('entity_id', array('in' => $_product->getrelatedproductids())); foreach ($this->getitems() $_item) { foreach ($related_prods $related) { ?> <li class="item col-lg-12 border-ngisor"> <div class="col-lg-6"> <div class="product"> <div class="product-details"> <p class="product-name"><a href="<?php echo $_item->getproducturl() ?>"><?php echo $this->escapehtml($_item->getname()) ?></a></p> <?php echo $this->getpricehtml($_item, true, '-related') ?> <?php if ($this->helper('wishlist')->isallow()) : ?> <a href="<?php echo $this->getaddtowishlisturl($_item) ?>" class="link-wishlist"><?php echo $this->__('add wishlist') ?></a> <?php endif; ?> </div> </div> </div> <div class="col-lg-6"> <?php echo $related->getdata('condition'); ?> </div> </li> <?php } } } ?>
can explain how combine 2 each having 2 foreach ,one foreach other getting problem in foreach.
Comments
Post a Comment