Magento themes and extensions

Form validation in magento

Share
Posted on July 29th, 2011 | Posted by admin

As you know, Magento uses Prototype as javascript library.  It provides a simple way to validate html form values.

Below is an example:

<form name=”my-form” id=”my-form” method=”post”>
<label for=”firstname”>
< ?php echo $this->__(‘First name’) ?> <span>*</span></label><br />
<input  id=”firstname” name=”firstname” class="input-text required-entry"/>

<label for=”lastname”>
< ?php echo $this->__(‘Last name’) ?> <span>*</span></label><br />
<input  id=”lastname” name=”lastname” class="input-text required-entry"/>

</form>

<script type=”text/javascript”>
//< ![CDATA[
var customForm = new VarienForm('my-form');
//]]>
</script>

How to get a block in any where?

Share
Posted on July 29th, 2011 | Posted by admin

By the normal way, you can get a block by using object Layout.

For example,  in a controller:

$this->getLayout()->createBlock(‘module_name/block_name’);

It is the same with a block or a template file.

But if you want to get a block in a helper, model or any where, what way?

In this case, you can use: Mage::app()->getBlockSingleton(‘module_name/block_name’);

· ·

No comments yet.

Layered navigation, but not quite

Share
Posted on July 27th, 2011 | Posted by admin

Recently I got a chance to rewrite Magento’s layered navigation standard functionality. The request was very specific as the client wanted to keep all of the “filters” visible all the time. For example if  you wish to filter your results by Color (let’s say you have yellow, green, red, blue and magenta) products are filtered but the layered navigation displays all filters. This way a costumer can re-filter the products in current category without the need to return to the category view.

Files that are used for layered navigation are situated in app/design/frontend/base/default/template/catalog/layer/ folder. File used for layered navigation is view.phtml – it shows us all of the filters when we click on a category. File used for active state is state.phtml – when we click on one of the filters it is responsible for the results – so we’re gonna edit this one. So copy the state.phtml from base to your package or theme.

This is the original code in state.phtml:

Product Image Preview, quick view image module in magento

Share
Posted on July 22nd, 2011 | Posted by admin

This extension will install a wonderful and ready-to-use product image preview widget in your Magento store. This is an impressive script that allows your visitors to conveniently zoom out an product image that they want to view. Installation is very easy via FTP and no coding experience is required to have module up-and-running.
FEATURES

  1. Allow customers zoom out product images they want to view
  2. Allow admin to configure the following parameters: Image Preview size, Border Image Preview, Border Color for Image Preview, Text Image Preview, Text color
  3. Our modules include one year of free updates/upgrades.
  4. Seperated HTML/CSS, W3C validated
  5. Support Magento Version 1.4.x and 1.5.x
  6. 100% open source
  7. Support free guarantee
  8. Live support is always ready

Fancy products module in magento

Share
Posted on July 22nd, 2011 | Posted by admin

OVERVIEW

Fancy products extension is the ideal solution for any online shop. With this extension, it is easy for you to show lastest product, featured product, bestseller products, mostviewed products, new products. It allow you choose. It allow you to select the display mode ( LASTEST PRODUCTS, FEATURED PRODUCTS, BESTSELLER PRODUCTS, MOSTVIEWED PRODUCTS, NEW PRODUCTS ) in the admin with some effects ( SWING, EASEOUTBOUNCE, EASEINBOUNCE ) display products.

FEATURES

  1. Easy config option admin
  2. Some mode display products you enjoy
  3. Some effects for display products
  4. Our modules include one year of free updates/upgrades.
  5. Seperated HTML/CSS, W3C validated
  6. Support Magento Version 1.4.x and 1.5.x
  7. 100% open source
  8. Support free guarantee
  9. Live support is always ready