Magento 1.8 Upgrade

Upgrade Magento themes from 1.7 to 1.8

Before you process to any upgrade, please take due backup of all your source files and database.

Here is the detailed Magento 1.8 upgrade guide

Magento 1.8 Upgrade Guide

If you are using our Magento 1.7 themes for your site, there are 2 ways to upgrade your site to Magento 1.8. Choose the method that suits you best.

I have customized the theme a lot

Due to changes in folder structure of Magento 1.8 in comparision with Magento 1.7, we have replaced files and codes from numbers of theme files. The best way is to do manual upgrade and customization.

Manual Upgrade Guide

I did not customize anything

Very simple, what you have to do is download our Magento 1.8 themes and install to your site. No manual upgrade is required.

Download Themes

Open your site root folder, we are going to replace codes for a number of files.

1. Edit the file "radio.phtml"

Open file radio.phtml in:

\app\design\frontend\your_package\your_theme\template\bundle\catalog\product\view\type\bundle\option\

1.1 Add code

After the line

<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>

Add

<?php $tierPriceHtml = ''; ?>

After the line

<?php foreach ($_selections as $_selection): ?>

Add

<?php if ($_selection->getSelectionCanChangeQty() && $this->_isSelected($_selection)): ?>
                <?php $tierPriceHtml = $this->getTierPriceHtml($_selection); ?>
<?php endif; ?>

Before code block

<span class="qty-holder">
        <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
    </span>
  

Add

<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?></span>

1.2 Replace code

Find the following code block:

<?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
        <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" />

Replace with:

<?php echo $this->getSelectionTitlePrice($_selections[0]); ?>
            <?php if ($_selections[0]->getSelectionCanChangeQty()): ?>
                <?php $tierPriceHtml = $this->getTierPriceHtml($_selections[0]); ?>
        <?php endif; ?>
        <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" />

2. Edit file "select.phtml"

Open file select.phtml in:

app\design\frontend\your_package\your_themet\template\bundle\catalog\product\view\type\bundle\option\

After the line

<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>

Add

<?php $tierPriceHtml = ''; ?>

After the line

<?php echo $this->getSelectionTitlePrice($_selections[0]); ?>

Add

<?php if ($_selections[0]->getSelectionCanChangeQty()): ?>
            <?php $tierPriceHtml = $this->getTierPriceHtml($_selections[0]); ?>
        <?php endif; ?>

After the line

<?php foreach ($_selections as $_selection): ?>

Add

<?php if ($_selection->getSelectionCanChangeQty() && $this->_isSelected($_selection)): ?>
                <?php $tierPriceHtml = $this->getTierPriceHtml($_selection); ?>
            <?php endif; ?>

After the code block

 <span class="qty-holder">
        <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?>&nbsp;</label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
    </span>

Add

<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?></span>

3. Edit "bundle.phtml" file

Open file bundle.phtml in:

app\design\frontend\your_package\your_themet\template\bundle\catalog\product\view\type\bundle\option\

Find the following code block

<?php if ($_product->isAvailable()): ?>
    <p class="availability in-stock"><?php echo $this->helper('catalog')->__('Availability:') ?> <span><?php echo $this->helper('catalog')->__('In stock') ?></span></p>
<?php else: ?>
    <p class="availability out-of-stock"><?php echo $this->helper('catalog')->__('Availability:') ?> <span><?php echo $this->helper('catalog')->__('Out of stock') ?></span></p>

Replace with:

<?php if ($this->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable()): ?>
        <p class="availability in-stock"><?php echo $this->helper('catalog')->__('Availability:') ?> <span><?php echo $this->helper('catalog')->__('In stock') ?></span></p>
    <?php else: ?>
        <p class="availability out-of-stock"><?php echo $this->helper('catalog')->__('Availability:') ?> <span><?php echo $this->helper('catalog')->__('Out of stock') ?></span></p>
    <?php endif; ?>

4. Edit "default.phtml" file

Open file default.phtml in \app\design\frontend\your_package\your_theme\template\catalog\product\view\type\

Find the following code block

<?php if ($_product->isAvailable()): ?>
    <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
    <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>

Replace with:

<?php if ($this->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable()): ?>
        <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
    <?php else: ?>
        <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
    <?php endif; ?>

5. Edit "grouped.phtml" file

Open file grouped.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\view\type\

Find the following code block

<?php if ($_product->isAvailable() && $_hasAssociatedProducts): ?>
    <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
    <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>

Replace with:

<?php if ($this->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable() && $_hasAssociatedProducts): ?>
        <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
    <?php else: ?>
        <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
    <?php endif; ?>

