How to limit the number of characters that can be entered in a textarea or input field?

Edit Text

In web pages which take input/feedback from the customers it’s a good idea to limit the type and size of data that can be entered so that spam can be avoided.

Let see how we can limit the number of characters that can be entered in a text box.

The simplest approach I follow is to use the jQuery “Limit” plugin. Click here to download the plugin.

Continue reading »

How to set/change the position of products in product listing page in Magento?

Sorting

In order to promote certain products, you may want to place them at the top in the category product listing page. Lets see how to set/change the position of the products from Magento admin.

To set/change the position of the products proceed as below:

1. Login Magento admin and follow the path Admin >> Catalog >> Manage Categories.
2. Click on a category in the category tree to display the category related information.

Continue reading »

Securing Solr Admin Interface on Tomcat

Apache Solr

Solr admin interface provides information about the solr and its running environment, provides the power to manage cores, view the logs etc. It is open to public by default hence a security risk, lets see how we can password protect the solr admin.

The steps mentioned have been tried in a hosting environment which has the following software installed.

  • apache-tomcat-7.0.55
  • jdk1.7.0_65
  • solr-4.10.0
  • CentOS 6.5

Continue reading »

How to change the “Reply” text in the comments listing and add a custom css class to the “Reply” link?

Wordpress

If you open the comments.php template file and look at the source code you will find that “wp_list_comments” function is used to display the comments listing. To change the “Reply” text your can pass “reply_text” parameter to “wp_list_comments” function.

Similarly to customize the comments listing frontend design you can pass a callback function as parameter to “wp_list_comments” function.

Continue reading »

Shell script – how to find out the directory in which it resides?

Shell Script

My shell script samplescript.sh resided in the directory /home/projects/sampleproject/scripts and in the shell script I included a configuration file relatively as below:

#!/bin/bash

CONF="../config/common.conf"
. $CONF

Continue reading »

How to overwrite system.xml file in Magento

XML

At times we need to add new configurations options or modify some option in an existing module, lets see how to do it in this article. Suppose we have to add a new field “Surcharge” to the Payment Method “Cash on Delivery” configuration options and modify the “Instructions” option label to “Message”.

To do this we have to create a new module.

1. We create a file “Techawaken_Cod.xml” in folder app\etc\modules\ to declare the module. The content of the file is shown below:

<?xml version="1.0"?>
<config>
<modules>
<Techawaken_Cod>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Payment />
</depends>
</Techawaken_Cod>
</modules>
</config>

Continue reading »

How to change the logo image in Magento

Magento

Its very easy and simple to change the logo image in Magento. In default Magento theme logo image is picked up from the {{Magento_Root}}/skin/frontend/default/default/images/logo.gif.

One option is to create gif image of you logo and name it logo.gif and upload it in the {{Magento_Root}}/skin/frontend/default/default/images/ folder to overwrite the old logo image file.

Continue reading »

How to change the system timezone in Linux

World Clock

In Linux, the system time zone is determined by the symbolic link /etc/localtime. This symbolic link points to a time zone data file located at either /usr/share/zoneinfo or /usr/lib/zoneinfo depending on Linux distribution. So changing the system timezone is just a simple job of updating this symbolic link.

Run the following command to view the list of regions

ls -l /usr/share/zoneinfo

Continue reading »

Check server compatibily with Magento

Check

As discussed earlier in post “Magento System Requirements”, Magento has certain has certain server/software requirements which must be met in order to install and run it.

You can test your server for compatibility by following these simple steps:

  • Download the magento-check file to your computer and unzip it. You can download the file from Magento or GitHub.
  • Upload the extracted magento-check.php file to the web server directory where you will be installing Magento. In case you have already uploaded Magento files on your server then upload the magento-check.php file to the Magento directory.

Continue reading »

PHP Warning: include(): realpath failed to canonicalize

Warning

I was getting the following warnings when I was running Magento shell scripts from the command line using PHP CLI (PHP Command Line Interface).

PHP Warning:  include(): realpath failed to canonicalize Mage/Core/Model/App.php - bailing in /var/www/magentoproject/lib/Varien/Autoload.php on line 93

PHP Warning:  include(): realpath failed to canonicalize Varien/Event/Collection.php - bailing in /var/www/magentoproject/lib/Varien/Autoload.php on line 93

PHP Warning:  include(): realpath failed to canonicalize Varien/Event/Observer/Collection.php - bailing in /var/www/magentoproject/lib/Varien/Autoload.php on line 93

To remove this warning I started debugging Magento code but no success. Then I googled and came across various posts/forums saying that it was possibly due to APC.

Continue reading »

Page 5 of 11« First...34567...10...Last »
Back to top