:::: MENU ::::
Monthly Archives: April 2014

Magento – REATIVE AJAX Add to Cart – Changing notice text and colours

I have used to REATIVE AJAX add to cart addon on a couple of sites but the first thing I always want to do is change the background colour of the pop up notifications to match the style of my site.Finding where to edit this isn’t obvious to start with however the file you are looking for is called growler.js. It can be found in /skin/frontend/base/default/ajaxcart.  Scroll down to line 154 and you will see where the background colours are set.

 


Magento – Missing “Header” & “Footer” tabs from Config->Design

If you are wanting to make changes to the header or footer sections in Magento (for example, change the copyright notice or change the logo) then the place to do this is in

Configuration->General->Design

and then under the “Header” and “Footer” tabs.  However if you are using a custom theme you might not have these options available to you.

To fix this you need to log into your ftp client and copy the file “system.xml from

app->code->core->Mage->Page->etc

and save a copy into

app->code->local->Mage->Page->etc

Now when you look back into Configuration->Design you should see a header and footer option.

This had me puzzled for a little while and I was wondering if it had just changed for Magento 1.8 but this simple fixed solved the problem.


Magento – remove “Be the first to review this product”

Problem

I want to remove the link on the product page that is called “Be the first to review this product” but I don’t want to remove reviews formt he products. (You can still review the product via the review tab)

Solution

Go to  [[yourTheme]]/template/catalog/product/view.phtml 

Comment out or remove the following line (around line 60)

<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>

 


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.