Convert a Menu to a Dropdown for Small Screens


<!DOCTYPE html>
<html>
<head>
<meta charset=’UTF-8′>
<title>Convert Menu to Dropdown</title>
<style>
* {
margin: 0;
padding: 0;
}
h1 {
font: 300 21px “HelveticaNeue-Light”, “Helvetica Neue Light”, “Helvetica Neue”, Helvetica, Arial, “Lucida Grande”, sans-serif;
width: 500px;
margin: 0 auto 15px;
}
nav {
display: block;
width: 960px;
margin: 100px auto;
text-align: center;
} Continue reading

Advertisements

[RFC] PHP 5.4 Strict Error Reporting


Testing with PHP 5.4 at E_ALL produces strict warning messages such as:

Strict (2048): Declaration of Product::beforeSave() should be compatible with Model::beforeSave($options = Array) [APP/Model/Product.php, line 4]

It’s an easy fix, for example in APP/Model/Product.php change:

public function beforeSave() {

to:

public function beforeSave($options = array()) {

Currency switcher in magento left or right sidebar


Need to show the drop down of currency in the sidebar ?

Below code will displays the currency drop down on left and right sidebar.
Open the directory.xml file in the layout folder (app/design/frontend/default/default/layout/directory.xml) and add the following code to it.

<default>
<!– Mage_Catalog –>
<reference name=”left”>
<block type=”directory/currency” name=”currency” before=”cart_sidebar” template=”directory/currency.phtml”/>
</reference>
<reference name=”right”>
<block type=”directory/currency” name=”currency” before=”cart_sidebar” template=”directory/currency.phtml”/>
</reference>
</default>

Comment the other node as show below Continue reading

Creating A Magento Module


A lot of community extensions (or modules) are available for the feature-rich open-source e-commerce solution Magento, but what if they don’t quite work as you want them to? Want to write your own module?

In this tutorial, we will introduce the coding of Magento in the form of a “Hello World”-style module. The goal of the module will be simply to write some information to a log file every time a product is saved. This very basic module will allow us to cover a number of interesting topics, including: Continue reading