Explain life cycle of a Block in Magento
-
zendnwar
-
March 5, 2015
-
Magento
-
203 Comments
_prepareLayout() method is called immediately after a block has been added to the layout object for the first time. _beforeToHtml() method is called immediately before a block’s HTML content is rendered. _afterToHtml() method is called immediately after a block’s HTML content is generated. _beforeChildToHtml() is called when a parent renders one of its children (through a call to $this->getChildHtml(‘name’)).
Continue Reading
Which routers exist in a native Magento implementation?
-
zendnwar
-
March 5, 2015
-
Magento
-
284 Comments
– admin, – standard, – cms, – default
Continue Reading
Get All Children Of A Block in Magento
-
zendnwar
-
March 5, 2015
-
Magento
-
0 Comments
Sorted: $this->getSortedChildren() Unsorted: $this->getChild()
Continue Reading
How to show stock status in shopping cart in Magento
-
zendnwar
-
February 13, 2015
-
Magento
-
225 Comments
It is very simple. Please add a <th> Stock Status </th> filed in default\template\checkout\cart.phtml and go to \default\template\checkout\cart\item\default.phtml <?php $_product= Mage::getSingleton(‘catalog/product’)->load($_item->getProductId()); ?> <td class=”a-center”> <span calss=”stock-cart”> <?php $qty = $_product->getStockItem()->getQty(); if($qty > 0){ echo “In stock”; }else{ echo “Out of stock”; } ?></span> </td> Hope so it will work.
Continue Reading
How to disable product tag in Magento
-
zendnwar
-
February 12, 2015
-
Magento
-
0 Comments
Just follow below instruction. System > Configuration > Advanced > Advanced > Mage_Tag – Disable
Continue Reading
Magento review count of product
-
zendnwar
-
February 12, 2015
-
Magento
-
0 Comments
<?php echo $review_count = $_product->getRatingSummary()->getReviewsCount() ?>
Continue Reading
How to add review form in product details page custom tab in Magento
-
zendnwar
-
February 12, 2015
-
Magento
-
0 Comments
Please add below code in your local.xml . This file system for Magento EE. <catalog_product_view> <!–Product Information Block–> <reference name=”root”> <reference name=”product.info”> <block type=”review/product_view_list” name=”product.info.product_additional_data” as=”product_additional_data_review” template=”review/product/view/list.phtml” /> <block type=”review/form” name=”product.review.form” as=”review_form” /> </reference> </catalog_product_view> call below code in your product view file. <?php echo $this->getChildHtml(‘review_form’) ?> <?php echo $this->getChildHtml(‘product_additional_data_review’) ?>
Continue Reading
Product status check in Magento
-
zendnwar
-
February 10, 2015
-
Magento
-
0 Comments
$stock _status = $_product->getStockItem(); if ($stock_status->getIsInStock()) { echo ” in stock”; } else { echo “out of stock”; }
Continue Reading
Get Category URL from Category ID in Magento
-
zendnwar
-
January 9, 2015
-
Magento
-
1 Comment
Very simple job, just follow below code $cat_id = 3; // predefined category ID echo cat_url = Mage::getModel(“catalog/category”)->load($cat_id)->getUrl();
Continue Reading
Magento Events List
-
zendnwar
-
January 7, 2015
-
Magento
-
0 Comments
Magento uses a fantastic event hooking system, following the Observer Design Pattern, allowing additional functionality to be plugged in and out without modifying the core code. Core File Line Event /app/code/core/Mage/Admin/Model/Session.php 104 admin_session_user_login_success /app/code/core/Mage/Admin/Model/Session.php 112 admin_session_user_login_failed /app/code/core/Mage/Admin/Model/User.php 337 admin_user_authenticate_before /app/code/core/Mage/Admin/Model/User.php 354 admin_user_authenticate_after /app/code/core/Mage/Adminhtml/Block/Api/User.php 52 api_user_html_before /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php 160 adminhtml_catalog_category_edit_prepare_form /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php 157 adminhtml_catalog_category_tabs /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 291 adminhtml_catalog_category_tree_is_moveable /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 328 adminhtml_catalog_category_tree_can_add_root_category /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 348 adminhtml_catalog_category_tree_can_add_sub_category …
Continue Reading