November 8, 2013

Magento having a good process that if a product is out of stock then there should be a link for product notification. when the product back in stock it will send a mail to user.

To set up Magento Product Alerts please go to System > Configuration > Catalog > Product Alerts then select Yes to "Allow Alert When Product Comes Back in Stock" field.

Set out of status for any product and back to front end you see link to subscribe stock notify

Magento product stock back alert link

When user logged in and click to "Sign up to get notified when this product is back in stock" link, the user email will store in product alert table in Magento. Set in stock for this product in admin, an email will be send to user subscribed. Actually, email not send. Why????

After research I see config.xml file in Product Alert Module (app\code\core\Mage\ProductAlert\etc\config.xml) not set schedule for cronjob:

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

In the form above you can see each input field has its own class name and these classes will be used to validate field’s value. There are many predefined classes like that in prototype lib. I’ll show you all of them at the end of this topic.

Most important thing besides assigning class names is that little piece of JavaScript below the form. Remember to pass form id into the new VarienForm object.

Basically, that’s it. Constructing the form this way, automatically makes your form reuse already existing validation code which is being used by the rest of the shop.

Below is a full list of validate class and its error message that I found in prototype lib.

Validate Class

Meaning

validate-select

Please select an option.

required-entry

This is a required field.

validate-number

Please enter a valid number in this field.

validate-digits

Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.

validate-alpha

Please use letters only (a-z or A-Z) in this field.

validate-code

Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.

validate-alphanum

Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.

validate-street

Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.