Posts

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 ) :

How to show featured products on home page in magento?

If you want to show featured products on home page in magento so here is code for you... IF you still have not add featured attribute in magento so first of all you have to add arrtibute in  Manage Attributes Step 1: Create new Featured attribute Create a new attribute by going to Catalog > Attributes > Manage Attributes > Add New Attribute. Attribute Properties Attribute Identifier: featured Scope: Store View Catalog Input Type for Store Owner: Yes/No Unique Value (not shared with other products): No Values Required: No Input Validation for Store Owner: None Apply To: All Product Types Front End Properties Use in quick search: No Use in advanced search: Yes Comparable on Front-end: No Use In Layered Navigation (Can be used only with catalog input type ‘Dropdown’): No Visible on Catalog Pages on Front-end: Yes Manage Label/Options Default: Featured Product Save the new attribute and go to Catalog ? A

Why session become blank on several pages in codeigniter?

I was to irritate that session did not work or became blank on sevral pages during work on website. i tried too many short ways but they all are works for some time or some place finally i got a permanent way to store a session in mvc codeigniter. First of all go in application/config/config.php open this file and change this content $config['sess_use_database'] = FALSE; TO $config['sess_use_database'] = TRUE; and $config['sess_table_name'] = 'ci_sessions'; // sess_table_name should be " ci_sessions "  when You change this after that copy and paste this sql query in database CREATE TABLE IF NOT EXISTS `ci_sessions` (   `session_id` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',   `ip_address` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',   `user_agent` varchar(50) COLLATE utf8_unicode_ci NOT NULL,   `last_activity` int(10) unsigned NOT NULL DEFAULT '0',   `user_data` text