How to View Magneto SKU Number in Cart & Page View?

1. You Want cart page to view the SKU number :
You can use below code in your : app/design/frontend/youtheme/yourtheme/template/checkout/cart.phtml
<?php echo $this->__(‘SKU Number’) ?>

And add item section this : app/design/frontend/youtheme/yourtheme/template/checkout/cart/item/default.phtml
<?php echo $_item->getSku() ?>

2. You want to view the Page View :

app/design/frontend/youtheme/yourtheme/template/catalog/product/view.phtml
<!– Write SKU –>
<?php echo $this->__(‘SKU Number :’); ?> <?php
$sku = Mage::getModel(‘catalog/product’)->load($_product->getId())->getSku();
echo $sku; ?>
<!– Sku End –>

its is working for my side.

How to view Sub Categories only in Parent Categories from Magento?

<?php
$obj = new Mage_Catalog_Block_Navigation();
$current_cat     = $obj->getCurrentCategory();

$currentCatId    = (is_object($current_cat) ? $current_cat->getId() : ”);

$currentPage = (int) $this->getRequest()->getParam(‘p’, 1);
//$currentPage = $_GET[‘p’];

$pageSize = 3;

$collection = Mage::getModel(‘catalog/category’)->getCollection()
->addAttributeToFilter(‘parent_id’, $currentCatId)
->addAttributeToSelect(‘name’)
->addAttributeToSelect(‘url’)
->setLoadProductCount(1)
->setOrder(‘name’, ‘asc’)
->setPage($currentPage, $pageSize);

$totCat = $collection->getSize();
$store_cats = $collection->load();

$pageTot = ceil( $totCat / $pageSize );

?>
<div>
<ul class=’navigation’>
<?php foreach ($store_cats as $cat) : ?>
<li><a href=”<? echo $cat->getUrl() ?>”><?php echo $cat->getName() . ” (” . $cat->getProductCount() . “)” ?></a>
<?php echo $cat->getImageUrl(); ?>
</li>
<?php endforeach; ?>
</ul>

</div>

<ul>
<?php for ( $i=1; $i<=$pageTot; $i++ ) : ?>
<?php if ( $i == $currentPage ) : ?><li><?php echo $i ?></li><?php else : ?><li><a href=”<?php echo $current_cat->getUrl() ?>?p=<?php echo $i ?>”><?php echo $i ?></a></li><?php endif; ?>
<?php endfor; ?>
</ul>

And Just Put below code in your CMS (or) Static Block page inside.
{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/category_listing.phtml”}}

How to view Particular Category List in Home Page from Magento?

Go to Magento Cms Page Inside, Put Blow Code then view in your page :
{{block type=”catalog/product_list” category_id=”98″ template=”catalog/product/list.phtml”}}

(OR)

Open in your Magento theme page layout, There you can past below code

<?php     echo $this->getLayout()->createBlock(‘catalog/product_list’)->setCategoryId(98)->setTemplate(‘catalog/product/list.phtml’)->toHtml()     ?>

(OR)

Open Magento Static Block, Create Magento New Static Block, Then Past Below Code :

{{block type=”catalog/product_list” category_id=”98″ template=”catalog/product/list.phtml”}}

Once you placed above code in Magento Staic block inside, You can write below code in your Magento .phtml file inside,

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId(IDENTIFIER)->toHtml() ?>

Here you change "IDENTIFIER" in your Magento Static Block identified number.
Now you refresh your site will show your custom Magento Style Theme.

Thanks,
J.
echo $this->getLayout()->createBlock('catalog/product_list')->setCategoryId(10)->setTemplate('catalog/product/list.phtml')->toHtml()

How to call all categories in Magento Home page?

{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/all_category_view.phtml”}}

How to call Navigation in Magento CMS Page inside?

Just write inside magento cms page below code :

{{block type=”catalog/navigation” name=”catalog.vertnav” alias=”navigation_homepage” template=”catalog/navigation/vert_nav.phtml”}}

How to view All Categories only in Home from Magento?

<?php $_maincategorylisting=$this->getCurrentCategory()?>
<?php $_categories=$this->getCurrentChildCategories()?>
<!– h2><?php //echo $this->__(‘Browse Products’) ?> </h2 –>
<div>
<ul>
<? foreach ($_categories as $_category):?>
<? if($_category->getIsActive()): ?>
<?php $cur_category=Mage::getModel(‘catalog/category’)->load($_category->getId()); ?>
<?php $layer = Mage::getSingleton(‘catalog/layer’); ?>
<?php $layer->setCurrentCategory($cur_category);
//$this->getCurrentCategory()->getImageUrl()
?>
<? if($_imageUrl=$this->getCurrentCategory()->getThumbnailUrl()):?>
<li> <a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<img src=”<?php echo $_imageUrl ?>” width=”auto” alt=”<?php echo $this->htmlEscape($_category->getName()) ?>” />
</a>
<a href=”<?php echo $this->getCategoryUrl($_category) ?>” title=”<?php echo $this->htmlEscape($_category->getName()) ?>”>
<?php echo $this->htmlEscape($_category->getName()) ?>
</a>
<? if($_description=$this->getCurrentCategory()->getDescription()):?>
<p>
<?php echo $_description ?></p></li>
<?php endif; ?>
<? endif; ?>
<? endif; ?>
<?php endforeach; ?>
<div></div>
</ul>
<div></div>
</div>
<?php $layer->setCurrentCategory($_maincategorylisting); ?>

Just Put your home page or Any Static Page this below Line only :

{{block type=”catalog/navigation” name=”catalog.categories” alias=”all_categories_homepage” template=”catalog/navigation/all_category_view.phtml”}}

Welcome to our other site : www.srinesiga.com

© 2020 Spirituality