Wednesday, December 21, 2011

Magento Speed Boost Up with Nitrogento

Speeding up in magento is most important key factor. Every Merchant needs that there site should run as fast so that user may not leave there site.
Nitrogento will help to boost up the performance of the Magento store

Features of Nitrogento
  • Full Page Cache for Community Edition
  • Bloc caching of 8 new entries (footer, etc.)
  • Custom bloc cache:put your block in cache
  • Auto Sprite & theme patching
  • Auto deployment of CDN & theme patching
  • Minify & Compression of JS and CSS
  • Htaccess settings (activate browser cache)
  • Simple use: setup & controlled from B.O
So get a free trail version of Nitrogento and then check your result   

Magento Easy Tabs

Now adding the tabs in your theme became easy
The new Magento easy tabs will help you to add the tabs directly through admin
Download Extension key from here.

Note:It will override your catalog related files for example view.phtml file will be overwritten by the easy tabs catalogproductview.phtml so,make sure that you take the backup and then procced

Sunday, December 18, 2011

Magento Change admin URL

For security reason now it became useful to change the url of the admin
Follow the steps to change the url
Open app/etc/local.xml
Find the following
<admin>
    <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
</admin>

Change
<frontName><![CDATA[admin]]></frontName>
to your name which u have think

 Like below:
<frontName><![CDATA[editname]]></frontName>

hope this will help you

Magento admin problem

Many times it happen developer can't able to Login into the Admin even though they have entered the correct username and password
so here is the solution

1) Use 127.0.0.1 instead of localhost in your url, i.e. using
http://127.0.0.1/magento/index.php/admin instead of
http://localhost/magento/index.php/admin . we  think it will not solve our problem.
2) Running on Windows XP, I was suggested to open “host” file from
C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost
or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.
3) This solution finally helped us out of this problem. The solution was to modify the core
Magento code. Open
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the
lines 80 to 83. The line number may vary according to the Magento version. But these lines
are present somewhere near line 80. You have to comment the comma (,) in line: $this-
>getCookie()->getPath()//,
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
It will help you 

Invoicera Order and Invoice Connector Maximize

For Magento Community Edition
This Extension allow to send the Invoice with Invoicera in real time to the customer as soon as the order had been placed
This will your Return on Investment (ROI).for nay other update related to this extension check blog

No Browse Files or Upload Images Buttons

Sometimes Magento  not able to show Browse Files or Upload Images Buttons in the Product page 
so developer spend lot of time to fix this
Here is the easy solution
Just click on  the following link and install the extension key in your magneto connect and clear the cache and check for the product page browser button will be there

Sunday, December 11, 2011

Magento Date

As we known we are setting Magento date and time through admin which is  configured from the backend (System > Configuration > General > Locale Options > Timezone) for formatting/displaying date/time.

We used in PHP
<?php
$currenttime = time()
echo $date = date(d-m-Y,$currenttime);
?>

We used for magento
<?php
$currenttime = Mage::getModel('core/date')->timestamp();
echo $date = date(d-m-Y,$currenttime);
?>

Display ccurrent date
<?php echo $curent date = Mage::getModel('core/date')->date(d-m-Y); ?>

Predefined date formatting
<?php
$date = '12-12-2012';
Mage::helper('core')->formatDate($date,'medium',fasle);?>

Note: Mage_Core_Helper_Data::format() has following arguments
public function formatDate($date=null, $format='short', $showTime=false)
{
....
}

Short Rules of XML


If you're not familiar with it, upon encountering Magento's XML-based layout updates, you may have a question or two about the rules you must follow when modifying an XML file.
Only two set of rule need to remember with XML  is that when a tag opens, it must either be followed by a
closing tag (<xml_tag></xml_tag>) or 
self-close tag (<xml_tag/>) exactly as (X)HTML file tags would.

Creating CSS buttons vs Image buttons

Copy the image of proceed to checkout , or save the image in your PSD  your preferred file format, and save it in your magento directory skin/frontend/default/default/images

The HTML
Let’s take “Proceed to Checkout” image button in the shopping cart for the occasion (it can be found in app/design/frontend/default/default/template/checkout/onepage/link.phtml in the Magento folder structure)

<a href="<?=$this->getCheckoutUrl()?>"><img src="<?=$this->getSkinUrl('images/btn_proceed_to_checkout.gif')?>" alt="<?=__('Proceed to Checkout')?>"/>
</a>

HTML for CSS button - change the style of the button with just a swap of the background

<a class="img-btn btn-checkout" href="<?php echo $this->getCheckoutUrl()?>">
<span><?php echo Mage::helper('checkout')->__('Proceed to Checkout');?>
</span>
</a>

Swap out the ‘HTML for Image button’ code with the ‘HTML for CSS button’ code.
Note: The ‘img-btn’ class in the HTML just serves to unite all the CSS buttons in case you want to synchronize the font colors and sizes..etc.

