PHP, Magento, Codigniter, Opencart and Wordpress Developer. Contact for school and college projects on PHP, Codiegniter, Wordpress, Mysql etc.
Thursday, 8 January 2015
Magento: Back Button On Product Detail Page
"/app/design/frontend/default/default/template/catalog/product/view.phtml"
Magento: “Continue Shopping” button redirect to the last product's category page
It is working fine.
<?php
$lastProductAddedToCartId = Mage::getSingleton('checkout/session')->getLastAddedProductId();
if($lastProductAddedToCartId) {
$productCategoryIdsArray = Mage::getModel('catalog/product')->load($lastProductAddedToCartId)->getCategoryIds();
$continueShoppingCategoryUrl = Mage::getModel('catalog/category')->load($productCategoryIdsArray[0])->getUrl();
}
?>
<button type="button" title="Continue Shopping" class="button" onclick="setLocation('<?php echo (isset($continueShoppingCategoryUrl)) ? $continueShoppingCategoryUrl : $this->getContinueShoppingUrl(); ?>')"><span><span>Continue Shopping</span></span></button>
<?php
$lastProductAddedToCartId = Mage::getSingleton('checkout/session')->getLastAddedProductId();
if($lastProductAddedToCartId) {
$productCategoryIdsArray = Mage::getModel('catalog/product')->load($lastProductAddedToCartId)->getCategoryIds();
$continueShoppingCategoryUrl = Mage::getModel('catalog/category')->load($productCategoryIdsArray[0])->getUrl();
}
?>
<button type="button" title="Continue Shopping" class="button" onclick="setLocation('<?php echo (isset($continueShoppingCategoryUrl)) ? $continueShoppingCategoryUrl : $this->getContinueShoppingUrl(); ?>')"><span><span>Continue Shopping</span></span></button>
Wednesday, 7 January 2015
Magento: Home Page condition
<? $action = Mage::app()->getFrontController()->getAction()->getFullActionName();
if($action=='cms_index_index'){
echo "Here Your custom code";
?>
<!-- or here you can write your custom code -->
<?php echo $this->getChildHtml('breadcrumbs') ?>
<?php } ?>
Subscribe to:
Posts (Atom)