:::: MENU ::::

Magento – Limiting featured products on homepage

The Problem

On a recent Magento project I wanted to create featured products on the home page but limit it to display only three.  I then wanted to include a “View More” link which would take you through to the rest of the featured products.  I also wanted to be able to specify which three featured products were to appear on the home page.

The Solution

1) I created a new category (hidden from navigation) called Featured Products and added all my featured products to this category

2) I then added a new  “yes/no” attribute called “Featured on Homepage” and added it to my default set

3) I Created a new template file called “featured-home” this included all my product attributes and structure I wanted to use. I used /template/catalogue/product/list.phtml as a guide but heavily edited it to my needs.

4) At the top of the document I added the following code which would filter those products marked as “Featured on Homepage”.

<?php
 // some helpers
 $_helper = $this->helper('catalog/output');
 $storeId = Mage::app()->getStore()->getId();
 $catalog = $this->getLayout()->createBlock('catalog/product_list')->setStoreId($storeId);
// get all products that are marked as featured
 $collection = Mage::getModel('catalog/product')->getCollection();
 $collection->addAttributeToSelect('featured');
 $collection->addFieldToFilter(array(
 array('attribute' => 'featured', 'eq' => true),
 ));
// if no products are currently featured, display some text
 if (!$collection->count()) :
 ?>
<p class="note-msg"><?php echo $this->__('There are no featured products at the moment.') ?></p>
<?php else : ?>

5) I edited my loop (that loops through my products) to read

<?php
   $i=0; foreach ($collection as $_product) :
   $_product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($_product->getId());
   if ($i > 2) break;
 ?>

This limits the loop to display just 3 products.

6) I then added :

<?php $i++; ?>

Just before the end of my else statement. 

7) To display my products on my home page I went to CMS->PAGES->HOME inside Magento and added the following block into the design tab.
<reference name="content">
 <block type="core/template" name="home-featured" template="catalog/product/featured-home.phtml"/>
 </reference>

8) I could then add a link through to my featured products category from my featured-home.phtml so visitors can now see all the latest products.

Job done!


100 Mile Charity Bike Ride

I had a great idea a few months ago. I have always enjoyed cycling and although I have never really taken it particularly seriously the challenge of riding 100 miles has always been something I have been keen to achieve, so with a couple of like minded friends I signed up for the Cambridge 100 bike ride run by Bike Events on the 27th April 2014.

Less than two weeks now until the ride Its suddenly dawned on me – 100 miles is a ridiculously long way! Realistically we hope to average above 15MPH which would still mean 6 or 7 hours sat on a saddle.  Even if I wasn’t having to peddle that is a very long time to be perched on an saddle of a bike which, less face it, is not particularly renowned for its luxury and comfort.

Surely you have been doing some training though? – I hear you cry. Well yes, of course I have – well, sort of. I started a few months back searching for training plans for building up to a 100 mile ride. I was determined to be as prepared for this ride as I could be. I didn’t want to turn up and cough, wheeze and splutter my way around every single mile after all, I wanted to, as far as was possible, enjoy this ride. Most of the plans I found were based on 8  week courses, fairly intensive schedules for people who were reasonably fit ( I felt I qualified in this category).  But being 12 weeks away from the ride and fairly busy with work and other commitments, I didn’t actually start doing any real training until a couple of weeks ago, just 4 weeks until the ride.

So now the panic is setting in and I am trying to get out on the bike whenever I can. I am sure my training is doing some good but I do feel as though I am playing catch up (any ambitions of carefully following a methodical 8 week plan have been long since thrown out of the window).

Last weekend I did my longest ride to date – a 70 mile slog around Bedfordshire villages and boy, it was tough. Everything started well, I swallowed up the first 40 miles like they were never there but after the 50 mile mark my legs were tired and I was ready to call it a day. At 60 miles a bit of cramp kicked in and the final 5 miles were shear agony.  I managed to average what I thought was a respectable 15.9MPH (especially on a blustery day).

So this is set up to be quite a challenge come April 27th. I am riding for Prostate Cancer research so if you would like to sponsor me for this ride then please head over to my Just Giving Page. 

 


The New Big book of Everything for (Bigger) Boys

When I was a kid I had a book called “The Big Book of Everything for Boys”.  (At least that is what I think it was called although I know longer have it and can’t find it online. )

