I have some difficulties to convert some phtml codes into php (note: simple conversion with online tools html to php does not work therefore please do not answer if it is to refer online tool). Below is the phtml code that I would like to add in .php file:
<?php
$_product = Mage::getModel('catalog/product')
->setStoreId($_item->getOrder()->getStoreId())
->load($_item->getProductId());
?>
<div style="float:left;width:100px;padding-right:10px;">
<img src="<?php echo Mage::helper('catalog/image')
->init($_product, 'image')
->constrainOnly(TRUE)
->keepAspectRatio(TRUE)
->keepFrame(FALSE)
->resize(100,100); ?>"
alt="<?php echo $_item->getName() ?>" />
</div>
When I converted to php I added those lines as below the code is not working:
$order = $this->getOrder();
$item = $this->getItem();
$pdf = $this->getPdf();
$page = $this->getPage();
$lines = array();
echo "<?php $_product = Mage::getModel('catalog/product')->setStoreId($_item->getOrder()->getStoreId())->load($_item->getProductId()); ?>";
// draw Product name
$lines[0] = array(array(
echo "<div style=\"float:left;width:100px;padding-right:10px;\"><img src=\"<?php echo Mage::helper('catalog/image')->init($_product, 'image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(100,100); ?>\" alt=\"<?php echo $_item->getName() ?>\" /></div>";
'text' => Mage::helper('core/string')->str_split($item->getName(), 50, true, true),
'feed' => 35,
));
Therefore can you tell me what should I modify to make it work?