July 17, 2014

SVG - Scalable Vector Graphics

SVG Intro


Scalable Vector Graphics is a graphical format in which user/customer/developer can make their shapes using XML. 
The XML is then rendered by an SVG viewer. Today most web browser can display SVG just like they can display PNG, GIF, and JPG.
All the most browsers support SVG such as IE 9+, Chrome and Firefox.
SVG have capability for building graphs, country maps , all types of shapes.

Deck display in one by one is one of the practical example.
Here is the quick example:

<svg xmlns="http://www.w3.org/2014/svg" version="1.1" width="150" height="150">        
        <rect x="20" y="20" height="70" width="50" style="stroke: #000000; fill: #00ffff;"/> 
<rect x="40" y="40" height="70" width="50" style="stroke: #000000; fill: #00ffff;"/>
<rect x="60" y="60" height="70" width="50" style="stroke: #000000; fill: #00ffff;"/>
</svg>

you have to put the code with in SVG tag. So browser identifies SVG tag element easily. Otherwise it won't work.
Place this code in browser in html div and run in browser.

SVG Editor in case if you want to use.
https://petercollingridge.appspot.com/svg-editor

Thanks
Enjoy coding in the area of Computer Web Graphics.

April 25, 2014

Magento : Currently running Store info (getStore() info)

// To fetch the current store information 
$_storeInfo = Mage::app()->getStore(); 

Zend_Debug::dump($_storeInfo ->debug());
You can do debugging for all the collections. This will help you a lot in all the case.
 
// To fetch the current store id 
$_storeId = Mage::app()->getStore()->getStoreId(); 

// To fetch the current store code 
$_storeCode = Mage::app()->getStore()->getCode(); 

// To fetch the current store's group id 
$_storeGroupId = Mage::app()->getStore()->getGroupId(); 

// To fetch the current store's name 
$_storeName = Mage::app()->getStore()->getName(); 

// To fetch the current store's sort order 
$_storeOrder = Mage::app()->getStore()->getSortOrder(); 

// To fetch the current store's status 
$_storeStatus = Mage::app()->getStore()->getIsActive(); 

// To fetch the current store's locale 
$_storeCode = Mage::app()->getStore()->getLocaleCode(); 

// To fetch the current website id 
$_websiteId = Mage::app()->getStore()->getWebsiteId(); 

// To fetch the current store's home url 
$_storeHomeUrl = Mage::app()->getStore()->getHomeUrl();

February 26, 2014

Vanity URL in social media for branding objectives

Vanity URL


A vanity URL is an unique web address associated with website address that is useful for marketing objectives.

One of main advantage of vanity URL is that customer can identify owner name in main website/domain address in postfix form.

So they can judge out properly by clicking on vanity url.

Therefore your vanity URLs should be easy to remember, use, and share.

February 19, 2014

Comparison between Magento and Prestashop.

Magento versus PrestaShop

How to know which is the best e-Commerce platform?

In market there are lots of e-commerce platform rather than these two such as Virtuemart, Lemonstand, Volusion, Merchandizer, Big Commerce, Shopify, Opencart, Cubecart, Storesprite but which fits in your needs and pocket that depends on respective requirements.

But most widely used in market are Magento and PrestaShop.

Most merchants are confusing about to select which platform. We have done comparison between Prestashop and Magento along with the details. It contains the features, customization, functionality, themes related etc.

Topic
PrestaShop
Magento
Release
Mid 2007
2008
Products /Edition
One software contains more than 300 features.
Editions like Magento go, enterprise edition, community edition.
Pricing
Basic version is free but additionally has paid modules.
Community edition is free but enterprise and go is paid.
Good enough to set up for an online store with rich features

Written Language(Coding Framework)
PHP and Smarty Template Engine
PHP and Zend  Framework and MVC architecture


