Posts

How to know product type in magento?

How to know product type in magento that product is group or simple or downloadable. echo $product->getTypeId();

How to get the id of associated products in magento from the array of associated products?

Get the id of associated products in magento from the array of associated products. i was getting rid that i have array of associated product but unable to get the id of associated product. after so much search i found this solution check this it will works for you .... $associatedProducts = $_product->getTypeInstance(true)->getAssociatedProducts($_product); foreach($associatedProducts as $assoc_id) { $aid = $assoc_id->getId(); echo "id of associated products is = ".$aid; echo "<br/>"; }

How to get the array of associated product of group product in magento?

For get the array of associated product of group product in magento you to add simple this line in code where you are getting group product details. $associatedProducts = $_product->getTypeInstance(true)->getAssociatedProducts($_product); print_r( $associatedProducts ); it will return to you all associated products array of group product now you can use this array as you want. and you want to get the associated product ids only then you can simple add this like below above code foreach($associatedProducts as $assoc_id) { $aid = $assoc_id->getId(); echo "id of associated products is = ".$aid; echo "<br/>"; }

How to get count of cart item in magento?

simply copy and paste where you want to get count of cart item in magento <?php $mageFilename = 'app/Mage.php'; require_once $mageFilename; umask(0); Mage::app(); Mage::getSingleton('core/session', array('name'=>'frontend')); $session = Mage::getSingleton('checkout/session'); $output = ""; foreach ($session->getQuote()->getAllItems() as $item) {     $output .= $item->getQty() . "<br>"; } print $output; ?>

How to create a page which show only subcategory or how to show all category on one page in magento?

Go to the admin Now follow the step CMS->PAGES->Add new page Insert these data in the form Step 1:- insert in Page Information tab Titile-> categories URL Key *-> categories Status *->Enabled Step 2:- insert in Content Content Heading->anything according to you and paste this code in the textarea box {{block type="catalog/navigation" name="catalog.categories" template="catalog/navigation/category_listing.phtml"}} Step 3:- select in Page Layout Layout *->select   2 columns with right bar After this save the page Now add new page and in this directories App/design/frontend/base/default/templates/catalog/navigation/ category_listing.phtml And add this code in this page <?php $_category  = $this->getCurrentCategory();  $collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id); $helper     = Mage::helper('catalog/category'); ?>

How to show Currency Options drop down on homepage or header in magento?

show Currency Options drop down on homepage or header in magento? and if not showing  Currency Options drop down somewhere so follow these steps. - Follow these steps to show store specific currency:- - Go to System -> Configuration -> GENERAL -> Currency Setup - In left sidebar at top, you will see “Current Configuration Scope” - Select your desired store from the selection list - Now, under “Currency Options“, you will see “Default Display Currency” - Select your desired currency from the selection list You are done. In frontend, select the store for which you did the above changes. You will see the price in your desired currency. and put this line of code where u you want to display currency converter <?php echo $this->getLayout()->createBlock('directory/currency')->setTemplate('directory/currency.phtml')->toHtml(); ?>

How to show category on right side or left side in magento?

First of all you have to create a new block in xml to show the category Navigate to /app/design/frontend/default/default/layout/catalog.xml Open this page and search this keyword " Default layout, loads most of the pages " and put this code in block <reference name="right"> <block type="catalog/navigation" name="catalog.righthomenav" template="catalog/navigation/right_home_nav.phtml" /> </reference> you can change layout position in mageto to change the  reference name as ( right, left, footer, etc ) create a new and directory like this path  /app/design/frontend/default/default/template/ catalog/navigation/ right_home_nav .phtml and paste this code in that in new page  right_home_nav .phtml <h2>Browse</h2> <div class="block"> <ul id="nav_category" class="nav_category"> <?php foreach ( $this -> getStoreCategories ( ) as $_category ) :