Form validation in magento

As you know Magento use 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=”username”> < ?php echo $this->__(‘User name’) ?> <span>*</span></label><br /> <input type="text" id=”username” name=”username” class="input-text required-entry"/> <label for=”password”> < ?php echo $this->__(‘Password’) ?> <span>*</span></label><br /> <input type="password" id=”password” name=”password” class="input-text required-entry"/> </form> <script…

Continue Reading

How to override Magento model classes

Of course, there are better ways to do that (make module), but I’m not going to write about that right now since it is not subject of this post. I only mentioned that because we can’t do same thing for models even if we want to, so how to override Magento models without modifying core files? Fortunately, that’s very easy…

Continue Reading

Create Payment Method Module

Introduction Each payment method can be done as separate module or few methods can be combined in same module if they share functionality or could be used together. Let’s create a module with one payment method that will: accept credit card information authorize it when order is submitted save transaction ID in order payment record Our new module will be…

Continue Reading

Magento Preview Version CE – Now Available!

We are happy to announce the availability of Magento Preview Version CE As this is a preview version it is NOT recommended in any way to be used in a production environment (more information about preview releases and the community edition release process can be found in this blog post). This release is available for upgrade through the Connect Manager, to download or via SVN….

Continue Reading

Special characters code of addFieldToFilter function

array("eq"=>'n2610') WHERE (e.sku = 'n2610') array("neq"=>'n2610') WHERE (e.sku != 'n2610') array("like"=>'n2610') WHERE (e.sku like 'n2610') array("nlike"=>'n2610') WHERE (e.sku not like 'n2610') array("is"=>'n2610') WHERE (e.sku is 'n2610') array("in"=>array('n2610')) WHERE (e.sku in ('n2610')) array("nin"=>array('n2610')) WHERE (e.sku not in ('n2610')) array("notnull"=>'n2610') WHERE (e.sku is NOT NULL) array("null"=>'n2610') WHERE (e.sku is NULL) array("gt"=>'n2610') WHERE (e.sku > 'n2610') array("lt"=>'n2610') WHERE (e.sku < 'n2610') array("gteq"=>'n2610') WHERE…

Continue Reading