Magento 1





How to install SUPEE-9767 without SSH?
Magento 1

How to install SUPEE-9767 without SSH?

How to install SUPEE-9767 without SSH? Click the link: https://magentary.com/kb/install-supee-9767-without-ssh/ ==== Magento Maintenance » How to install...
Read More
How to flush Magento 1.9.x cache using SSH?
Magento 1

How to flush Magento 1.9.x cache using SSH?

How to flush Magento 1.9.x cache using SSH? Click the link to read the article: https://magento.stackexchange.com/...
Read More
Magento 1.9.2.1 Re-index magento via ssh
Magento 1

Magento 1.9.2.1 Re-index magento via ssh

Magento 1.9.2.1 Re-index magento via ssh Click the link to read the article: https://magento.stackexchange.com/questions/117881/re-index-magento-via-ssh-putty ====  ...
Read More
Ultimo Help. Can not get slider blocks to display despite working before.
Magento 1

Ultimo Help. Can not get slider blocks to display despite working before.

Ultimo Help. Can not get slider blocks to display despite working before. Click to the...
Read More
How to Add CSS & Javascript Files to CMS Pages in Magento
Magento 1

How to Add CSS & Javascript Files to CMS Pages in Magento

How to Add CSS & Javascript Files to CMS Pages in Magento Click to the...
Read More
Magento: How can I change the shipping method title at the checkout page?
Magento 1

Magento: How can I change the shipping method title at the checkout page?

Magento: How can I change the shipping method title at the checkout page? 1down vote...
Read More
How to reset the Magento administrator password
Magento 1

How to reset the Magento administrator password

How to reset the Magento administrator password Click to the link: https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/resetting-the-magento-administrator-password == This article describes...
Read More
Store Manager for Magento Documentation
Magento 1

Store Manager for Magento Documentation

Store Manager for Magento Documentation Click to the link: http://store-manager-for-magento-documentation.emagicone.com/ === WELCOME TO STORE MANAGER FOR...
Read More
Creating a Magento theme from scratch
Magento 1

Creating a Magento theme from scratch

Creating a Magento theme from scratch Click to the link: http://inchoo.net/magento/creating-a-new-magento-theme/ ==== Powerful fallback system, organized...
Read More
1 2 3
How to install SUPEE-9767 without SSH?
Magento 1

How to install SUPEE-9767 without SSH?

How to install SUPEE-9767 without SSH?

Click the link: https://magentary.com/kb/install-supee-9767-without-ssh/

====

JUN012017

How to install SUPEE-9767 without SSH

Tags: 

July 12, 2017: Community Edition 1.9.3.4 and SUPEE-9767 version 2 patch address customer registration and other issues encountered by some merchants when using the original release or patch.

May 31, 2017: Community Edition 1.9.3.3 and SUPEE-9767 Security Enhancements – 5/31/2017.

If you have SSH access, it would be more simple to apply the patch via SSH.
If you have no SSH access to apply the patch, you can simply upgrade your installation to Magento 1.9.3.4 version which includes all the latest security patches (SUPEE-5344SUPEE-5994SUPEE-6285SUPEE-6482SUPEE-6788SUPEE-7405SUPEE-8788SUPEE-9652, SUPEE-9767v2). If Magento upgrade is not possible in the moment due to some reason you still can apply the patch via FTP/sFTP upload as shown in this article.

If you wish to save time and have us to install these patches for you, simply click here to order installation.

 

Preparations

  • Disable Magento Compiler and clear compiler cache
  • Disable Symlinks setting
    In Magento backend navigate to System > Configuration > Advanced > Developer > Template Settings > Enable Symlinks and set it to No, if it is not set already:
    template-symlinks-setting-in-magento

 

Applying Magento patches via FTP/sFTP or FileManager / File Upload

To apply patches in this way we simply replace changed files. This way can not be used blindly if you or your developers have changed any core Magento files (which is a big no-no, by the way). Such changes should be re-applied to patched files, or you loose these changes.

