Archive

Archive for the ‘Technologies’ Category

Twitter: What did I learn from it.

August 12th, 2010

Twitter…. Tweets ….. funny how this has just blended into our life style these days, anyone with a computer, a laptop, an Ipad, a netbook, a phone is tweeting. Heck, they make phones that are sold based on the fact that “Hey this phone can tweet”, amazing isn’t it? That in my head is only second to cars being sold based on the fact that they can integrate with an Apple MP3 player. (Oh! I am sorry, did I say MP3 player? I meant Ipod, yes that fancy music player that can play.. well mp3 music.)

I was one of those people who found it pretty funny that there were people out there that wanted to know what others were doing… eating…. playing…. anything. I was one of those people that enjoyed watching Conan O’brien’s Twitter tracker bit (A mockery of twitter.com which displayed senseless funny celebrity tweets) just because I used to love making fun of twitter.com until recently when I used it myself and started following it, seeing it only trend upwards. Its amazing how tightly integrated this in essence pretty basic website is these days. Businesses rely on it to get the word out, be it events or a new product launch, friends rely on it keep their friends up to date, it has single handledly changed the face of marketing, its a one stop shop to find out whats going on almost anything, anywhere in the world.

So I spent some time thinking about it, that how a simple website idea like twitter.com got to where it is today, what we can learn from it and apply it to our next website idea.

This is what I came up with.

A website these days

  1. must have a social element to it.
  2. should be very focused and shouldn’t perform more than a function or two. (Another example of this is the recent popularity of the shopping site woot.com that sells a product a day)
  3. should be easy on the eyes and easy on the mind. Seems like people have lost the thirst to learn and use, they just want to use, one may be two buttons and done!
  4. Should let users share their views (wherever applicable) with others, since apparently people don’t mind standing on this new virtual soap box.
  5. and finally should be available on multiple platforms, specially mobile, iphone and andriod style products.

Your thoughts?

admin Social media, Technologies, general , ,

Magento multi-site install: Run a specific store view via the domain.

August 9th, 2010

Now ofcourse magento comes with a website or a language switcher built in, so if you have multiple store views for a single website/store, you have a nifty drop-down list on the front-end to let the user switch to a preferred language and locale. But what it doesn’t come out of the box with is the ability to direct the user to a store view based on the domain (Most big companies own most domain extensions on their main domain.). So in-case you are trying to accomplish the above you can use this technique that I came up.

In this example I assume that you own domains for the different countries for the same website. So say www.domain.com is primary domain in English and you also own www.domain.de for German, www.domain.nl for Dutch and www.domain.fr for French and so on.

So here’s how to do it.

Pre-requisite:
All the domains mentioned above are directed to the same magento instance via apache site setup. Usually virtual hosts.

Step 1: Setup Store codes in the Magento Admin.
This can be done in the admin under System -> Manage Stores.

For this example my stores are setup using the magento admin where the store view code is the domain extension, meaning for the German store the code = “de”, for the french store => “fr”, for the dutch store => “nl” and so on.

Step 2: Changes to the main index.php file.
Add the following code at the end of the main index.php file (Just paste over the Mage::run() statement, make sure you remove this statement.).


/**
* find the domain tld.
*/
function find_tld($url)
{
$purl = parse_url($url);
$host = $purl['host'];
preg_match_all(”/([a-zA-Z0-9_-]+).([a-zA-Z0-9.-]{2,8})$/”, $host,$matches);
return $matches[0][0];
}

//Store Switcher based on URL
$host = find_tld(”http://”.$_SERVER['HTTP_HOST']);
switch ($host)
{
case ‘domain.nl’:
$store = ‘nl’;
break;
case ‘domain.fr’:
$store = ‘fr’;
break;
case ‘domain.de’:
$store = ‘de’;
break;
default: $store = ”;
}

//Set the store
Mage::run($store);

That should do it.

You can also use this technique where you don’t want to present the user with the options to switch stores for any number of reasons e.g. you have different pricing on different store views.

You may also use this technique for sub-domains, you will just have to tweak the find TLD function to find subdomain.

admin Magento, PHP, Programming, Technologies , , ,

Display Fail

August 7th, 2010

Open vs Closed source (Java vs .NET)

August 5th, 2010