6. Edit "tierprices.phtml" file

Open file tierprices.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\view\

Find the following code block

<?php foreach ($_tierPrices as $_index => $_price): ?>
        <li>

Replace with:

<?php foreach ($_tierPrices as $_index => $_price): ?>
        <li class="tier-price tier-<?php echo $_index; ?>">

7. Edit "new_default_list.phtml" file

Open file new_default_list.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\widget\new\column\

After the line

<div class="block-content">

Add

<?php echo $this->getPagerHtml() ?>

8. Edit "new_images_list.phtml" file

Open file new_images_list.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\widget\new\column\

After the line

<div class="block-content">

Add

<?php echo $this->getPagerHtml() ?>

9. Edit "new_names_list.phtml" file

Open file new_names_list.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\widget\new\column\

After the line

<div class="block-content">

Add

<?php echo $this->getPagerHtml() ?>

10. Edit "new_grid.phtml" file

Open file new_grid.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\widget\new\content\

After the line

<div class="block-content">

Add

<?php echo $this->getPagerHtml() ?>

11. Edit "new_list.phtml" file

Open file new_list.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product\widget\new\content\

After the line

<div class="block-content">

Add

<?php echo $this->getPagerHtml() ?>

12. Replace file "price_msrp_item.phtml"

Copy file price_msrp_item.phtml in:

app\design\ frontend \default \ default \ template\catalog\product\

Paste and replace the existing file in:

app\design\frontend\your_package\your_theme\template\catalog\product\

13. Replace file "price.phtml"

Copy file price.phtml in:

app\design\frontend\base\default\template\catalog\product

Paste and replace the existing file in:

app\design\frontend\your_package\your_theme\template\catalog\product\

14. Edit "view.phtml" file

Open file view.phtml in:

app\design\frontend\your_package\your_theme\template\catalog\product

After the following code block

<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>

Add this code block

<?php echo $this->getBlockHtml('formkey') ?>

15. Edit "logo.phtml" file

Open file logo.phtml in:

app\design\frontend\your_package\your_theme\template\centinel\

Find the following code block

<a href="#" title="<?php echo $this->__('Verified by Visa') ?> "onclick="popWin('<?php echo $this->helper('centinel')->getVisaLearnMorePageUrl()?>', 'verifiedByVisa', 'width=815,height=600,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="/<?php echo $this->getSkinUrl('images/centinel/vbv_ltbg_71x57.gif'); ?>" alt="<?php echo $this->__('Verified by Visa') ?>" /></a>
        <a href="#" title="<?php echo $this->__('MasterCard SecureCode'); ?>" onclick="popWin('<?php echo $this->helper('centinel')->getMastercardLearnMorePageUrl()?>', 'secureCode', 'width=600,height=403,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="/<?php echo $this->getSkinUrl('images/centinel/sc_learn_62x34.gif'); ?>" alt="<?php echo $this->__('MasterCard SecureCode') ?>" /></a>

Replace with:

<a href="#" title="<?php echo $this->__('Verified by Visa') ?> " onclick="popWin('<?php echo $this->helper('centinel')->getVisaLearnMorePageUrl()?>', 'verifiedByVisa', 'width=815,height=600,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="/<?php echo $this->getSkinUrl('images/centinel/vbv_ltbg_71x57.png'); ?>" alt="<?php echo $this->__('Verified by Visa') ?>" /></a>
        <a href="#" title="<?php echo $this->__('MasterCard SecureCode'); ?>" onclick="popWin('<?php echo $this->helper('centinel')->getMastercardLearnMorePageUrl()?>', 'secureCode', 'width=600,height=403,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="/<?php echo $this->getSkinUrl('images/centinel/sc_learn_62x34.png'); ?>" alt="<?php echo $this->__('MasterCard SecureCode') ?>" /></a>

16. Edit "edit.phtml" file

Open file logo.phtml in:

app\design\frontend\your_package\your_theme\template\ customer\form

16.1 Replace code

Find the following code block

<form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate">

Replace with:

<form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate" autocomplete="off">

Find the following code block

<input type="text" name="email" id="email" value="<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />

Replace with:

<input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />

16.2 Add code

Before the line

<input type="password" title="<?php echo $this->__('Current Password') ?>" class="input-text" name="current_password" id="current_password" />

Add

<!-- This is a dummy hidden field to trick firefox from auto filling the password -->
<input type="text" class="input-text no-display" name="dummy" id="dummy" />

17. Edit "billing.phtml" file

Open file billing.phtml in:

app\design\frontend\your_package\your_theme\template checkout\multishipping

