Bridesmaid Badges and Cards

Bridesmaid Pink BadgeBridesmaid White Badge
Bridesmaid cardBridesmaid card

I have a new range of hen night/wedding badges and cards. My etsy shop is growing with new additions of hen party badges for bridesmaids. The new badges for Bridesmaids come in pink and white to match the team bride badges that are currently available. These badges also come on cards for the bride to give out as either a thank you or to ask for her be her bridesmaid.

Etsy Shop

Spring/Summer Hen Party Badges

Hen party badges in pale pinkHen party badges in duck egg blue
Bride to be badge in duck egg blueBride to be badge in pale pink

Shocking pink tacky hen party accessories don’t really go with a stylish hens afternoon in London or your local town. My new range of Spring/Summer hen party badges are designed for sunny hen weekends away, classy afternoon teas and sophisticated activities. They are available in pale pink and duck egg blue. So whether you are organising a vintage hen celebration or a relaxing hens weekend in the sun. Adorn your fellow ladies with these beautiful pastel coloured badges.

They are available to buy in my etsy shop along with other items from my hen night range: https://www.etsy.com/uk/shop/MakeLoops

Customising Magento Transactional Emails

As part of a recent project customising Magento emails I discovered a few useful bits and pieces that make creating custom transactional emails a little easier.

Static Blocks

I am not sure why I hadn’t thought of this but you can use static blocks in your emails in the same way as you would a CMS page. This is great because it allows you to make blocks that you can include in every email such as:
- Header
- Footer
- Promotional Content Area
- Social Links
etc and centrally manage it or allow the client to manage it rather than editing every email individually. The code you need is as follows:

{{block type="cms/block" block_id="email-header" template="cms/content.phtml"}}

You can place this code either in the emails you have setup within “system/transactional emails” or within your site directory “app/locale/en-us/template/email/email-file-name.html” with en-us being whatever locale you happen to be using.

Another cool thing about this is that you can easily upload images and include them within the static block admin screen rather than including the images in your theme. This makes it easy for clients to refresh certain sections themselves or write promotional content.

Referencing Store Information

Magento as standard references a few of the fields in the admin to populate the email eg. Store Name. However it is useful to also know that you can reference a lot more of the store information. For example if you are creating an email footer to state the stores name, address, telephone number, vat number etc you can pull all this information in dynamically so that your emails are kept up to date. The code required is:

Copyright: {{config path='design/footer/copyright'}}
Address: {{config path='general/store_information/address'}}
VAT No: {{config path='general/store_information/merchant_vat_number'}}
Telephone Number: {{config path='general/store_information/phone'}}
Email: {{config path='trans_email/ident_support/email'}}

and if you require anything else the easiest way to see how the field would be called is to browse to the section in the admin and inspect the field for its “name”. You would then write the code as follows:

{{config path=’tab in admin/sub section in admin/field name’}}

Sending Mail in Xampp

I have literally spent hours trying to set up mail on my localhost so that I can send test emails from Magento, and finally its working. So I thought I would share my solution in case it saves others wasted hours too :)

Firstly I needed to download the most recent release of sendmail. This can be found here: http://glob.com.au/sendmail/. Once downloaded browse to c:/xampp/sendmail (assuming your installation is on your c:/ drive) and delete and replace with the newly downloaded files.

Then in c:/xampp/sendmail/sendmail.ini comment everything out but the following lines and modify to be your own email address and password.

smtp_server=smtp.gmail.com
smtp_port=25
error_logfile=error.log
debug_logfile=debug.log
auth_username=youremail@gmail.com
auth_password=yourgmailpassword
force_sender=youremail@gmail.com

Then in c:/xampp/php/php.ini search for “mail” and comment out everything but sendmail_path and mail.add_x_header lines.

; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25
 
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
 
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
 
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
 
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off
 
; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"

Then restart Apache and it should work!!
To test you can place this script in your htdocs change the $to field and browse to it.

<?php
$to = "youremail@email.com";
$subject = "Test Email";
$message = "Testing mail is working";
 
if(mail($to,$subject,$message)){
echo "sent";
}else{
echo "failed";
}?>

Thank you to http://stackoverflow.com/questions/4948687/xampp-sendmail-using-gmail-account for pointing me in the right direction :)

Blackcurrant Cake

blackcurrants2blackcurrants1

Lots and lots of blackcurrants this year! So what better way to use them than in a cake :)
Recipe here: http://theenglishkitchen.blogspot.co.uk/2011/07/black-currant-drizzle-cake.html

Expanding Left Hand Category Menu in Magento

The below code will create a menu that shows the siblings of an active category as well as showing its grandchildren. This will allow a user to jump between categories easily. Active classes are provided and the parent category is used to create a title. Again I am not a PHP developer so any bug fixes or tips are welcome.

Modify app/design/frontend/YOUR THEME/default/template/catalog/navigation/left.phtml to contain:

