CSS3 Tooltip

/* Tooltip hover effect for wishlist start */

.wishlist_div .add-to-links a{
    position: relative;
    display: inline-block;
    
}
.wishlist_div .add-to-links a:before {
    visibility: visible;
    content: "ADDED TO WISHLIST";
    font-size: 9px;
    text-transform: none;
    position: absolute;
    width: 108px;
    background-color: #a41103;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    z-index: 1;
    top: 131%;
    right: -216%;
    line-height: 20px;
    transition: opacity 1s;
    font-family: opsemi;
}
.wishlist_div .add-to-links a:after {
    content: "";
    position: absolute;
    top: 13px;
    right: 0px;
    margin-left: 0px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent #a41103 transparent;
   
    
} 
/* Tooltip hover effect for wishlist end */


/*
* if you want to change tooltip small icon different angle.just change this line:

up: border-color: transparent transparent #a41103 transparent;
down: border-color: #e74c3c transparent transparent transparent;
left: border-color:  transparent #a41103 transparent transparent;
left: border-color:  transparent transparent transparent #a41103;

*/

Shown as following example:
tooltrip-

Catalogsearch form:

Catalogsearch > form.mini.phtml


$category = Mage::getModel('catalog/category');
if (is_object(Mage::registry('current_category'))) {
    $current_category_path = Mage::registry('current_category')->getPathIds();
} else {
    $current_category_path = array();
}
$category->load(Mage::app()->getStore()->getRootCategoryId());
$children_string = $category->getChildren();
$children = explode(',', $children_string);
$extra_options = '';
foreach ($children as $c) {
    $selected = (in_array($c, $current_category_path)) ? 'SELECTED' : '';
    $extra_options.= '<option value="' . $c . '" ' . $selected . '>' . $category->load($c)->getName() . '</option>' . "\n";
}
?>
 
<form id="search_mini_form" action="<?php echo $this->helper('catalogSearch')->getResultUrl() ?>" method="get">
    <fieldset>
        <legend><?php echo $this->__('Search Site') ?></legend>
        <span style="float: left; position: relative; top: 8px; left: 15px;">Search</span>
        <div class="mini-search">
            <select name="cat" id="cat" class="input-text">
                <option value="">All Products</option>
                <?= $extra_options ?>
            </select>
            <input id="search" type="text" class="input-text" name="<?php echo $this->helper('catalogSearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogSearch')->getEscapedQueryText() ?>"  placeholder="<?php echo $this->quoteEscape($this->__('Search entire store here...')) ?>" />
            <button type="submit" title="<?php echo $this->quoteEscape($this->__('Search')) ?>" class="button search-button" value="Go"><span><span><?php echo $this->__('Search') ?></span></span></button>
            <div id="search_autocomplete" class="search-autocomplete"></div>
            <script type="text/javascript">
                //<![CDATA[
                var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search your products') ?>');
                searchForm.initAutocomplete('<?php echo $this->helper('catalogSearch')->getSuggestUrl() ?>', 'search_autocomplete');
                //]]>
            </script>
        </div>
    </fieldset>
</form>




Installation Problem:

|| Fatal error: Uncaught Error: Function name must be a string in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php:555

$out .= $this->getBlock($callback[0])->$callback[1]();

to

$out .= $this->getBlock($callback[0])->{$callback[1]}();

|| Maximum execution time of 30 seconds exceeded in magento installation.

/* solve */
go to xampp/php/php.ini and search by 

max_execution_time=30  replace to 600
max_input_time=60      replace to 600
memory_limit=128M      replace to 1000m

|| PHP extension soap must be loaded

I edited php.ini and removed the leading semicolon ( ; ) from extension=php_soap.dll.
After restarting Apache I was able to proceed with the installation without any other issues.

Upgrade magento from 1.7 to latest 1.9.2.4

1st way to upgrade :

Use the Magento Connect method:
Within each Magento installation, you can easily upgrade Magento via Magento Connect. The steps to upgrade via Magento Connect include:

  • Login to the Magento admin
  • Move to system- Magento Connect- Connect manager
  • Login to Magento Connect
  • Click on ‘check for upgrades’
  • Upgrade ‘Mage _All_Latest’. This will upgrade Magento.