Find the following code block

<?php echo $this->htmlEscape($_method->getTitle()) ?>
<?php echo $_method->getTitle() ?>

Replace with:

<?php echo $this->escapeHtml($_method->getTitle()) ?>
<?php echo $this->escapeHtml($_method->getTitle()) ?>

18. Edit "methods.phtml" file

Open file methods.phtml in:

app\design\frontend\your_package\your_theme\template checkout\onepage\payment\

18.1 Delete code

Find the following code block and delete it

<dl class="sp-methods" id="checkout-payment-method-load">
</dl>

18.2 Add code

Before the line

<foreach …>

Add

<?php if (empty($methods)): ?>
<dt>
<?php echo $this->__('No Payment Methods') ?>
</dt>
<?php else:

19. Edit "info.phtml" file

Open file info.phtml in:

app\design\frontend\your_package\your_theme\template\checkout\onepage\review\

Find the following code block

<script type="text/javascript">
//<![CDATA[
review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
//]]>

Replace with:

<script type="text/javascript">
//<![CDATA[
i.  review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
//]]>
</script>

20. Replace file "progress.phtml"

Copy file progress.phtml in:

app\design\frontend\base\default\template\checkout\onepage\

Paste and replace the existing file in:

app\design\frontend\your_package\your_theme\template\checkout\onepage\

21. Edit "review.phtml" file

Open file review.phtml in:

app\design\frontend\your_package\your_theme\template\checkout\onepage\

Find the following code block

<div class="order-review" id="checkout-review-load">
    <?php echo $this->getChildHtml('info') ?>
</div>

Replace with:

<div class="order-review" id="checkout-review-load">
    <!-- Content loaded dynamically -->
</div>

22. Edit "shipping_method.phtml" file

Open file shipping_method.phtml in:

app\design\frontend\your_package\your_theme\template\checkout\onepage\

Find the following code block and remove it

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

23. Edit "default.phtml" file

Open file default.phtml in:

app\design\frontend\your_package\your_theme\template checkout\total\

Find the following code block

<th>

Replace with:

<td>

24. Edit "default.phtml" file

Open file default.phtml in:

app\design\frontend\your_package\your_theme\template\email\order\items\order

Find the following code block

<?php echo (isset($option['print_value']) ? $option['print_value'] : nl2br($this->escapeHtml($option['value']))) ?>

Replace with:

<?php echo nl2br($option['value']) ?>

25. Edit "header.phtml" file

Open file header.phtml in:

app\design\frontend\your_package\your_theme\template\page\html\

Find the following code block

<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>

Replace with:

<p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>

26. Edit "checkmo.phtml" file

Open file checkmo.phtml in:

app\design\frontend\your_package\your_theme\template\payment\info

Find the following code block

<p><?php echo $this->getMethod()->getTitle() ?></p>

Replace with:

<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>

27. Edit "default.phtml" file

Open file default.phtml in:

app\design\frontend\your_package\your_theme\template\payment\info\

Find the following code block

<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>

Replace with:

<p><strong><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></strong></p>

28. Edit "purchaseorder.phtml" file

Open file purchaseorder.phtml in:

app\design\frontend\your_package\your_theme\template\payment\info\

Find the following code block

<p><?php echo $this->getMethod()->getTitle() ?></p>

Replace with:

<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>

29. Edit "sidebar.phtml" file

Open file sidebar.phtml in:

app\design\frontend\your_package\your_theme\template\sales\reorder\

After the line:

<form method="post" action="<?php echo $this->getFormActionUrl() ?>" id="reorder-validate-detail">

Add:

<?php echo $this->getBlockHtml('formkey'); ?>

30. Edit "send.phtml" file

Open file send.phtml in:

app\design\frontend\your_package\your_theme\template\sendfriend

Find the following code block

li_mail.innerHTML = '<p><a href="/delete_email" title="<?php echo $this->__('Remove Email') ?>" onclick="remove_recipient('+i+'); return false" class="btn-remove"><?php echo $this->__('Remove Email') ?>"<\/a><\/p>'
        li_mail.innerHTML += '<div class="field"><label for="recipients_name'+i+'" class="required"><em>*<\/em><?php echo $this->__('Name:') ?><\/label><div class="input-box"><input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name'+i+'" /><\/div>';
        li_mail.innerHTML += '<div class="field"><label for="recipients_email'+i+'" class="required"><em>*<\/em><?php echo $this->__('Email Address:') ?><\/label><div class="input-box"><input name="recipients[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipients_email'+i+'" type="text" class="input-text required-entry validate-email" /><\/div><\/div>';