The CSS
.btn-checkout {
    display:block;
    float:right;
    background:transparent url(../images/btn_proceed_to_checkout_rad.gif) no-repeat 100% 0;
    font-size:15px;
    font-weight:bold;
    padding-right:8px;
    }
.btn-checkout, .btn-checkout:hover {
    color:#fef5e5;
    text-decoration:none;
    }
.btn-checkout span {
    display:block;
    padding:0 17px 0 25px;
    background:transparent url(../images/btn_proceed_to_checkout_bg.gif) no-repeat;
    line-height:40px;
    }
And there you have it! - An all CSS-powered button.

<a class="img-btn btn-checkout" href="<?php echo $this->getCheckoutUrl()?>">
<span><?php echo $this->__('Proceed to Checkout')?>
</span>
</a>
And then it worked well... :)

Apply on the Place Order button
copy the file app/design/frontend/default/default/template/checkout/onepage/review.phtml in your design path, and replace :

<input type="image" src="<?php echo $this->getSkinUrl('images/btn_place_order.gif') ?>" onclick="review.save();" value="<?php echo $this->__('Place Order') ?>" />
to :

<a class="img-btn btn-checkout" href="#" onclick="review.save();"><span><?php echo $this->__('Place Order') ;?></span></a>
The “Place Order” button is now css powered and can be translated easily!

just apply and check with your own button image

Saturday, December 10, 2011

Magento New Facebook theme

Magento Facebook App is a marvelous extension which allows you to integrate social shopping via Facebook. This extension enables your customer to shop from your product catalogue that is available on your magento store through your Facebook profile

Speed up the Magento

One of the most important key factor in website is the speed performance.Some people think that with magento speed get slow
Here are some useful tips to speed up the magento and make it run fast

Enable Caching
Caching is enabled by default. So just don’t turn it off, unless really necessary, i.e. for development purposes.

Use a PHP Accelerator such as APC
Using a PHP Accelerator is now a necessity. If you use Ubuntu, installing APC is very simple:
sudo aptitude install php5-apc

It will be enable automatically.
For Magento installation in your web hosting, make sure to enable APC in php.ini configuration file by adding:
extension = apc.so

Magento Compilation

Many people are not aware of the Magento Compilation For Speeding up the Performance Magento Compilation tools is the best tools

The System → Tools → Compilation option allows you to compile all files of a Magento installation in order to create a single include path to increase performance.
In order to use this tool, the directory includes and the file includes/config.php must both be writeable.

Note: As it is important tools for Speed up the Performance but Some times it will break your website. You will be unable to view the frontend of backend of your magento website. you will need to turn this off through the magento core files. To do this you will need to:

disable and comment out the following in includes/config.php

#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);

change to

#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
#define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);

it will fix Your issues

Thursday, December 1, 2011

Magento uses Zend to prepare query

As Many people are confuse with the database query. Just have a look how the Magento uses zend to run the query
As you have notice that ResourceModel files in Magento doesnot uses the Plain my sql.They are using(prpearing) from the Zend_Db.This means that Magento is using Zend for handling requests.

$read = Mage::getSingleton('core/resource')->getConnection('core_read');
echo get_class($read);


You will get the class as Varien_Db_Adapter_Pdo_Mysql which is an extension of Zend_Db_Adapter Abstract. You can create an instance of a Zend_Db_Select object using the select() method of a Zend_Db_Adapter_Abstract object. This can be used to build ‘SELECT’ queries. When building the query, you can add clauses of the query one by one. There is a separate method to add each clause to the Zend_Db_Select object. For example:


To Build this query:
“SELECT product_id, product_name, price FROM “products” WHERE price > 100.00″ //this is not a magento query


We can write:
$select = $read->select()->from(‘products’, array(‘product_id’, ‘product_name’, ‘price’))->where(‘price > 100.00′);

Tuesday, November 29, 2011

Magento Product ID and Attribute value


How to get all the ID of product in one page

$model = Mage::getModel('catalog/product'); //getting product model

$collection = $model->getCollection(); //products collection

foreach ($collection as $product) //loop for getting products
{
    echo $product->getId();

}

How to get the attribute value of any attribute name in any page 

$_Products = Mage::getSingleton('checkout/cart')->getQuote()->getAllItems();

foreach ($_Products as $value){

$item_ID = $value->getProductId();

$_Product = Mage::getModel('catalog/product')->load($item_ID);

$checkfree = $_Product->getAttributeText('your_attribute_code');

echo $checkfree; //to getthe attribute value of free shipping

}

Sunday, November 27, 2011

Magento MVC

MVC(Model view Controller)

Model(M):As the name refer Model which will store the businees logic i.e database connection or connection to datasources.Magento uses the model folder for every module whether it is in core,local,community

View(C):The view refer to presentaion logic i.e templating and caching  which will display to the end user.Magento having .phtml and with help of Xml it produce output to the user

Controllers(C): Controller are the  iles which decides the actions between model and view files what output to be generated these files are under controller folder and manages the url structure for magento.In magento if you will not define the Controller it will redirect to 404 page.

