Google Analytics individual qualification exam

Got the Google Analytics individual qualification exam – certification

Google Partners – Certification

https://www.google.com/partners/?authuser=0#p_profile

Advertisements

Adding new custom image attribute to category in dashboard

Magento : Add custom image attribute to category
Magento : Add custom image attribute to category

Just copy paste the below code in header.phtml and run yourmagento once, your attribute will be created and you can see in backend under manage category. After you are done remove this code again.

——————————————————————————————
$setup = new Mage_Eav_Model_Entity_Setup(‘core_setup’);

$setup->addAttribute(‘catalog_category’, ‘sliderimage’, array(
‘group’ => ‘General’,
‘input’ => ‘image’,
‘type’ => ‘varchar’,
‘label’ => ‘Slider Image’,
‘backend’ => ‘catalog/category_attribute_backend_image’,
‘visible’ => 1,
‘required’ => 0,
‘user_defined’ => 1,
‘global’ => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

Its works, Thanks to Afroz Alam http://developerafroz.blogspot.in/

how to find the mysql hostname in terminal(SSH)

If you want to know the port number of your local host on which Mysql is running you can use this query on MySQL Command line client —

SHOW VARIABLES WHERE Variable_name = ‘port’;

mysql> SHOW VARIABLES WHERE Variable_name = ‘port’;

+—————+——-+

| Variable_name | Value |

+—————+——-+

| port          | 3306  |

+—————+——-+

1 row in set (0.00 sec)

It will give you the port number on which MySQL is running.

If you want to know the hostname of your Mysql you can use this query on MySQL Command line client —

SHOW VARIABLES WHERE Variable_name = ‘hostname’;

mysql> SHOW VARIABLES WHERE Variable_name = ‘hostname’;

+——————-+——-+

| Variable_name     | Value |

+——————-+——-+

| hostname          | Dell  |

+——————-+——-+

1 row in set (0.00 sec)

It will give you the hostname for mysql.

If you want to know the username of your Mysql you can use this query on MySQL Command line client —

select user();   

mysql> select user();

+—————-+

| user()         |

+—————-+

| root@localhost |

+—————-+

1 row in set (0.00 sec)

default-username = root password = you-know-it-better url for localhost = jdbc:mysql://localhost default-port = 3306

    For example, you can try:

//If you want to get user, you need start query in your mysql:

SELECT user(); // output your user: root@localhost

SELECT system_user(); // —

//If you want to get port your “mysql://user:pass@hostname:port/db”

SELECT @@port; //3306 is default

//If you want hostname your db, you can execute query

SELECT @@hostname;

mysql> SHOW VARIABLES WHERE Variable_name = ‘hostname’;

+—————+———–+

| Variable_name | Value     |

+—————+———–+

| hostname      | karola-pc |

+—————+———–+

1 row in set (0.00 sec)

Hope it will Help you to understand

To enable gZip in Magento 1.9

Kindly include the following code inside the .htaccess file

 <IfModule mod_headers.c>
# YEAR
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header set Cache-Control "max-age=29030400"
</FilesMatch>
# WEEK
<FilesMatch "\.(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# 45 MIN
<FilesMatch "\.(html|htm|txt)$">
Header set Cache-Control "max-age=86400"
</FilesMatch>
</IfModule>

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl|asp|html)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

 

Manually Changing Domain in Magento

How to Manually Change Domain in Magento

  1. Update your core_config_data table to edit the two records for web/unsecure/base_urland web/secure/base_url
  2. Delete the contents of WEBROOT/var/cache
  3. Update / edit any .htaccess domain redirects you may have added
  4. Restart Apache
  5. Make sure Apache has write permissions to WEBROOT/var
  6. If you created a new DB, ensure that the WEBROOT/app/etc/local.xml is pointing to it.
  7. If you’re using Chrome, clear your browser cache! (Chrome caches 301s)

You can remove the index.php in the frontend URLs performing the following steps:

Go to the admin section of Magento.

  1. In System -> Configuration -> Web -> Search Engines Optimizations, select YES.
  2. In System -> Configuration -> Web -> Secure -> Use secure URLs in the frontend, select YES.
  3. Edit the /installdir/apps/magento/htdocs/.htaccess and uncomment the line:

    RewriteBase /magento/