2nd way to upgrade:

  1. Take a backup of current database and current 1.7 code. place maintenance.flag file inside 1.7 code folder to put website offline.
  2. Download latest magento from the http://www.magentocommerce.com/download
  3. Remove all folders and files from your 1.7 code except maintenance.flag (but you should have backup somewhere) and place all folders and files from the 1.9.
  4. Now from your 1.7 merge your following custom folders into the 1.9
    • Community app/code/community
    • Local app/code/local
    • Media
    • your theme or package (app/design/frontend/default/<your theme> or app/design/frontend/<your package>)
    • custom folders from Skin (both for adminhtml and frontend).
    • copy your custom xml files from app/etc/modules/ to current app/etc/modules/
    • any custom admin theme folder from adminhtml/default/yourtheme.
    • copy your custom folders from adminhtml/default/default/ (1.7) to adminhtml/default/default/ (1.9).
    • custom js files if any from app/js/.
  5. Now go to app/etc/local.xml.Edit database details their.put your database username and password and database name.
  6. Remove maintenance.flag file and check the site in the browser. it is done.

Python Basic Learning

What is Python:
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.

Python Interactive shell
At first we will learn python interactive shell uses. You can start interpreter from IDLE.

Python interpreter:
The Python interpreter is a command line program:

>>> print 'hello world'
Hello world
>>> 2+2
4
>>> 50-20
30
>>> 5*5
25
>>> 30/6
5
>>> x = 5
>>> y = 10
>>> print x+y
15

Comments:
Single line comment: A single line comment starts with the number sign (#) character:

# This is a comment
print('Hello')

Multiline comment: Multiple lines can be created by repeating the number sign several times:

# This is a comment
# second line
# 3rd line
print('Hello')

Variables in Python can hold text and numbers.

var = 2
hello = 2.5
country = 'Bangladesh'

type() is a function:

>>> country = "Bangladesh"
>>> print country
Bangladesh
>>> type(country)
<type 'str'>
>>> var = 2.5
>>> print var
2.5
>>> type(var)
<type 'float'>

if you want to exit from python interactive shell

exit()

String uses: Strings in Python can be defined using quote symbols

>>> country = "Bangladesh"
>>> print country
Bangladesh
>>> str = "Adam's"
>>> print str
Adam's
>>> hello = 'Adam\'s'
>>> print hello
Adam's
>>> 

Accesing array elements: You may access character elements of a string using the brackets symbol. Computers start counting from zero

>>> country = "Bangladesh"
>>> print country [0]
B
>>> print country [2]
n
>>> 

String length: builtin function len()

>>> len(country)
10
>>> print country [9]
h

Let us look at some string operations. We can add two string

>>> country = 'Bangla' + 'desh'
>>> country
'Bangladesh'
>>> 

The string did not have anything, that i can do with find() method.

>>> country.find('Bangla')
0
>>> country.find('desh')
6
>>>

Browser specific CSS rules

|| Google Chrome (version 28+):

@supports (-webkit-appearance:none) {
    nav.tm_navbar {
        background: green;
    }
}       

|| Mozilla Firefox (all versions):

_:-moz-tree-row(hover), nav.tm_navbar {
    background: red;
}       


|| Internet Explorer (version 10+):

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    nav.tm_navbar {
        background: blue;
    }
}     

Magento mysql dump file

Importing phpMyAdmin Database Dump File

When importing a MySQL dump file that’s been generated using phpMyAdmin, you need to put the following at the beginning of the file:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;


And the following at the end of the file:

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;

htaccess issue

Warning:
Your account has been abusing CPU resources for an extended period of time. As a result all of your sites have been cached in order to ensure continued performance stability of the server. While we do limit each account to no more than 25% of a system’s CPU in our terms of service, we do not actively take actions against accounts until they greatly exceed that number, which is what happened in this case.

Feedback:
Aye, I checked those sites and found that they both had PHP suspensions. What’s more, both of them had also suffered Magento brutes, like gsnsagro. I went ahead and applied the same mitigation to those two sites, as well as to every other one of your resolds that had a public_html/downloader/.htaccess , and lifted both of those suspensions. There are no other suspensions on any of your accounts at this time. There are 16 total attack blocks in place:

home/apdhaka/public_html/downloader/.htaccess /
home/rajshahi/public_html/downloader/.htaccess /
home/stepfash/public_html/downloader/.htaccess

All of these containing an efficient block of requests that lack an HTTP User Agent:

ErrorDocument 416 “Requested Range Not Satisfiable”
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* – [R=416,L]

WordPress: SQL Error when importing database

Question: I’m developing a site locally on XAMPP with SQL 5.6.21. When I attempt to import the database to a server using an older version of SQL I get the following error: “#1273 – Unknown collation: ‘utf8mb4_unicode_ci’”

Answer: That’s not exactly a WordPress problems, and it would be easier to upgrade MySQL on the server, to be honest.
You need MySQL 5.5.3 or higher to support the utf8mb4_unicode_ci collation.
Have you contacted your hosting provider?
Alternatively, you can try changing your collation to utf8_general_ci but that might cause character encoding problems with the existing data.