Note: Make sure, that all previous patches including SUPEE-5344SUPEE-5994SUPEE-6285SUPEE-6788SUPEE-7405 and SUPEE-8788 are applied as this patch should be applied on top of all previous patches.

Note: If you previously applied SUPEE-9767v1 (first version of this patch released on May 31, 2017) to apply new SUPEE-9767v2 version you can simply upload SUPEE-9767v2 files on top of it, it will replace all files from version 1

The following files are changed by SUPEE-9767 (version 2 for 1.9.3.2 released on July 12, 2017):

To install the patch via FTP/File Upload

  • select patch bundle archive corresponding to your Magento version from the table below and unpack it
  • upload all files and folders to Magento root directory of your store, replacing all files
Magento version SUPEE-9767v2
1.9.3.3 SUPEE-9767v2-1.9.3.3
1.9.3.2 SUPEE-9767v2-1.9.3.2
1.9.3.1 SUPEE-9767v2-1.9.3.1
1.9.3.0 SUPEE-9767v2-1.9.3.0
1.9.2.4 SUPEE-9767v2-1.9.2.4
1.9.2.3 SUPEE-9767v2-1.9.2.3
1.9.2.2 SUPEE-9767v2-1.9.2.2
1.9.2.1 SUPEE-9767v2-1.9.2.1
1.9.2.0 SUPEE-9767v2-1.9.2.0
1.9.1.1 SUPEE-9767v2-1.9.1.1
1.9.1.0 SUPEE-9767v2-1.9.1.0
1.8.1.0 SUPEE-9767v2-1.8.1.0
1.7.0.2 SUPEE-9767v2-1.7.0.2

Downloads for other versions added to table on demand when we patch certain version via file upload for the first time. 

Enable Form Key Validation On Checkout (optional)

To take all advantages of SUPEE-9767 patch it is recommended to enable form key verification for checkout at System > Configuration > Advanced > Admin > Security > Enable Form Key Validation On Checkout.

Note: Check with your theme developer if your theme is compatible before enabling that option as it can break checkout process.
Make sure that corresponding checkout template phtml files in your custom theme have form key fields included and custom opcheckout.js is updated.

These fields were added in this patch into default themes, so if you use default theme (base / rwd) or your theme does not override checkout pages, then you can enable Form Key Validation On Checkout right away.

Otherwise, check with your theme developer if your theme is compatible before enabling that option as it can break checkout process.

The following template files in your custom theme should be checked:

template/checkout/cart/shipping.phtml
template/checkout/multishipping/billing.phtml
template/checkout/multishipping/shipping.phtml
template/checkout/multishipping/addresses.phtml
template/checkout/onepage/billing.phtml
template/checkout/onepage/payment.phtml
template/checkout/onepage/shipping.phtml
template/checkout/onepage/shipping_method.phtml
template/persistent/checkout/onepage/billing.phtml

These files should include formkey line and you can add it just like in default template files:

--- app/design/frontend/base/default/template/checkout/onepage/payment.phtml
+++ app/design/frontend/base/default/template/checkout/onepage/payment.phtml
@@ -35,6 +35,7 @@
 <form action="" id="co-payment-form">
     <fieldset>
         <?php echo $this->getChildHtml('methods') ?>
+        <?php echo $this->getBlockHtml('formkey') ?>
     </fieldset>
 </form>
 <div class="tool-tip" id="payment-tool-tip" style="display:none;">

Other set of files to update are custom javascript files that override js/varien/payment.js and skin/frontend/base/default/js/opcheckout.js. These javascript files should be updated with the following:

@@ -711,7 +711,7 @@ Payment.prototype = {
         }
         var method = null;
         for (var i=0; i<elements.length; i++) {
-            if (elements[i].name=='payment[method]') {
+            if (elements[i].name=='payment[method]' || elements[i].name == 'form_key') {
                 if (elements[i].checked) {
                     method = elements[i].value;
                 }

 

Verification and flush of Magento PHP opcode cache

Flush Magento caches: Navigate in Magento backend to System > Cache Management and flush Magento cache and CSS/JS caches.

If you use PHP opcode caches (OPCache/APC/XCache/eAccelerator) make sure to flush it after patching (or restart webserver), otherwise code will continue to run from caches.

Test that your store is working. Test Checkout process.

If you have any difficulties with applying the patches please let us know in comments, so we can find the solution together.

How to flush Magento 1.9.x cache using SSH?
Magento 1

How to flush Magento 1.9.x cache using SSH?

How to flush Magento 1.9.x cache using SSH?

Click the link to read the article: https://magento.stackexchange.com/

====

I have resolved the issue with my self by following below solution .

Logged in to your server and run the below command from your magento root directory:

php -r 'require "app/Mage.php"; Mage::app()->getCacheInstance()->flush();'
Magento 1.9.2.1 Re-index magento via ssh
Magento 1

Magento 1.9.2.1 Re-index magento via ssh

Magento 1.9.2.1 Re-index magento via ssh

Click the link to read the article: https://magento.stackexchange.com/questions/117881/re-index-magento-via-ssh-putty

====

 

You are running this command from ROOT and indexer.php is located under shell directory. So try this commands instead:

php shell/indexer.php --reindex catalog_product_attribute

For re-indexing all indexes :

php -f shell/indexer.php reindexall

Listing all commands :

php shell/indexer.php --reindex catalog_product_attribute
php shell/indexer.php --reindex catalog_product_price
php shell/indexer.php --reindex catalog_url
php shell/indexer.php --reindex catalog_product_flat
php shell/indexer.php --reindex catalog_category_flat
php shell/indexer.php --reindex catalog_category_product
php shell/indexer.php --reindex catalogsearch_fulltext
php shell/indexer.php --reindex cataloginventory_stock
php shell/indexer.php --reindex tag_summary
Ultimo Help. Can not get slider blocks to display despite working before.
Magento 1

Ultimo Help. Can not get slider blocks to display despite working before.

Ultimo Help. Can not get slider blocks to display despite working before.

Click to the link: https://understandinge.com/forum/magento-theming-design/ultimo-help-can-not-get-slider-blocks-to-display-despite-working-before/

===

Can anyone help because I am baffled as to why my static slider blocks will not display, despite working before!

Mega Drop Down Menu Issue

I am about to go live with my Ultimo and noticed that the static blocks I set up as shown below in my ‘Mega Drop Down’ menu have stopped displaying. You can see that the one I have set to display in the right block works OK, but the one I have set to display in the bottom block will not display.

Image Enlarger

Category Header Static Blocks

I have also set several of my categories to display ‘slider blocks’ as shown in the image below. I have set up three slider images for one particular category as shown below;

Image Enlarger

I have set these up with the following code;

<!– Slider Block Joe Snyder – Uses inbuilt static blocks for Ultimo –>
{{block type=”ultraslideshow/slideshow” template=”infortis/ultraslideshow/slideshow.phtml” slides=”slider_block_slides_joe_snyder_1,slider_block_slides_joe_snyder_2,slider_block_slides_joe_snyder_3″}}

<!– Slider Block Slides Joe Snyder 1 – Dark 1 + Caption + Sub text –>
<p><a href=”#”> <img title=”Joe Snyder Underwear” alt=”Joe Snyder Underwear” src=”{{media url=’wysiwyg/infortis/ultimo/category_sliders/joe_snyder/slide1.jpg’}}” /></a></p>
<div class=”caption dark1 full-width”>
<h2 class=”heading permanent”>Joe Snyder</h2>
<p>Extreme underwear &amp; swimwear</p>
<p>For the ultra confident male exhibitionist</p>
</div>

<!– Slider Block Slides Joe Snyder 2 – Dark 1 + Caption + Sub text –>
<p><a href=”#”> <img title=”Joe Snyder Underwear” alt=”Joe Snyder Underwear” src=”{{media url=’wysiwyg/infortis/ultimo/category_sliders/joe_snyder/slide2.jpg’}}” /></a></p>
<div class=”caption light3 full-width”>
<h2 class=”heading permanent”>Joe Snyder</h2>
<p>Underwear that doubles as swimwear</p>
<p>Bold colours and ultra sexy fabrics offer a unique look</p>
</div>

<!– Slider Block Slides Joe Snyder 3 – Dark 1 + Caption + Sub text –>
<p><a href=”#”> <img title=”Joe Snyder Underwear” alt=”Joe Snyder Underwear” src=”{{media url=’wysiwyg/infortis/ultimo/category_sliders/joe_snyder/slide3.jpg’}}” /></a></p>
<div class=”caption light3 full-width”>
<h2 class=”heading permanent”>Joe Snyder</h2>
<p>Tantalizing underwear. Not for the faint hearted.</p>
<p>Extreme cut thongs, skimpy g-strings and cheeky boxers</p>
</div>

I have then set the ‘display’ option in the respective category as follows;

Image Enlarger

However, the slider blocks will not display in the categories I set them up for.

Home Page Issue

I have also noticed that slider blocks will not display on the home page either. I have tried adding the following code to my home page in order to display some recommended products, but again they will not display;

<!– 2 Products Slider – Small Images –>
{{block type=”ultimo/product_list_featured” template=”catalog/product/list_featured_slider.phtml” category_id=”” product_count=”4″ breakpoints=”[0, 2]” timeout=”4000″ move=”1″ centered=”1″ size=”size-s” hide_button=”1″ img_width=”110″ block_name=”Recommended”}}

Can anyone help.

Regards

James

==== ANSWER =====

Yep. Finally managed to crack it today having eventually getting a reply from the Infortis developer and coupling bits of info from them with info I gleaned from Magento Stack Exchange site. I had to add the following blocks to ‘whitelist’ them in system/permissions/blocks

1 core/template
2 catalog/product_new
3 catalog/product
4 infortis/ultraslideshow
5 infortis/ultramegamenu
6 infortis/brands
ultimo/product_list_featured
10 cms/block
11 catalog/product_list
12 newsletter/subscribe
13 ultraslideshow/slideshow
14 brands/brands
15 ultramegamenu/navigation

Only 1 and 2 were already added. I had to add 3 to 15 to enable the static blocks to display frontend

How to Add CSS & Javascript Files to CMS Pages in Magento
Magento 1

How to Add CSS & Javascript Files to CMS Pages in Magento

How to Add CSS & Javascript Files to CMS Pages in Magento

Click to the link: https://www.rowanburgess.co.uk/magento-how-to/add-css-javascript-files-cms-pages-magento/

===

If you’re creating a custom Magento theme, you’re probably going to want to include some custom CSS or Javascript files. This simple task can, however, be quite a convoluted headache. So here’s a summary of all you need to know:

Ideally, you should have a local.xml file setup in yourtheme/layout folder. If you haven’t managed this step, have a Google. I’ll probably get a local.xml guide up soon.

Skip to:

Adding CSS or Javascript files to All pages

Adding CSS or Javascript files to all CMS pages

Adding CSS or Javascript files to all Category pages

Adding CSS or Javascript files to all Product pages

Adding CSS or Javascript files to specific CMS pages

Adding CSS or Javascript files to specific Category pages

Adding CSS or Javascript files to specific Product pages


Adding CSS or Javascript files to All pages

In your local.xml file, add the following below the opening layout tag:

To add a CSS file residing in the skin CSS folder

1
2
3
4
5
6
7
<default>
<reference name=“head”>
<action method=“addCss”>
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>
</default>

To add a Javascript file residing in the skin JS folder

1
2
3
4
5
6
7
8
9
<default>
<reference name=“head”>
<action method=“addItem”>
<type>skin_js</type>
<name>js/custom.js</name>
<params/>
</action>
</reference>
</default>

To add a Javascript file residing in the {magentoroot}/js folder

1
2
3
4
5
6
7
<default>
<reference name=“head”>
<action method=“addJs”>
<script>custom.js</script>
</action>
</reference>
</default>

Adding CSS or Javascript files to all CMS pages

See ‘Adding CSS or Javascript files to all pages’, but change the <default> tag to: <cms_page>


Adding CSS or Javascript files to all Category pages

See ‘Adding CSS or Javascript files to all pages’, but change the <default> tag to: <catalog_category_view>


Adding CSS or Javascript files to all Product pages

See ‘Adding CSS or Javascript files to all pages’, but change the <default> tag to: <catalog_product_view>


Adding CSS or Javascript files to specific CMS pages

In Magento admin, navigate to CMS > Pages and select your desired CMS page to add CSS or Javascript to. Select the design tab on the left.

In the area labelled ‘Layout Update XML’, add the following:

To add a CSS file residing in the skin CSS folder

1
2
3
4
5
<reference name=“head”>
<action method=“addCss”>
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>

To add a Javascript file residing in the skin JS folder

1
2
3
4
5
6
7
<reference name=“head”>
<action method=“addItem”>
<type>skin_js</type>
<name>js/custom.js</name>
<params/>
</action>
</reference>

To add a Javascript file residing in the {magentoroot}/js folder

1
2
3
4
5
<reference name=“head”>
<action method=“addJs”>
<script>custom.js</script>
</action>
</reference>

Adding CSS or Javascript files to specific Category pages

In Magento admin, navigate to Catalog > Manage Categories and select your desired category to add CSS or Javascript to.

Click the ‘Custom Design’ tab on the left, and in the area labelled ‘Custom Layout Update’, add the following:

To add a CSS file residing in the skin CSS folder

1
2
3
4
5
<reference name=“head”>
<action method=“addCss”>
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>

To add a Javascript file residing in the skin JS folder

1
2
3
4
5
6
7
<reference name=“head”>
<action method=“addItem”>
<type>skin_js</type>
<name>js/custom.js</name>
<params/>
</action>
</reference>

To add a Javascript file residing in the {magentoroot}/js folder

1
2
3
4
5
<reference name=“head”>
<action method=“addJs”>
<script>custom.js</script>
</action>
</reference>

Adding CSS or Javascript files to specific Product pages

In Magento admin, navigate to Catalog > Manage Products and select your desired product to add CSS or Javascript to.

Click the ‘Design’ tab on the left and in the area labelled ‘Custom Layout Update’, add the following:

To add a CSS file residing in the skin CSS folder

1
2
3
4
5
<reference name=“head”>
<action method=“addCss”>
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>

To add a Javascript file residing in the skin JS folder

1
2
3
4
5
6
7
<reference name=“head”>
<action method=“addItem”>
<type>skin_js</type>
<name>js/custom.js</name>
<params/>
</action>
</reference>

To add a Javascript file residing in the {magentoroot}/js folder

1
2
3
4
5
<reference name=“head”>
<action method=“addJs”>
<script>custom.js</script>
</action>
</reference>
Magento: How can I change the shipping method title at the checkout page?
Magento 1

Magento: How can I change the shipping method title at the checkout page?

Magento: How can I change the shipping method title at the checkout page?

To change the shipping methods title of USPS methods just go to this file app\code\core\Mage\Usa\Model\Shipping\Carrier\Usps.php and in getCode() function you will find various title of USPS shipping methods from here you can change title.

How to reset the Magento administrator password
Magento 1

How to reset the Magento administrator password

How to reset the Magento administrator password

Click to the link: https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/resetting-the-magento-administrator-password

==

This article describes how to reset the Magento administrator password.

Normally if you forget your password, you can use the Magento password recovery feature to reset the password by e-mail. However, if this option is unavailable (for example, if e-mail on your site is not working correctly), you can use phpMyAdmin to manually reset the password in the database.

METHOD #1: E-MAIL

The quickest and easiest way to reset the Magento administrator password is to request a new one through e-mail. To do this, follow these steps:

  1. Use your web browser to go to the Magento login page.
  2. Click Forgot your password?.
  3. In the Email Address text box, type the e-mail address associated with the account.
  4. Click Retrieve Password. Magento sends a message to the e-mail address associated with the administrator account.
  5. In the message, click the link to reset the administrator password.

METHOD #2: PHPMYADMIN

You can also modify the Magento administrator password directly in the database using phpMyAdmin. To do this, follow the appropriate procedure for your version of Magento.

Magento 2

To reset the administrator password directly in the Magento 2 database, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. In the Databases section of the cPanel home screen, click phpMyAdmin.
  3. In the left-hand pane of phpMyAdmin, click the Magento database. A list of tables in the database appears.
    Typically, the Magento database is username_mageXXX, where username represents your cPanel username, and XXX is a three-digit number.
  4. On the top menu bar, click SQL.
  5. Copy and paste the following statement into the SQL query text box. Replace NewPassword with the new password, and replace both occurrences of xxxxxxxx with any random character sequence:
    UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'admin';
    • This command assumes that you want to change the password for the admin user account. To change the password for another account, change the username field to the correct value.
    • The xxxxxxxx character sequence is a cryptographic salt. It can be anything you want (and any length you want), but make sure you use the same value in both parts of the SQL statement.
    • If your Magento installation uses table prefixes, make sure you add it to the table name. For example, if your Magento table prefix is mg_, you would type the following command instead:
      UPDATE mg_admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'admin';
      
  6. Click Go. phpMyAdmin updates the database, and you can log in to Magento as the administrator using the new password.
Magento 1.9 and older versions

To reset the administrator password directly in Magento 1.9 and older versions, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. In the Databases section of the cPanel home screen, click phpMyAdmin.
  3. In the left-hand pane of phpMyAdmin, click the Magento database. A list of tables in the database appears.
    Typically, the Magento database is username_mageXXX, where username represents your cPanel username, and XXX is a three-digit number.
  4. On the top menu bar, click SQL.
  5. Copy and paste the following statement into the SQL query text box. Replace NewPassword with the new password, and replace both occurrences of xx with any random two-character sequence:
    UPDATE admin_user SET password = CONCAT(MD5('xxNewPassword'), ':xx') WHERE username = 'admin';
    • This command assumes that you want to change the password for the admin user account. To change the password for another account, change the username field to the correct value.
    • The xx two-character sequence is a cryptographic salt. It can be anything you want, but make sure you use the same value in both parts of the SQL statement.
    • If your Magento installation uses table prefixes, make sure you add it to the table name. For example, if your Magento table prefix is mg_, you would type the following command instead:
      UPDATE mg_admin_user SET password = CONCAT(MD5('xxNewPassword'), ':xx') WHERE username = 'admin';
  6. Click Go. phpMyAdmin updates the database, and you can log in to Magento as the administrator using the new password.
Store Manager for Magento Documentation
Magento 1

Store Manager for Magento Documentation

Store Manager for Magento Documentation

Click to the link: http://store-manager-for-magento-documentation.emagicone.com/

===

WELCOME TO STORE MANAGER FOR MAGENTO HELP CENTER

Store Manager is a Windows-based application, designed and created to greatly ease the online management of one, or multiple, Magento x-commerce stores. Its chief purpose is to provide efficient, graphical, low-level access and manipulation of store data, providing easy automation of repetitive, routine tasks, and greatly simplified operational restructuring and ongoing maintenance.

Creating a Magento theme from scratch
Magento 1

Creating a Magento theme from scratch

Creating a Magento theme from scratch

Click to the link: http://inchoo.net/magento/creating-a-new-magento-theme/

====

Powerful fallback system, organized folder structure and tons of functionality is what makes Magento one of the most flexible and powerful eCommerce platforms out there. By default, Magento offers a lot, but as eCommerce evolved during the years, there is always additional work required to fit client needs.

Probably the first thing you will do when starting a new Magento project will be to create a Magento theme that will have custom styling and functionality. Although creating a Magento theme is a pretty simple thing to do (just ask any certified frontend developer), by not following Magento recommendations and rules you can easily make your life a bit complicated.

So, how to do it properly? Read on…

If you are new to Magento, be sure to read Magento Designer’s Guide, where the Magento design terminology is explained in a PDF document.

Magento Theme fundamentals

Magento themes are placed in design packages. Each package can have multiple themes.

When You install Magento, there are 3 packages available:

1-creating-magento-theme

In Base package, there is a “Default” Magento theme with all the files necessary for Magento to work properly. You should NEVER delete or edit files in “Base” package. I will explain why later.

Default package is legacy from < 1.4CE where it was the original base package. This package can be found only in CE edition of Magento, not in EE. You can safely remove that package from your installation. However, it may be restored during a Magento upgrade.

RWD is a new package which holds a new responsive Magento theme.

Magento has two main folders which correspond with each other:
“app” directory contains files that control how page templates are rendered.
“skin” directory contains files that control the site’s appearance.

  • Template files
    app/design/frontend/package/theme

2-creating-magento-theme

Layout folder contains XML files which are used to define and control structural and content blocks of your theme.

Template folder contains .phtml files – they hold the markup for each Magento blocks that are being displayed in the frontend.

  • Skin files
    app/skin/frontend/package/theme

3-creating-magento-theme

Skin folder contains all of your assets such as CSS, images, js, Sass etc.

NOTE: Package and theme names should be the same in both design and skin folders.

For example:
app/design/frontend/MyPackage/MyTheme
app/skin/frontend/MyPackage/MyTheme

Creating your theme

First, you need to create a new design package, in both “design” and “skin” folders.

Let’s call it “MyPackage”.

In your design package, create a new folder which will hold your theme. Let’s call it “MyTheme”.

Create two new folders in your theme folder – “layout” and “template”.

In the skin folder, open your theme folder and create folders – css, js, images.

5-creating-magento-theme    4-creating-magento-theme

Next, you should create “local.xml” and place it in “layout” folder.

That’s all you need!

Working with the theme

Next step would be to tell Magento which package and theme will be used as default.

To do this, go to
system > configuration > design

6-creating-magento-theme

First, we need to tell Magento which package we will use. We are using “MyPackage” design package.

As you can see, we can use assets from multiple themes. Templates can be called from one theme, skin files from another. Yet another cool thing about Magento and its fallback system which will be explained in the next paragraph.

Now, insert your theme name in all fields except “default” field – leave that blank.

Et voilà! Your theme is all set and ready.

You are probably eager to start with theme styling and editing. Since you don’t have any files in your folders, you are probably asking yourself “what now?” Now we will talk about Magento’s fallback system and then you will be ready to start with work. 🙂

Magento fallback system

The fallback system in Magento is very powerful. It allows you to edit your theme without duplicating unchanged files.

So, how does the fallback system work?

Like any other modern framework, Magento consists of many small blocks which are rendered and combined before they are outputted to one html file which is served to client.

If some of those files are missing, you will probably get a render error and the site will be broken.

Basically, what Magento does is this:

it looks for specific file in your theme folder

  • if found – outputs it
  • if not found, it searches for “default” theme in custom design package
  • if “default” theme exists in a custom package, it searches for the file there
  • if “default” theme does not exist in a custom package or file is not found in “default theme”, it fallbacks to “base” package and searches for file in “default” theme
  • if file is not found, Magento outputs rendering error

For example, when 1column.phtml is required, this is where Magento will look for it:

  1. app/design/frontend/MyPackage/MyTheme/template/page/1column.phtml
  2. app/design/frontend/MyPackage/default/template/page/1column.phtml
  3. app/design/frontend/base/default/template/page/1column.phtml

Now that you know how fallback system works, you understand why you should never edit or delete files in “base” package. If you delete some file by accident, Magento has nowhere to fallback and will generate a rendering error. Also, during a Magento upgrade, “base” package can be overwritten, therefore your changes would be lost.

3 rules to rule them all

To sum up, try to stick with these 3 simple rules and your Magento career will be less painful.

  • You should always create your own Design package and the theme inside it.
  • Duplicate files from base/default but only the ones that will be edited.
  • Your theme should hold only the files that were changed. Magento will fallback and look for the rest of the files in base/default theme.

I hope that article was useful to some of you. If you have any questions regarding Magento development, feel free to get in touch – we would be happy to assess your site and get you on the right track with our Magento Technical Audit.

Thanks for reading.