Database engine
MySQL
MYSQL, use EAV to store data
Language Support
More than 50 Language, need API
API needed.
No of Downloads
Above 3 Million
Above 5 Million
SEO Compatibility
Useful for small biz
Better support compare to PS
Rich SEO implementation and features
Tech support
PrestaShop community and its forums
Magento having large tech support and community help
Design integration/Theme Integration
Ease compare to Magento
Complicated
Open source License
Yes under OSL ( Open Software License  ) 3.0
Under OSL 3.0
Payment Gateway
Paypal, Authorize .Net, Google Check out, Direct Pay,
Paypal, Authorize .Net, Google Check out, Direct Pay and additionally Authorize Emulator.
Currency
Supportive
Supports
Android/iPad/iPod – Responsive purpose
Ease of use and implementation
Little complex




  
The above blog will help you to judge out between two platforms mentioned. It’s totally based on
 needs of the user/customer. Above mention data may be vary is only for information.


Sources:
           Magento       - http://www.magentocommerce.com/
           Magento       - http://www.magento.com/
           Prestashop    - http://www.prestashop.com/en/
                               




February 18, 2014

Remove login from phpmyadmin in wamp server or disable admin login in mysql

Get rid of phpmyadmin login 

If you want to use phpmyadmin without cookie limit and want to get rid of login credentials.

Heres is the tip for those:

Go to the wamp installation directory

C:\wamp\apps\phpmyadmin** 

** version numbers that may be different.

Find the config.inc.php and take back up of it to save for the future use.

Open config.inc.php in any text editor (i.e. notepad, notepad++)

Go to the authentication section type.
/* Authentication type */
You will find the $cfg array(mostly 3 dimensional array.).

Do change as follows:
Change the auth type value to config.
                     // $cfg['Servers'][$i]['auth_type'] = 'cookie';

$cfg['Servers'][$i]['auth_type'] = 'config';

Now speciy the user and password for same like below:

Add the following lines/params in /*Server parameters section*/ which is generally next to authentication type:

$cfg['Servers'][$i]['user'] = 'root';
  /*User name during installation*/
$cfg['Servers'][$i]['password'] = ' ';           /*Password during installtion generally blank*/
$cfg['Servers'][$i]['AllowRoot'] = TRUE;   

February 13, 2014

How to add Java Script to smarty template file

{literal}

In smarty, how can you add Javascript to template file.
You just have to use built-in-function named literal.

{literal} tags allow a block of data to be taken literally from the template file. 
Simple logic is there, {literal}{/literal} tags is not interpreted, but whatever we have written within code it will display same.

Syntax:
{literal}

/* Some java script code */

{/literal}
e.g.

<script type="text/javascript">
  function callHello() { 
alert('hello world. !!');   
   }
</script>

Cheers :).

February 12, 2014

How to access WAMP server in Local Area Network or LAN

Wamp server access.

Access WAMP server in LAN

Wamp allow access from LAN / How to access WAMP server in Local Area Network/
Access wamp server from different computer in LAN

It is the matter with the apache configuartion.
Initially, WAMP only allows access to the website from the local host/that System name. 

You need to modify http configuration file that can be accessed by Left clicking on wamp icon.
Select Apache from menu and Click on http.conf file.

DocumentRoot "D:/wamp/www"
<Directory "D:/wamp/www">
You have to access directory to localhost to allow all.
In directory tag,  find the line which says "Allow from 127.0.0.1" Change this line to "Allow from all".

Restart your wamp server.

Cheers . :)






February 11, 2014

Removing index.php from Magento URL

How to Remove .php extension from Magento URL
Here is the solution to remove magento url.

You need to enable mod_rewrite apache server.
Log in to magento admin area.
After that Select System(Probably last menu item) -> Choose Configuration.
Now from left menu panel, under General Section, select web option,
Then in Search Engines Optimization,
Set use web server rewrites to yes.
click on Save configuration to save.

Then Go to the Cache Management under System menu 
Flush magento cache and flush cache storage .
refresh and check the site.

Cherrs  :).

February 06, 2014

How to set Yii description tag and Meta keywords

Here I have put some stuff on how to set yii description tag and meta tag in head tag.