scouts

It was a great book – a kind of ultimate manual for being a boy. It covered everything for sport and games to camping, how to make a bow and arrow or build a model plane from balsa wood! It covered dinosaurs to test cricket and everything in between. Reading it you felt that what you were reading was genuinely making you a better, more complete boy!

Although perhaps I haven’t realised it, I think that my life has  been missing something since I out grew that book and moved on from whittling sticks and making dens to adult life – That is until now!

I have found the big book for men! Although the book is a website and  is called “The Art of Manliness” ( http://www.artofmanliness.com) . This site is brilliant! It’s basically a site that is full of essential articles teaching skills and passing on knowledge that every man “should” know but that modern living and a trendy society has robbed us of. For example picking the right knot for your tie depending on the collar of your shirt, how to plan a family meeting and how to defend a straight stab.

I can honestly say I don’t think I have been genuinely this delighted with a website for a long long time! Just like my big boys book years ago, I think this website is going to be my go-to resource for all things manly!


What I have learned from running a web design business

To be perfectly honest – there are times where I get home from work and wonder why on earth I run a web design company. On those days when everything seems to go wrong, customers are being awkward, your mail server has been down all afternoon and everybody seems want everything all at once – and yet, there are days when I love my job – I am working on an exciting project, clients are grateful for your hard work and you get the feeling you might be actually making a difference to the world. The key is to make sure you have more of these days than the former. A

So how can I keep the blood pressure low and making sure I enjoy my work? Well I have identified three key aspects that over time I have increasingly found to be vital to the health and well being of both my self and my business.  I wish I had learn’t some of this stuff years ago!

These aren’t just exclusive to web design companies, but I think that any business owners or self employed person would find these tips useful.

 

 1) Cashflow

Cash flow is the life blood of any business whether you are small or multi national. With long term projects managing cash-flow has proven to be challenging. To some degree we have managed it by taking payments at different stages of projects, but it hasn’t completely solved the issue and different stages of the project can still be held up waiting on content from clients or other issues. Managing schedules and milestones with you clients before hand can be beneficial so long as both parties actually stick with them!

 

 2) Choose your clients and work

In the early days I would have pretty much taken on any job so long as we got paid for it but I soon realised that this was a recipe for disaster. There are such things as bad clients and bad jobs. Some clients will just want far too much for what they are willing to pay and some jobs are destined to be full of problems from the start. My advice is to trust your instinct and don’t fall into the trap of thinking “well its money and it’s better than nothing”.

Its a good idea decide on the kind of work you would like to do. Are you looking at doing local work, or further afield? Are you primarily serving start ups or larger companies? We primarily are a web design company serving medium/larger companies and because we are a Bedford web design company we are always looking at serving companies locally in and around Bedfordshire.  This is where our focus is.

 

3) Be proud of what you do

Being proud of what you do is essential for enjoying any job, whether you work for yourself or someone else. For me, being proud of what I do is also linked to choosing clients and what work we do. I want to work on good projects, projects that allow me to be creative, to provide solid solutions to genuine problems and to give the client a great product.  In my early years of running the business I would have probably followed the mantra that the customer was always right, but these days I am beginning to realise that is not true. A client is hiring us as professionals as we know (or at least should do) what is best for the job. The trouble with the creative industry is that everyone seems to have an opinion. You wouldn’t tell a plumber the best way to install a new boiler, but lots of people seem to think they know the best way to lay out a home page correctly.

The key thing I have learnt from this is to push back on some of these comments/requests with reasons why we believe it should be different. Explaining the reason can often help the client to understand that designers lay things out the way they do for a reason – its not random! In the past,  I have worked on too many projects where the client has made changes to the original design that have broken the visual harmony of the site and I am no longer as proud of the job as I once was!

Pushing back on design decisions doesn’t mean I don’t like feedback, sometimes clients make very valid points and we can improve on what we have done because of them, but deciding that we should add two more fonts and use a new colour, (because that colour is their favourite) might need pushing back on from time to time.


David Suchet records reading the entire Bible

Absolutely delighted to see this clip on YouTube. One of my favourite actors undertaking a mammoth task of recording the entire bible. I don’t think you could have suggested a better voice for it!


Pages:123