How to call one directory tempate file in to other template file in magento
-
02-10-2020 - |
Domanda
how to call app\design\frontend\base\default\template\checkout\cart\crosssell.phtml to app\code\local\Cmsmart\AjaxCart\controllers\IndexController\ in popup window
if(@$product) $json_encode['ajaxcontinue'] = '
<div>
<ul class="messages ajaxcart-messages">
<li class="success-msg">
<ul>
<li><span><a title="'.@$product->getName().'" href="'.@$product->getProductUrl().'">'.@$product->getName().' </a> '.$this->__('has been added to cart').'.</span></li>
<li><button onclick="setLocation(\''.Mage::getBaseUrl().'checkout/\')" class="button btn-continue" title="'.$this->__('Checkout').'" type="button"><span><span>'.$this->__('Checkout').'</span></span></button>
</ul>
</li>
</ul>
</div>';
Soluzione
Just Call below code in popup it will load same phtml for you
<?php echo $this->getLayout()->createBlock('checkout/cart_crosssell')->setTemplate('checkout/cart/crosssell.phtml')->setProduct($product)->toHtml();?>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange