Standing Desk Experiment.

There’s a lot of hype recently around standing while working in the office instead of sitting down. Apparantly you burn ~50 more calories per day standing up vs sitting down.

This might be a good time-saving alternative to doing a daily run for my work-out goals so I’m giving it a shot. I’ll be the 4th person in the Sweet Tooth office to try this out. I’m on day 2. Here’s how my setup looks like: 

700566072

Magento CMS Tutorial/Reference

I was helping someone learn how to use Magento CMS static blocks and pages and I couldn’t find a great reference. I’ve decided to write my own. 

Pages – Pages are what shows up in the front-end. The URL key is what you use to access the page (yoursite.com/urlkey) and the content is what appears in the page. Title shows up in the title bar. Simple.

Static Blocks – These can be inserted into any page and repeated. For example, if you had a page that had a block of text that you want to appear on another page but you didn’t want to rewrite it and have to sync between both pages then you would want to create a static block and include that static block in each page’s content. The static block si referenced by the Identifier field. Here’s an example of how this would be used. Static blocks and contain other static blocks too. 

Page Content Codes

When working in the Magento CMS you can enter any HTML into the content box, but you can also put in these special things:

  1. Store URLs: {{store url=”path_to_your_media_file_goes_here”}}
  2. Skin Image URLs: {{skin url=”path_to_your_media_file_goes_here”}} 
  3. Media Image URLs: {{media url=”path_to_your_media_file_goes_here”}}
  4. Static Block Content: {{block type=”cms/block” block_id=”page_identifier_goes_here”}}
  5. Other Data Blocks (advanced): {{block type=”module/blockclass” block_id=”choose_a_name” template=”template_file_path”}}

Now I’ll go into a bit more detail:

1. Store URLs
{{store url=”path_to_your_media_file_goes_here“}}

If you want to link to a CMS page or some other page on your site you should use this code.

Example: Click here for customer service

2. Skin Image URLs
{{skin url=”path_to_your_media_file_goes_here“}} 

Skin image urls can be inserted into a page as paths to a skin image or file. These are relative to the skin/frontend/*package*/*theme*/ directory in your website.

Example: Here is a picture of our company logo: <img src=”{{skin url=’images/logo.png’}}” />

3. Media Image URLs
{{media url=”path_to_your_media_file_goes_here“}}

Skin image urls can be inserted into a page path to point to an uploaded image or file. These are relative to the media/ directory of your website.

Example: Here is a picture of a duck: <img src=”{{media url=’ducks/duckpicture.png’}}” /> and click here for a PDF that we created for you.

What’s the difference between skin images and media images?

Great question! Skin images are store layout/theme dependent and may change depending on the store view, but media images are static and don’t care about what theme is currently being displayed to the user. Media images are typically files that are very likely to change over time where skin images 

4. Static Block Content
{{block type=”cms/block” block_id=”page_identifier_goes_here“}}

Static block content can be inserted into the content of one or more pages. This allows you to have repeated content in your pages without having to manage multiple content page coppies every time you make an update.

Example: Here is your navigation menu: {{block type=’cms/block’ block_id=’my_navigation_menu’}}

5. Other Data Blocks (advanced)
{{block type=”module/blockclass” block_id=”choose_a_name” template=”template_file_path}}

If you are coding template files nad custom block classes, you can include any block class as a singleton using this method .The type attribute is the code to create the block class and the block ID is a custom name you can choose for the block. This block name is used in caching sometimes. Finally, the template file path is a reference to the template file from the app/design/frontend/*package*/*theme*/template directory.

TIP: You can also set the the blcok type to core/template to create a simple block that does not have a specific block class.

Example: Here is my footer block content: {{block type=’core/template’ block_id=’footer_block’ template=’page/html/footer.phtml’}}

 

Static_block_within_static_block

 

How to give requirements to a designer without pissing them off

Skeptical_dog_design_meme

Getting a website designed is pretty important for your business-everyone knows that, but if you can’t provide a proper specification for your designers then you’re going to get a shitty design.

It doesn’t matter what designer you’re working with. Even if your designer is an all-star they are going to have a hard time making something awesome for you when your requirements are tucked away in your brain. Here’s how to do it the right way:

1. Outline your goals.

For every page you want designed, state your goals. What is the purpose of this page? Are you trying to attract customers with a value proposition or are you trying to showcase functionality? Are you trying to direct new traffic to your pricing page or are you trying to inform your existing customers?

2. Show examples of sites you like.

Don’t try to reinvent the wheel and don’t expect your designer to do that either. Instead, your designer is going to look for inspiration from other designs. If you provide several examples of pages that you like and explain why you like their design and what about it you like, then it guides your designer to choose the right inspiration for your own design.

3. Provide minor details

Every page has its own caveats. You’re going to want a particular image somewhere, or some text to be more emphasized. Here’s where you write all that out. Do it in bullet form-don’t write your designer an essay. Also, don’t be too specific.

Following this process lets your designer stay creative and use their own judgement for everything around the content and still meet your goals and expectations. It’s a win-win – nobody gets pissed off you get a much better design 🙂

Taking it from good to great is what will make you a amazing leader.

Every growing company will have problems along the way. It’s a consequence of being distruptive to the market.

Do you think Apple was always so great? Microsoft did not veer from their constant upswing from time to time? Even Google and Facebook consistently receive a flood of love-hate.

Being part of a growing company can be a party one week and a death spiral the next week. 

Recognizing that every company in the world has its ups and downs is tough. 
Getting it back on track when it goes down is what will make you a great leader.

As a leader, you need to identify the problem, invent a solution, let go of your emotions, trust your team and move on – quickly. 

Kik is a great example. 2 years ago RIM hit them with a patent lawsuite in the wake of their exploading success. What Ted Livingston, their CEO, and the Kik team did to revive the messenger’s success up to it’s now 19-million userbase is simply extraordinary. Kik even returned to Blackberry despite the harsh feelings.

Seems hard, right? IT IS HARD! That’s why when you hit the skids with your project and bring it back successfully you’ll be a far better leader than you have ever been.

The hardest part of about starting a start-up is starting-up

People always ask me what they should do to make their ideas about start-ups a reality. The pitch me on this awesome idea and I tell them my thoughts and they get all giddy, then they ask “what should I do now?” Are you kidding? That’s like training for a marithon, getting to the start-line and saying “what do I do now?” Start running.

B7e

 Let’s address some commong phrases:

“I’m in the ideas phase right now.”: Great ideas are nothing without execution. Until you have a website, a line of code written, an internal system, or anything else (not necessarily all, just one would be OK) it is nothing. How about a website landing page? Use launchrock.com to make a landing page and register a domain in 15 minutes. There, now you’ve got something. Now when you tell other people about your awesome idea they will appreciate that you intend on moving forward and you’re not just throwing around ideas.

“But I’m not 100% sure it will work yet, still need to work out details.”: This mentality is OK, but don’t think like this for months. Take a few days. Also, take your best guess. You will never be at 100%. Do you think Steve Jobs was 100% sure his idea for the mac was going to work? Nobody is every 100% sure.

“But what if I fail?”: An idea that gets executed and fails is infinitely better than an idea that never gets executed. Create an minimal viable product (MVP, coined from the book The Lean Start-up by Eric Reiss) and you will learn SO MUCH more than what you knew through research. Do you think you’ll be better off fighting a war after you’ve sat in the trenches for a week or read a book about it? Exactly. Do you research, but don’t be afraid to fail. I heard once someone say “fail early, fail often”. Though success is obviously the goal, the sooner you fail the sooner you know if you’re headed in the wrong direction.

“I think I still have a lot to learn before I can start”: You’ll always be learning. You’re not going to stop learning when you start-up. It will be ongoing. If you want to fast-track your learning, read a book or two maybe. Here are some of my personal favourites: How To Win Friends And Influence People, The Lean Start-up, Rework, Venture Deals, Start Small Stay Small, Chrossing The Chasm

I recognize that starting up is easier for engineers/developers, but you can still find a way to get things done and start-up.

Hope this helps people out there!

J-out.

 

I’d rather have good talent than money to find good talent.

I feel like good talent is going to start getting harder to find than sufficient investment capital for new companies. 

The top talent that we’ve attracted has been the result of those people seeing us from an outside view and seeing our team grow and succeed. We don’t poach employees ever our of principle, but the ideal employees I’ve been finding are the ones don’t need the job but are always thinking “man that seems like an awesome place to work”.

Sweet Tooth HR is all about culture. We push the fact that you’re joining an all-star team of Canada’s smartest and enlisting to change an industry. It’s just like recruiting a sports team or an elite squad set out to fight terrorists in a foreign nation. Totally badass.

Group-uses-black-hatted-meme-378

The amount of money in your offer could have nothing to do with quality of the talent you attract. For start-ups, this is great to know but you still need to understand what the person really wants:

  • What will make you happy?
  • Where do you see yourself in 3 years?
  • What kind of company/culture do you want to be a part of?

 

Then, before even pitching an offer, accommodate to these requests and provide a reasonable pay or sufficient stock options on the side. If you’re looking for engineers, have them try some coding and see if they like it (and see if you like their code).

 

 

Mobile loyalty still not worth your time

I keep seeing all these mobile loyalty companies coming out that claim to have figured it out. I had the opportunity to sit down with the presidents from Loyalty Group and Points.com and to discuss this topic with them recently. At Sweet Tooth we have had the chance to launch a mobile app several times. Here is why we didn’t:

