Thursday, April 7, 2011

Magento :: get URL paths for skin, media, Js OR base URL


Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
//http://magento.demo/js/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
//http://magento.demo/index.php/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
//http://magento.demo/media/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
//http://magento.demo/skin/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
//http://magento.demo/


View original source.

http://ahsangill.wordpress.com/2010/05/12/magento-get-url-paths-for-skin-media-js/


Enjoy and hope this helps.. :)

Cheers,
spawn

Wednesday, April 6, 2011

Droid font family courtesy of Google & Ascender

Last night I installed Pinguy Linux on my USB, Pinguy Linux is an another Distro of Linux made out of Ubuntu 10.10. It is relatively captures the beauty of Linux and the Elegance of MAC OS. And I was amazed of it's default font so I though of using in on my windows 7 machine. And I scoured the net over that single font that struck me and after a few minutes of Google'ling. I stumbled upon this wonderful site (http://damieng.com/blog/2007/11/14/droid-font-family-courtesy-of-google-ascender). It offers brief history and explanation about the font.

And since I have no time, for now to make a very long post. I'll let you read it on your own.

Please visit this link for the Information and the Download of the font.




http://damieng.com/blog/2007/11/14/droid-font-family-courtesy-of-google-ascender


Enjoy and I hope this helps even just a little.

Cheers,
spawn

Changing Utorrent Icon on Main Window and System tray icon

I've been puzzled a few days on how to change the system tray icon of utorrent, my main purpose was to hide it so that people won't notice that I am downloading using a torrent client (Utorrent).

Just a little FAQ, Utorrent is a bittorrent client which is most commonly used for downloading movies, games, applications and other files that are shared to P2P networks around the world.

If you want to download the client. Check the link below.


http://www.utorrent.com/downloads/


Here's the mose intresting part.

Changing the System tray icon.

It seem's to be pretty hard to figure, but it really is quite simple.

Step 1.
Have two(2) icon files (.ico) ready as replacement.

Step 2.
Change the name of the first one to (main.ico), This will be shown in main window of your utorrent client.
Change the other to (tray.ico), This will be serve as your new system tray icon for your utorrent client.

Step 3.
Navigate to "%AppData%" (without the quotes). To do this, Press WIN + R then type in "%AppData%" in the run command.

Step 4.
Look for the utorrent folder and paste your icons.

There you go! you will have your own custom utorrent icon on your system tray.

NOTICE: If your utorrent still runs while doing this process, you must restart you client (not your Operating System).


Consolation:
You can create your own custom Icons from pictures or grab icons from other applications installed on your computer.


Just download and install Easy Icon Maker. Link is provided below.


http://www.icon-maker.com/


Hope this helps.

Cheers,
spawn

Monday, April 4, 2011

If else condition in mini.login.phtml on magento

I had this problem with the mini.login.phtml on magento 1.4.0.1, the case was when I try to successfully login to the front page, the Email and Password Boxes are still visible to I tried to replace it with other options once the user has successfully logged in. Since I need to display the "My account". "Logout"..etc Options after a successful login. I made a conditional statement. And here's the code. Credits to Mr. Michael Christian Young for giving an Idea about this. Though, there was a little bit of a bug on the code he gave me to I had to organize and re assemble them.

Anyways, here it is.


/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
helper('customer')->isLoggedIn()): ?>










Hope that helps to those people facing the same problem as I once had. :)

Cheers,
spawn

Putting alt text or title on Easyflag Magento Module

The EasyFlag Module for magento is free and can be downloaded using magento connect.

Here is the link

http://www.magentocommerce.com/magento-connect/TemplatesMaster/extension/1481/magento-easyflags


But the client want to put some alternate text when you try to hover unto the flags to know want country it is.
Actually it in just pretty simple and straight forward, so here's what I did.


I added title="htmlEscape($_lang->getName()) ?> right after initializing the "tag.
here's the original code.

getStores())>1): ?>




and here's the code after.

getStores())>1): ?>

getStores() as $_lang): ?>
<?php echo $this->htmlEscape($_lang->getName()) ?>






hope this helps even a little. :)

Cheers,
Spawn