Magento Themes and Magento Extensions

Magento: Save data in the session variable.

Share
Posted on April 7th, 2013 | Posted by admin

Magento To save in the magento session variable.

$data = 'Your data';

Mage::getSingleton('core/session')->setMyData($data);
OR
Mage::getSingleton('core/session')->setData('my_data', $data);

To retrive the data stored in the session.

$data = Mage::getSingleton('core/session')->getMyData();
OR
$data = Mage::getSingleton('core/session')->getData('my_data');

echo data;

Split Magento Sites Into Separate Magento Instances?

Share
Posted on April 6th, 2013 | Posted by admin

Split Magento Sites Into Separate Magento Instances?
I was thinking of just copying the entire store and database, and then deleting the other stores from the duplicate, and continue this way until the task is done, and then delete all the sites off of the main store.

MAGENTO SHOW SYSTEM DATE PHP EXAMPLE

Share
Posted on April 5th, 2013 | Posted by admin

When we need to get Magento time as as an variable you should useĀ  echo Mage::getModel with timestamp() function.it can display on your Magento font end anywhere and if it needs format date as dd-mm-yyyy it can simply use PHP date function.This example shows how to display the date and format the date time

1 //display the default output
2 echo Mage::getModel('core/date')->timestamp(time());
3
4 //format the op- dd-mm-YYY
5 echo date('d-M-Y',strtotime(Mage::getModel('core/date')->timestamp(time()));
6
7 //format date time
8 echo date('d-M-Y H:i:s',strtotime(Mage::getModel('core/date')->timestamp(time()));

Create a custom category attribute in Magento

Share
Posted on April 4th, 2013 | Posted by admin

Create a custom category attribute in Magento
Copy and paste the following code in your header.phtml

Magento Custom Category Listing Block

Share
Posted on April 3rd, 2013 | Posted by admin

Here I wanted to show you how to build a custom Magento category listing block that you can use on your own Magento store. We will go over each step at getting a category listing of your magneto categories and even a sub category listing.

Here is the finished code for your new category listing block.

<?php
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
$catIds = explode(',',$cats);
?>
<ul>
<?php foreach($catIds as $catId): ?>
	<li>
    	<?php
			$category = Mage::getModel('catalog/category')->load($catId);
			echo $category->getName();
Page 5 of 6« First...«23456»