Add Remove CSS Class Mouseover with JQuery

JQuery
Sometimes we need to change css class on mouseover and mouseout event some of div, images, paragraph for the set any effect or beautiful looks. If you want to change any css class on mouseover this is possible to make very easily using of Jquery. Only three to four lines of code need write in jquery function to make or set any mouseover event to change css style class. Change style class on mouseover with Jquery Here is the one div which is shows navigation menu. [sourcecode language="plain"] <div clas="leftside"> <div class="navOut"><a href="#">ITEM 1</a></div> <div class="navOut"><a href="#">ITEM 2</a></div> <div class="navOut"><a href="#">ITEM 3</a></div> <div class="navOut"><a href="#">ITEM 4</a></div> </div> [/sourcecode] Here is the jQuery function to add rollover effects to this navigation: [code lang="js"] <script type="text/javascript"> $("div.navOut").mouseover(function(){ $(this).removeClass().addClass("navOver"); }).mouseout(function(){ $(this).removeClass().addClass("navOut"); }); </script>…
Read More

Change image on mouse hover effect with jquery

JQuery
This is possible to many way change image on mouse hover effect like javascript. But it will take time and much coding compare to do with jquery. This is very easy to make mouse hover effect with jquery. How to change image mouse over effect with jquery we first need to add the jquery library script [code lang="js"]<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>[/code] [code lang="js"]<img src="logo.png" alt="juswebdevelopment" class="logo" />[/code] This is jquery function for shows change hover effect [code lang="js"] <script type='text/javascript'> $(document).ready(function(){ $(".logo").hover( function() {$(this).attr("src","logo-hover.png");}, function() {$(this).attr("src","logo.png"); }); }); </script> [/code] This function is working with image class="logo". When mouse hover on class logo that time its call this function and change the image as per code.
Read More

Get attribute name and value magento

Magento
In magento you can create as many custom attributes for your products as you want.Suppose you want to add or display brand color for every product on home, category or product page. So this is very easy to do with custom attributes. If we were to create a new custom attribute called "brand_color" and the attribute was of a "Text Field" type, we could do something like the following at a product level to obtain its value. [php]<?php echo $_product->getBrandColor(); ?>[/php] Get attribute collection [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute'); ?>[/php] Get attribute type [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getAttributeType(); ?>[/php] Get attribute Label [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getFrontendLabel(); ?>[/php] Attribute is visible or not [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getIsVisible(); ?>[/php] Attribute is required [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getIsRequired(); ?>[/php] Get attribute value [php]<?php $attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getMyAttribute();?>[/php]…
Read More

Excute custom query in magento

Magento
Magento has provide us very good features for handling or interacting with Database tables. Magento give all the data by default but some time we need to get or insert some custom data.So for this we need to write custom query. Database Connections In Magento [php] <?php // fetch read database connection that is used in Mage_Core module $read= Mage::getSingleton('core/resource')->getConnection('core_read'); // fetch write database connection that is used in Mage_Core module $write = Mage::getSingleton('core/resource')->getConnection('core_write'); ?> [/php] How to excute custom query in magento [php] <?php // fetch read database connection that is used in Mage_Core module $read= Mage::getSingleton('core/resource')->getConnection('core_read'); $value=$read->query("SELECT ...."); $row = $value->fetch(); echo "<pre>";print_r($row);echo "</pre>"; // As Array ?> [/php] Insert custom data in magento tabel [php] <?php // fetch write database connection that is used in Mage_Core module…
Read More

Redirecting non-www to www with .htaccess

PHP
If your website can be access both way with and without www. So may search engines consider same content with two different URLs with and without www. So it might be a case of Duplicate Content as well as Google Canonical problems. So you must stick your domain name accessible either with www or without www. Before writing this rules in .htaccess , make sure that your mod_rewrite is enabled(On). Most probably mod_rewrite is enabled in Linux server but for windows server you need to contact hosting people to make mod_rewrite enabled. You can check this by looking in phpinfo(). How to redirect www to non-www and non-www to www URL using .htaccess redirect Redirect www to non-www: [sourcecode language="plain"] RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.justwebdevelopment.com [NC] RewriteRule ^(.*)$…
Read More

Add New Field to Magento Contact Form

Magento
In magento default contact us form provide only four fileds information like Name, Email, Telephone and comment but some time need to more information for contact form it's depends on bussiness model and criteria. If you want to add new field or need more inforation about the user from contact us so this artical to be helpfull to you. Below are the step how to add new field in magento contact us form. This example to show you how to add extra input type field in magento contact us form. Step 1: Add field to phtml file Go to app -> design -> frontend -> yourpackage -> yourtheme -> template -> contacts -> form.phtml If you want to add required field: [sourcecode language="plain"] <li> <label for="email"><em>*</em><?php echo Mage::helper('contacts')->__('Company Name') ?></label>…
Read More

How to show latest tweet on magento site

Magento
Display latest tweet on magento site without any extension. Twitter is most popular social networking site in a day.Using this code publish their Twitter account posts directly onto any section of their Magento store.This is a fast and effective way to keep your website up to date with relevant information. Once integrated, messages are able to appear directly into a designated section of your website and will appear in real-time as soon as the messages are posted. Benefit of twitter integrate into magento store Keep your Magento store live with fresh information via Twitter data feeds Fast and effective way to integrate your Magento store with Twitter Keep your website up to date with relevant information posts Step 1: Create magento_tweet.phtml from catalog/product/magento_tweet.phtml [php] <?php function getTime($time){ $tweetdate = $time;…
Read More

How to show popular posts in wordpress

Wordpress
Here I want to tech you how to get popular posts based on that post comment in wordpress withaout plugin. Display popular posts without plugin in wordpress | Get popular posts without plugin in wordpress To show lists of the popular posts in wordpress is very usefull features for getting post popularity wise or SEO to increase visitor or provide better output to the user. Many plugins are available to get popular posts in wordpress but here I want to show you how to get popular posts in wordpress without plugins. Opent function.php file and put it below code into them. [php] # Displays a list of popular posts <?php function dp_popular_posts($num, $pre='<li>', $suf='</li>', $excerpt=false) { global $wpdb; $querystr = "SELECT $wpdb->posts.post_title, $wpdb->posts.ID, $wpdb->posts.post_content FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish'…
Read More

How I can get theme URL in wordpress

Wordpress
I want to get my wordpress theme URL to display image.Below is the code to get wordpress current theme URL. This function will return the theme directory URL so you can use it in other functions: [sourcecode language="plain"] get_bloginfo('template_directory'); [/sourcecode] Alternatively, this function will echo the theme directory URL to the browser: [sourcecode language="plain"] bloginfo('template_directory'); [/sourcecode] So an example for an image in the themes images/headers folder would be: [sourcecode language="plain"] <img src="<?php bloginfo('template_directory'); ?>/images/headers/image.jpg" /> [/sourcecode] [JWD-Wordpress-Development]
Read More

Please check for sufficient write file permissions in magento connect manager

Magento
If you want to use install any other magento extension or upgrade your mangeto from magento connect manager its really very easy to do that. You can find really some great extensions some are paid and some are free from magento commerce site.Find extension that interest you, click "Get extension key", agree with license agreement and get key. But some times you want use magento connect manager and its display error like "Please check for sufficient write file permissions". Magento Connect requires write permissions to the Magento files in order to install new extensions or upgrade the software to a new version. You can change your file/folder permissions either thru your FTP Client (like FileZilla) OR thru a SSH client (like Putty). Go inside your Magento folder & change permissions…
Read More