1. Home
  2. Prices
  3. Guided Tour
  4. New Shop
  5. Shop Review
  6. Ecommerce Marketing
  7. Ecommerce TV
  8. Magento Developers
  9. Portfolio
  10. Blog
  11. Contact

Author Profile

Author Archive

Coming Soon: HTTPS Checker

Posted on: 8th Sep 2010 By: Robert Kent No Comments

We’ve all had that frustrating time in our lives when we add an SSL certificate to our websites and realise that the SSL certificate is invalid. The error states it is because “Connection Partially Encrypted”. What happens is you have spent all that money on encrypting your website, only to lose your nice blue/green bar and unbroken padlock.

The most common cause for this scenario is image paths.

Believe it or not but images that are statically linked (http://mydomain.com/images/myimage.jpg) most often are the culprits. The reason is that the switch to https cannot locally source this image – it needs to break the encryption to get the image from an unencrypted location.

To resolve this we use a fluid path or a root path such as “../images/myimage.jpg” or “/image/myimage.jpg”.

Here at Ecommerce Web Design, we are looking into creating a tool that will let you check for this error as it can be very frustrating searching through your code on all your web pages looking for statically linked images.

For those of you interested please post what you would like this checker to include in the comment form below. It really is in its beta stages at the moment but we will be rolling it out within the next week or so simply looking for image tags with static links. We will later search javascript files and css files for the same problem.

Thanks for visiting our Ecommerce Blog – home of the Magento Fox!

Categories: Ecommerce Security Tags:

Create a Tax Display Switcher

Posted on: 1st Sep 2010 By: Robert Kent 1 Comment

Here at E-commerce web design we do our best to find useful implementations of certain features that we believe an Ecommerce website design should contain. I have recently come across an issue that I thought Magento would have solved by now – in fact it was something that I thought Magento would have in-built anyway…but alas a few hours of searching later and I can’t find what I need.

The functionality that I was looking for was a TAX/VAT display switcher – much like the switcher that you have for stores and currencies.

What magento allows you to do by default is to allow you to choose in the admin section whether you would like the customers to see prices including VAT, excluding VAT or showing both.

As I couldn’t find this functionality I decided to make it up – However this is not the proper way to do it – just a temporary solution that is not suitable for a live store.

Firstly let me explain my implementation, I am using text links with a parameter to pass the chosen display style to my script. This does not however mean that you cannot use a drop down list. I’ll simply let you know what you need to change in order for this to work as a drop down.

Right then – Step one: – Create your changevat.php file and add it to your root layer.

Inside your changevat.php simply paste the following (if you are using a drop down with a form then replace all instances of $_GET with $_POST).

<?php

require_once 'app/Mage.php';
Mage::app('default');

if(isset($_GET['vat']) && isset($_GET['page'])){

$vat = $_GET['vat'];
$page = $_GET['page'];

if($vat == "excl"){
$display = 1;
} else if($vat == "inc"){
$display = 2;
} else if($vat == "both"){
$display = 3;
} else {
$error = "yes";
}

if($error != "yes"){
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$connection->query("UPDATE core_config_data SET value='$display' WHERE path='tax/display/type'");
header("Location: $page");
} else {
header("Location: $page");
}
}

?>

As you will see there is not that much protection in this script apart from the fact that it will only take those 3 values (hence the long-handed way of writing it). If you wanted to add some more security you can do but for our purposes its good enough.

What you will see in the script is the connection to the database – the script edits the database and replaces the value with whatever is selected.

Excluding Tax = 1

Including Tax = 2

Show Both = 3

It then throws the user back to the page they were originally on with the change in tax display.

To initiate this script you simply need to either do the $_GET parameter version as I did or use a form and change all the $_GET to $_POST in the changevat,php file.

Here is the $_GET version:

Show VAT <a href="/changevat.php?vat=inc&&page=/">Inc</a> / <a href="/changevat.php?vat=excl&&page=/">Excl</a> / <a href="/changevat.php?vat=both&&page=/">Both</a>

Here is the $_POST:

<form action="/changevat.php" method="post">
<select name="vat">
<option value="excl">Excluding VAT</option>
<option value="excl">Including VAT</option>
<option value="excl">Both</option>
</select>
<input type="hidden" name="page" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
<input type="submit" value="Change Display" />
</form>

Now this functionality is very limited as it sets the database rather than a session cookie for the user.

What I suggest is using this as a base and then tying it in with session variables rather than database values. This is what I’m working on currently but if anyone has any suggestions please let me know!

Thanks for visiting our magento blog – home of the magento fox!

Any questions please leave a comment!

Categories: Magento Tags: ,

Packt OpenSource Awards 2010

Posted on: 27th Aug 2010 By: Robert Kent 1 Comment

Here at e-commerce web design, we read a lot of Packt publications – you may have even seen a few of our reviews of them recently. Well books aside, Packt is a very passionate opensource supporter and they are demonstrating this with their new award ceremony – for opensource software.

Official Press Release:

Packt launch fifth annual Open Source Awards

Birmingham, UK. 9th August 2010

The 2010 Open Source Awards was launched today by Packt, inviting people to visit www.PacktPub.com and submit nominations for their favorite Open Source project. Now in its fifth year, the Award has been adapted from the established Open Source CMS Award with the wider aim of encouraging, supporting, recognizing and rewarding all Open Source projects.
WordPress won the 2009 Open Source Content Management System (CMS) Award in what was a very close contest with MODx and SilverStripe. While MODx was the first runner up, SilverStripe, a Most Promising CMS Award winner in 2008, made its way to the second runner up position in its first year in the Open Source CMS Award final.
The 2010 Award will feature a prize fund of $24,000 with several new categories introduced. While the Open Source CMS Award category will continue to recognize the best content management system, Packt is introducing categories for the Most Promising Open Source Project, Open Source E-Commerce Applications, Open Source JavaScript Libraries and Open Source Graphics Software. CMSes that won the Overall CMS Award in previous years will continue to compete against one another in the Hall of Fame CMS category.
These new categories will ensure that the Open Source Awards is the ultimate platform to recognise excellence within the community while supporting projects both new and old. “We believe that the adaption of the Award and the new categories will provide a new level of accessibility, with the Award recognizing a wider range of Open Source projects; both previous winners while at the same time, encouraging new projects” said Julian Copes, organizer of this year’s Awards.
Packt has opened up nominations for people to submit their favorite Open Source projects for each category at www.PacktPub.com/open-source-awards-home . The top five in each category will go through to the final, which begins in the last week of September. For more information on the categories, please visit Packt’s website www.PacktPub.com/blog/packt’s-2010-open-source-awards-announcement
Contacts
Julian Copes
PR Executive, Packt Publishing
julianc@packtpub.com | www.PacktPub.com

About Packt
Packt is a modern, unique publishing company with a focus on producing cutting-edge books for communities of developers, administrators, and newbies alike.
Packt’s books and publications share the experiences of fellow IT professionals in adapting and customizing today’s systems, applications, and frameworks. Their solutions-based books give readers the knowledge and power to customize the software and technologies they’re using to get the job done.
For more information, please visit www.PacktPub.com

Categories: News Tags:

Magento Meta Tags and Titles

Posted on: 23rd Aug 2010 By: Robert Kent No Comments

This is an update to all the magento meta data posts we’ve had so far. This will allow you to configure meta data and custom page titles.

What the following script will do is:

  • Check for the default meta info and remove tags
  • Ability to add meta info to pages individually
  • Keep old meta data if its not in the list of pages and has not got the default meta info

This technique is especially useful as it allows you to add meta information to pages where you may not be able to do so in the code or in the CMS. Pages such as the checkout and the contact pages. I have included these two into the example below.

What you need to do is edit your head.phtml file and paste the following above everything.

<?php
$page = $_SERVER['REQUEST_URI'];

//add your pages into this array
$pagearray = array("shop/contacts","shop/checkout/cart");

foreach($pagearray as $pages){
$test = strpos($page,$pages);
if($test !== false){
$pageres = $pages;
}
}
if($pageres){
switch($pageres):
// case 1 here
case "shop/contacts":
$title = "Contact";
$keywords = "contact, me, at, my, store";
$description = "Contact me at my store.";
break;
// case 2 here
case "shop/checkout/cart":
$title = "Checkout - My Test Store";
$keywords = "Checkout, Buy, My, Things";
$description = "Buy my things at my test store.";
break;

endswitch;
} else {
// if not in the array do the normal
$keywords = $this->getKeywords();
$description = $this->getDescription();
$title = $this->getTitle();
}

//check for default - if default remove the meta info

if($keywords == "default"){
$keyw = false;
} else {
$keyw = true;
}
if($description == "default"){
$desc = false;
} else {
$desc = true;
}

?>

The above is quite simple and will let you add pages to an array and then add them to the case statement in order to specify the meta information.

Next you will simply need to add some conditional braces around your usual meta tags and change what is echo’d.

<title><?php echo $title ?></title>
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<?php if($desc){ ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if($keyw){ ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>

Again it’s these simply little tricks that can lead to better Search Engine rankings – the less duplicate data – the better!

Thanks for visiting the magento blog at ecommerce website design home of the magento fox!

Categories: Magento Tips Tags: , , ,

Get Lowest Tier Price

Posted on: 18th Aug 2010 By: Robert Kent 6 Comments

A few weeks ago we were scratching our heads in confusion on how to get the lowest tier-price from magento. If you take a look at your catalog>product>view>tierprices.phtml you will see why – why does such a complicated section of code even exist?

Anyway after a few failed attempts we were contacted this morning by Christiaan who asked us this question a few weeks ago on the magento forums. We took this as a challenge and set to work this very morning sorting it out.

After a few black coffees we finally figured it out…or at least got rid of the rubbish that was concealing it. We now have a little method to bring back the lowest tier price on a magento product view page!

Here is how you do it:
1. Create a file in your product>view folder called getlowest.phtml
Copy & paste the following into it:

<?php
/**
* @E-Commercewebdesign.co.uk
*/
$_product = $this->getProduct();
$_tierPrices = $this->getTierPrices();
$_finalPriceInclTax = $this->helper('tax')->getPrice($_product, $_product->getFinalPrice(), true);

$_weeeTaxAmount = Mage::helper('weee')->getAmountForDisplay($_product);
if (Mage::helper('weee')->typeOfDisplay($_product, array(1,2,4))) {
$_weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($_product);
}

?>
<?php if (count($_tierPrices) > 0): ?>
<?php if ($this->getInGrouped()): ?>
<?php $_tierPrices = $this->getTierPrices($_product); ?>
<?php endif; ?>
<?php Mage::helper('weee')->processTierPrices($_product, $_tierPrices); ?>
<?php $i = 0; ?>
<?php $_tierPrices = array_reverse($_tierPrices); ?>
<?php foreach ($_tierPrices as $_price): ?>
<?php if($i==0){ ?>
<p style="font-weight:bold; font-size: 1em;">After tier pricing the lowest price you can have a Cowboy Hat is...
<span style="font-size:150%; text-decoration:underline;">
<?php echo $_price['formated_price']; ?>
</span>
<p>
<?php $i++; ?>
<?php } ?>
<?php endforeach ?>
<?php endif;?>

As you can see you can edit some words above to output whatever you like around this lowest price – could be on top of an image or simply surrounded by text like above.

2. Open your themes catalog.xml and paste in the following code:

<block type="catalog/product_view" name="getlowest" as="getlowest" template="catalog/product/view/getlowest.phtml" />

3. Call this function on your product>view.phtml

<?php echo $this->getChildHtml('getlowest') ?>

There you have it! This code will output the lowest price of your tier prices dynamically – and will also not show anything if tier-prices are not activated for the product.

Thanks for visiting our magento blog at ecommerce website design – home of the (newly styled!) magneto fox. Take Care.