Replace with

li_mail.innerHTML = '<p><a href="/delete_email" title="<?php echo $this->jsQuoteEscape($this->__('Remove Email')) ?>" onclick="remove_recipient('+i+'); return false" class="btn-remove"><?php echo $this->jsQuoteEscape($this->__('Remove Email')) ?>"<\/a><\/p>'
        li_mail.innerHTML += '<div class="field"><label for="recipients_name'+i+'" class="required"><em>*<\/em><?php echo $this->jsQuoteEscape($this->__('Name:')) ?><\/label><div class="input-box"><input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name'+i+'" /><\/div>';
        li_mail.innerHTML += '<div class="field"><label for="recipients_email'+i+'" class="required"><em>*<\/em><?php echo $this->jsQuoteEscape($this->__('Email Address:')) ?><\/label><div class="input-box"><input name="recipients[email][]" value="" title="<?php echo $this->jsQuoteEscape($this->__('Email Address')) ?>" id="recipients_email'+i+'" type="text" class="input-text required-entry validate-email" /><\/div><\/div>';

31. Edit "view.phtml" file

Open file view.phtml in:

app\design\frontend\your_package\your_theme\template\tag\customer\

After the line:

<?php if($_product->isSaleable()): ?>

Add:

<?php $params[Mage_Core_Model_Url::FORM_KEY] = Mage::getSingleton('core/session')->getFormKey() ?>
                    <?php $params['product'] = $_product->getId(); ?>

32. Edit "tax.phtml" file

Open file tax.phtml in:

app\design\frontend\your_package\your_theme\template\tax\checkout

After the line:

<?php endforeach; ?>

Add:

<?php $weees = $this->getAllWeee(); ?>
    <?php foreach ($weees as $weeeTitle => $weeeAmount): ?>
    <tr class="summary-details-<?php echo $taxIter; ?> summary-details<?php if ($isTop): echo ' summary-details-first'; endif; ?>" style="display:none;">
        <td class="a-right" style="<?php echo $_style ?>" colspan="1">
            <?php echo $this->escapeHtml($weeeTitle); ?>
            <br />
        </td>
        <td style="<?php echo $_style ?>" class="a-right" rowspan="1">
            <?php echo $this->helper('checkout')->formatPrice($weeeAmount); ?>
        </td>
    </tr>
    <?php endforeach; ?>
  

33. Edit "cart.phtml" file

Open file cart.phtml in:

app\design\frontend\your_package\your_theme\template\wishlist\item\column\

After the line:

$product = $item->getProduct();

Add:

$options = $this->getChild('customer.wishlist.item.options')
    ->setItem($item)
    ->getConfiguredOptions();

After the line:

<?php echo $this->getPriceHtml($product, empty($options));?>

Add:

<?php echo $this->getPriceHtml($product);?>

34. Edit "info.phtml" file

Open file info.phtml in:

app\design\frontend\your_package\your_theme\template\wishlist\item\column\

After code block:

<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" onfocus="focusComment(this)" onblur="focusComment(this)" title="<?php echo $this->__('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription() ? $item-
>getDescription() : $this->helper('wishlist')->defaultCommentString())) ?></textarea>

Add:

<textarea name="description[<?php echo $item->getWishlistItemId() ?>]" rows="3" cols="5" onfocus="focusComment(this)" onblur="focusComment(this)" title="<?php echo $this->__('Comment') ?>"><?php echo ($this->escapeHtml($item->getDescription())) ?></textarea>

35. Edit "checkout.xml" file

Open file checkout.xml in:

app\design\frontend\your_package\your_theme\ layout

After code block:

<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
<block type="checkout/onepage_progress" name="billing.progress" template="checkout/onepage/progress/billing.phtml"></block>
<block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
<block type="checkout/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
<block type="checkout/onepage_progress" name="payment.progress" template="checkout/onepage/progress/payment.phtml"></block>
</block>

Add:

<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/> 
</block>

36. Edit "page.xml" file

Open file page.xml in:

app\design\frontend\your_package\your_theme\layout

After the line:

<block type="page/html_header" name="header" as="header">

Add:

<block type="page/html_welcome" name="welcome" as="welcome"/>

Please make sure that the code will be in the following format

<block type="page/html_header" name="header" as="header">
  <block type="page/html_welcome" name="welcome" as="welcome"/>
</block>

37. Replace file "xmlconnect.xml"

Copy file xmlconnect.xml in:

app\design\frontend\base\default\template\layout

Paste and replace the existing file in:

app\design\frontend\your_package\your_theme\layout\