Crappy customer engagement: Do you seriously expect each one of your customers to download an app on their personal phone, register their details with your company, then visit your retail location – all just to be marketed to? Maybe you’ll get some sample people just checking it out to see what it is, but you sure as hell are not going to get that kind of adoption rate with anything beyond your early adopters.

Bad/unknown ROI: Currently no system can measure the ROI accurately or the companies that can just are not reporting it. If it was good, you’d see it on their front page. My educated guess: it’s not great.

Low/no integration: Mobile is another channel. I believe you should try to tackle many channels with your loyalty strategy, but don’t expect the functionality to do anything cool on your POS without hiring a dedicated development partners team to code something crazy up. Expect discounts in your system to be crude, and tacking the result to be disjoint.

All this being said, I do believe that mobile loyalty will eventually become something that everyone should look at in the future.

So when will mobile loyalty become something that retailers should implement?

The answer is when POS goes mobile. When we can accept mobile payments in-store then that link between the brick and mortar world and the online world will be together at last- a relationship that has been awkward for years now.

Square is working on some cool stuff, so is Google Commerce and so is PayPal Here. Watch these guys’ initiatives closely if you want to take your loyalty strategy to mobile. We certainly will be watching these companies in anticipation as well, but for now, don’t waste your time with mobile loyalty.

Respond promptly, respond always.

Tumblr_lxejqgnu5z1r9fqgho1_400

Quick responses say you care. They move the business along faster. They show you are serious and they can mean the difference between winning or losing. 

Bob Schwartz, President of Magento (recently acquired by PayPal), Dave Fedy from McCarter Grespan and John Jessup at Cloud Conversion are all awesome leaders that were partially my inspiration to think this way. 

If you can’t give an answer back to the person who messaged you, just reply “I’m sorry, I can’t give you the answer you’re looking for” or direct them to the right person, but at least you responded promptly and you are not ignoring them. We are always connected to the internet and it takes no commitment to say that you received someone’s e-mail. 

I go through about 100+ quick-question e-mails per day (+ many more other emails) and it only takes 1-5 min of my time to answer most of them. And if you ever get to a point whereyou’re too busy to answer everything, just get an assistant to help out.

 

Making Magento load a custom database depending on domain

We needed to make Magento to run a different database depending on the subdomain specified. Here’s how we did it VERY basically. doing so allows you to have separate Magento databases dynamically loaded depending on route. This also makes scaling a lot easier, and usage of systems like beanstalk from Amazon or PHP fog possible.

Magento_multidb

Keep in mind the following things:

  1. This is not a secure method mentioned below. You should have different passwords for each DB. doing so however will require you to store somewhere the passwords to access.
  2. This was tested on Magento 1.6 CE and 1.11 EE in a unix environment.
  3. This method assumes you don’t store any custom data in the config.xml. You should make your XMLs read-only to ensure this. 
  4. You should spend time with your own environment, so I’m not too specific in these instructions. 
  5. These require some core changes. If anyone has any suggestions on how to do it without the core changes, be my guest and comment below.

The Steps

Step 1: Edit the index.php. Somewhere before loading Magento, pull the subdomain using your favourite method. We used $_SERVER[‘SERVER_NAME’]. Set this to $subdomain.

Step 2: Within index.php, find Mage::run near the bottom. The last paramater allows you to specify custom directories. Make the media and var/ directories custom depending on the domain. We did something like this:

    Mage::run($mageRunCode, $mageRunType, array(
            ‘upload_dir’  => $dir.‘/media/upload’.$subdomain,
            ‘tmp_dir’     => $dir.‘/var/tmp’.$subdomain,
            ‘cache_dir’   => $dir.‘/var/cache’.$subdomain,
            ‘log_dir’     => $dir.‘/var/log’.$subdomain,
            ‘session_dir’ => $dir.‘/var/sessions/’.$subdomain,
            ‘export_dir’  => $dir.‘/var/export’.$subdomain,
    ));

 

 

Step 3: I know global variables are bad, but set global $subdomain; Now you can access it anywhere.

Step 4: Edit app/code/core/Mage/Core/Model/Config.php or move it to app/code/local/ After line 279, add something like:
     global $subdomain;
       $this->_xml->global->resources->default_setup->connection->dbname = $subdomain;
 

You may want to also add some checks here to see if the DB actually exists.

Step 5: Edit app/Mage.php and after line 689 add:
       global $subdomain;
       $localConfig->global->resources->default_setup->connection->dbname = $subdomain;
       $xml = $localConfig->global->resources->default_setup->connection->dbname;
  

Step 6:  Name each new database you create by the subdomain.

Try it out

Try it out. Assuming you’ve done everything correctly you should get Magento to load now depending on the subdomain. Definitely do your own tweaking, but I really hope this helps someone.