<?php $helper = $this->helper('catalog/category') ?>
<?php $categories = $this->getStoreCategories() ?>
<?php $categoriescount = $this->getStoreCategories()->count();?>
 
<div class="block block-layered-nav">
<?php 
//If there are any root categories
if ($categoriescount > 0): 
	foreach($categories as $category): 
		//Get sub categories 
		$subcategories = $category->getChildren();
		//Number of sub categories
		$subcategoriescount = $category->getChildren()->count(); 
		// Display active root category as block title only if there are sub categories
		if ($this->isCategoryActive($category) && $subcategoriescount > 0): 
?>
		<div class="block-title">
		<a href="<?php echo $helper->getCategoryUrl($category) ?>">
			<strong><span><?php echo $this->escapeHtml($category->getName()) ?></span></strong>
		</a>
		</div>
		<div class="block-content">
			<ul class="level1">
				<?php 
				//Build sub category menu
				foreach($subcategories as $subcategory): 
					//Get sub sub categories
					$subsubcategories = $subcategory->getChildren();
					//Number of sub sub categories
					$subsubcategoriescount = $subcategory->getChildren()->count();?>
 
					<li class="level1<?php if($subsubcategoriescount > 0): ?> parent<?php endif; ?>">
					<a href="<?php echo $helper->getCategoryUrl($subcategory) ?>" <?php if ($this->isCategoryActive($subcategory)): ?>class="active"<?php endif; ?>><?php echo $this->escapeHtml(trim($subcategory->getName(), '- ')) ?></a>
					<?php 
					//Display sub sub categories if sub category is active
					if ($this->isCategoryActive($subcategory) && $subsubcategoriescount > 0): 
					?>
						<ul class="level2">
							<?php foreach($subsubcategories as $subsubcategory): ?>
							<li class="level2">
								<a href="<?php echo $helper->getCategoryUrl($subsubcategory) ?>" <?php if ($this->isCategoryActive($subsubcategory)): ?>class="active"<?php endif; ?>><?php echo $this->escapeHtml(trim($subsubcategory->getName(), '- ')) ?></a>
							</li>
							<?php endforeach; ?>
						</ul>
					<?php endif; ?>
				</li>
				<?php endforeach; ?>
			</ul>
		</div>
		<?php endif; ?>
	<?php endforeach; ?>
<?php endif; ?>
</div>

See below for a quick wirefame mockup of how it should look:
nav

Displaying Sub Categories on Category Landing Page in Magento

The below code snippet/instructions will display images and links for each sub category on a category landing page. Feel free to use this code as a reference, however not being a PHP developer there may well be errors so I welcome any tips or improvements!

1. Create a new file called “categoryblocks.phtml” in app/design/frontend/YOUR THEME/default/template/catalog/navigation

2. Paste the following code into it and save:

<?php 
//If there are sub categories
$categories = $this->getCurrentChildCategories();
$categoriescount = $this->getCurrentChildCategories()->count();
if ($categoriescount > 0): 
?>
<div class="sub-category-container">	
	<?php 
	//Loop through categories
	foreach ($categories as $category):
	?>
	<div class="sub-category">
		<a href="<?php echo $this->getCategoryUrl($category)?>" class="cat-image">
		<?php 
		// If there is a thumbnail set for the category - Display it
		if($imgUrl = Mage::getModel('catalog/category')->load($category->getId())->getThumbnail()):?>
		<img src="<?php echo $this->getBaseUrl()."media/catalog/category/".$imgUrl ?>" width="220" height="110" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
		<?php endif; ?>
		</a>
		<div class="inner-sub-category">
			<a href="<?php echo $this->getCategoryUrl($category)?>" class="sub-link"><?php echo $category->getName()?></a>
			<a href="<?php echo $this->getCategoryUrl($category)?>" class="btn"><span>View All</span></a>
		</div>
	</div>
 
	<?php endforeach; ?>
</div>
<?php else:?>
<p>No Sub Categories</p>
<?php endif; ?>

3.Create a static block in Magento Admin called “categorylanding”

4.Place the following code snippet into the static block and save.

{{block type="catalog/navigation" template="catalog/navigation/categoryblocks.phtml"}}

5. Go to Manage Categories in Magento Admin and select “categorylanding” as a static block for the categories you wish to display sub categories for.

This should generate something like this:

category-blocks

You can style however you want using the classes provided or by editing to suit your requirements.

Hand Painted Drawer Knobs

number-knobnumber-knob2
letterknobsnumberknobs

I had been looking for matching number and letter knobs for ages. The only ones I could seem to find either didn’t go up to a high enough number to cover all my drawers or a high enough letter. So I took matters into my own hands and made my own. It worked out cheaper too! I bought some plain ceramic knobs off ebay and a ceramic painter pen. This is the final result.

12345...

Warning: Invalid argument supplied for foreach() in /homepages/26/d613393971/htdocs/sites/hannahstothard.co.uk/wp-content/plugins/kebo-twitter-feed/inc/get_tweets.php on line 255