You can use as follows:

<?php 

//Setting yii Description

Yii::app()->clientScript->registerMetaTag('Welcome to Yii Description -  Yii frameworrk', 'description', null, array('lang' => 'en'));

// Setting yii set keywords

Yii::app()->clientScript->registerMetaTag('yii, php framework', 'keywords', null, array('lang' => 'en'));

?>


All you need to register is meta as simple we do in normal web page head struture.

January 23, 2014

Yii remove index.php from URL and SEO URL tips


This one is using for removing index.php and also remove site portion from URL.

I am trying to remove index.php from the URL string for so many times. Finally i got some cases in which i want to share with you guys.


Verify mod_rewrite is enabled in your server you can check it to load php.ini file.

Just copied following code and paste into urlManager in main.php
Here's what I put under components file main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
//'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'/'=>'site/index',
'blog'=>'post/index',
'<view:(about)>'=>'site/page',
'contact'=>'site/contact',
'login'=>'site/login',
),
//'urlSuffix'=>'.html',
),

Also,
You can make your own rule to your web page need:
Here, i have changed site/login to login and site/contact to contact.
Also , post/index to blog as you can see in the rules array.

Hope this is one helps you in many ways.





January 09, 2014

Session Variables in Magento


Following are main of the session variables. 

1. First one is about getting information regardng core session data for magento.
Core Session :- Mage::getSingleton(‘core/session’) 

2. Customer session is for getting details associated with the customer data that is currently in session.
You can play with customer session data in shopping cart in the case of one page check out or another kind of. 
Customer Session :- Mage::getSingleton(‘customer/session’);

3 .Admin session gives you information regarding admin session related with admin modules and permisssions.
You have to back up your source code before using this session. This is very important. 
Admin Session :- Mage::getSingleton(‘adminhtml/session’) 

4. Shopping cart session determines that you can get info about various products in shopping cart and customer data. 
Shopping Cart Session :- Mage::getSingleton(‘checkout/session’)->getQuote() 

User defined session variables: 
How to set a session variable in Magento : 
$data = 'Hello heaven welcomes you.'; 
 Mage::getSingleton('core/session')->setMyData($data); 
OR 
Mage::getSingleton('core/session')->setData('my_data', $data); 

How to get a session variable in Magento: 
$string_data = Mage::getSingleton('core/session')->getMyData(); 
OR
$string_data = Mage::getSingleton('core/session')->getData('my_data'); 

var_dump($string_data ); 

January 07, 2014

Magento Admin CMS Pages not showing in admin panel

This might be complicated if you have deleted german, french store etc.
Then or else you will receive error 404 while loading CMS pages in admin panel.

To solve this,

Get Turn on Error log on by renaming file named local.xml.sample to local.xml in errors directory

Now, Run following query in mysql window.

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

Check your cms_page_store table in database. 
Also, fire this query in window.

DELETE FROM cms_page_store WHERE store_id NOT IN (SELECT store_id FROM core_store)

January 06, 2014

Magento Admin Access Alternate way :: Admin Password Encryption - Decryption

Hello Everyone,

Here the tip for magento admin access.
Go to "app/code/core/Mage/Admin/Model/User.php"

Now, Comes to authenticate method around 325 line no.
You will find this code in this method.
Just comment on it.

/*if ($sensitive && $this->getId() && Mage::helper('core')->validateHash($password, $this->getPassword())) {
                if ($this->getIsActive() != '1') {
                    Mage::throwException(Mage::helper('adminhtml')->__('This account is inactive.'));
                }
                if (!$this->hasAssigned2Role($this->getId())) {
                    Mage::throwException(Mage::helper('adminhtml')->__('Access denied.'));
                }
                $result = true;
           }*/
....................................................................................................

After comment on said condition,

Just write following code before Mage::dispatchEvent('admin_user_authenticate_after', array(); 

$result = true; 
Mage::dispatchEvent('admin_user_authenticate_after', array();

You have access for admin just entering valid username.

Enjoying.

Cheers :)