In Simple way to understand the MVC take example CAR

Model: Other Input from the Model

View :Interior and Exterior features of the car

Controller: Input from the user like applying break,staring,horn etc...

Magento: Attribute feature

Magento Class Instances  and Attribute Value
  1. getData = Relevant Data from object
  2. getSingleton = If you are using getSingleton you are calling already instance object
  3. getModel = Instance of Class Ex: $product = Mage::getModel('catalog/product');
  4. getChildHtml = Calling Block of Block of Block
  5. $attribute = $_product->getResource()->getAttribute('your_attribute_id'); (Get Attribute Collection) 
  6. $attribute->getAttributeType()  (Get Attribute type)
  7. $attribute->getFrontendLabel()  (Get Attribute Label)
  8. $attribute->getDefaultValue()    (Get Attribute Value)
  9. $attribute->getIsVisible()          (Get Attribute is Visible)    
  10. $attribute->getIsRequired()      (Get Attribute is Required)

Magento Related

Resource Model
$resource = Mage::getSingleton('core/resource');

Read Connection
$read = $resource->getConnection('core_read');

Write Connection
$write = $resource->getConnection('core_write');

Get Table Name
$table = $resource->getTableName('catalog_product_entity');

Get Table Name from Entity Name
$table = $resource->getTableName('catalog/product');

Friday, November 25, 2011

Magento Model Collection

Magento data collection inhert from the object
public function productAction()
{
$collection_of_products = Mage::getModel('catalog/product')->getCollection();
var_dump($collection_of_products->getFirstItem()->getData());
}

Most Magento Model objects have a method named getCollection which will return a collection that, by default, is initialized to return every Object of that type in the system.

The products Collection, as well as many other Magento Collections, also have the Varien_Data_Collection_Db class in their ancestor chain if you want to see the select statement your Collection is using

Magento upgrade through Magento connect


Following are the steps for upgrading from Magento 1.5.1.0 to this latest version of magento (Via Connect Manager):

  1. Open Magento Connect Manager by navigating to System > Magento Connect > Magento Connect Manager.
  2. After that fill your username and password used to access the admin panel.
  3. Click check for upgrades in Magento Connect Manager  
  4. As soon as the search for upgrades would finish, the “Upgrade to 1.5.1.0.1” will be listed for the Mage_All_Latest package in the Available column.
  5. Select “Upgrade to 1.5.1.0.1” in the Actions column for the Mage_All_Latest package and click “Commit Changes”.
  6. Package Mage_All_Latest Actions column, select “Last 1.5.1.0.1″ and click OK the changes.
  7. Make sure whether the package upgrades installed successfully or not by viewing messages on the console.
  8. Click the refresh button in the console window.
  9. Go to the Settings at the top.

Magneto Upgrade

Now Upgrading Magneto became easy

Note: If you want to upgrade Magento from 1.3 to 1.6 or 1.4 to 1.6 or 1.5 to 1.6 follow the same procedure

Follow the steps

Thursday, November 24, 2011

Magento Certification

Good Opportunity for the developer. Magento Launches the Certification Course.Now getting certification is much easier for the developer.Just register yourself and get certified.

Register Now – Space is Limited

Sign up today to take the Magento Certified Developer exam.

If any queries related to the Certification you can just email to training@magento.com

Show one single customer review

Showing latest and one review now quit easy
Go to review > product > list.phtml
Replace the code in that file with this

Product Reviews on Product View Page

Magento had functionality for showing the reviews in review page .Now it is Easy way to get the Product Reviews on Product View Page Add the follwing code in

Add the review blocks to the correct XML reference in catalog.xml which is in app > design > frontend > default > yourtheme > layout

Wednesday, November 23, 2011

How to get current currency and Symbol

To get Current Currency

$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();   

To get current currency symbol use:

Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();

How to print all queries in Magneto

How to print all queries in Magneto Became simple

Follow the steps as per instruction

Note: Make sure that you will add the above code in local folder and back up your database

1) Open the Magento your version : lib/varien/Db/Adapter/Pdo/Mysql.php

2) Make the above setting as Yes
  protected $_debug               = true;
 protected $_logAllQueries       = true;

3)protected $_debugFile           = 'var/debug/sql.txt';

4)if it is already there then don't follow step(3)

5)Now open the local.xml and add the following code

below resources/default_setup/connection/
<profiler> 1< profiler>

6)Now open any template file or php file and add the following
$profiler = Mage::getSingleton('core/resource')->getConnection('core_write')->getProfiler();
To simply output all queries:

print_r($profiler); and check the var/debug/ folder you will get the all the selected query.

Tuesday, November 22, 2011

Magento Training session

Now learning Magento became easy.Magento launches the Training session for the developer to make it Easier Faster to learn Magento.
Easy step to join the Training session
Just click on the following link http://www.magentocommerce.com/services/register-for-training
and Register your self with the course in which you are interested

LinkWithin

Blog has moved, searching new blog...