Monday 28 January 2013

Easily add Custom field in checkout

Custom field in checkout

URL : http://www.magentocommerce.com/magento-connect/customer-experience/checkout/custom-field-in-checkout-8025.html

 

 

Add Customer Comments In The Checkout

Free Magento Extension – Customer Comments In The Checkout


URL : http://magebase.com/magento-extensions/free-magento-extension-customer-comments-in-the-checkout/

 

Tuesday 22 January 2013

Magento Shopping Cart All information

I will show you how you can get information about all items in your Magento Shopping Cart. You will see how you can :-

- Get products id, name, price, quantity, etc. present in your cart.
- Get number of items in cart and total quantity in cart.
- Get base total price and grand total price of items in cart.
Get all items information in cart
 
// $items = Mage::getModel('checkout/cart')->getQuote()->getAllItems();
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach($items as $item) {
    echo 'ID: '.$item->getProductId().'<br />';
    echo 'Name: '.$item->getName().'<br />';
    echo 'Sku: '.$item->getSku().'<br />';
    echo 'Quantity: '.$item->getQty().'<br />';
    echo 'Price: '.$item->getPrice().'<br />';
    echo "<br />";
}
   
Get total items and total quantity in cart

 
$totalItems = Mage::getModel('checkout/cart')->getQuote()->getItemsCount();
$totalQuantity = Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
 
Get subtotal and grand total price of cart

 
$subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal();
$grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();

Wednesday 9 January 2013

Back to Top using jQuery

If you take a look way, way, way down at the bottom of this page, you will see a Back to Top button that scrolls the whole page until it reaches to top. It is a pretty simple effect to add to your site and looks a hundred-times cooler than just using your typical anchor name and link. Getting it all to work takes nothing more than a few lines of jQuery version 1.4.2.

First, we need to create our button/link. I am just going to use an anchor tag and some text:

<a href="javascript:void(0)" class="backtotop">Back to Top</a> 



Next we need to add some jQuery between the <head> tags:

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script> <script type='text/javascript'> jQuery('.backtotop').click(function(){ jQuery('html, body').animate({scrollTop:0}, 'slow'); }); </script> 

Remember, you can change the speed by replacing slow with a numerical value. You can also add some easing effects by including the jQuery UI. Read more about easing effects here.

Sunday 6 January 2013

Magento Error- Can’t Login to Admin Panel

Some times when you try to login your Magento Admin Panel after Magento Installation, nothing happens. That is to say you wouldn’t be able to login admin panel of your store.
magento admin cant login Magento Error  Can’t Login to Admin Panel
So today, we will be sharing solutions to such issue.
Reason of the problem
The main reason of such type of issue is that sometimes Magento fails to store cookies. Usually while working on localhost, people get such type of errors. We have cited following 2 solutions to this problem.

 Solutions

 Solution #1

If you are running Magento on local host using specific server applications like WAMP, XAMPP, AppServ etc.then try to replace “localhot” in your web url with 127.0.0.1.
For e.g.:
Replace
http://localhost/magento/index.php/admin
to
http://127.0.0.1/magento/index.php/admin
In case it doesn’t work for you, then follow the second solution mentioned below:

Solution #2

a)     Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

b)    Find the code:

session_set_cookie_params(
 $this->getCookie()->getLifetime(),
 $this->getCookie()->getPath(),
 $this->getCookie()->getDomain(),
 $this->getCookie()->isSecure(),
 $this->getCookie()->getHttponly()
 );
 
and replace with

session_set_cookie_params(
 $this->getCookie()->getLifetime(),
 $this->getCookie()->getPath()
 //$this->getCookie()->getDomain(),
 //$this->getCookie()->isSecure(),
 //$this->getCookie()->getHttponly()
 );
 
c)     Save the file and try to login admin panel

How to Set Up SSL in Magento?

We all know that an online store must have Secure Socket Layer (SSL) as customers use their confidential information such as credit card number etc. to make a purchase on your website. The private SSL certificate is very much vital for any eCommerce website. Even your visitors will also not prefer to buy from your store for being less secure.
Why SSL?
As above mentioned, SSL is very much necessary feature for your Magento Store as it is used to encrypt all communication between the browser and the server so as to ensure that all data goes through a secure (HTTPS) connection.
For all Magento Store merchants, it is strongly advised to implement SSL in their stores. Following are the steps to set up SSL in Magento Store:
Step 1
For Setting up SSL, you must get a SSL certificate first and contact your web host to set up the same for your domain.
Step 2
The next step would be to enable the certificate which can be done by following:
  • Go to Magento Admin area -> System -> Configuration -> Web
  • Define the insecure (non-SSL) and secure (SSL) URLs


SSL Setup Magento How to Set Up SSL in Magento?
In the above image, you can see different fields such as Base URL, Base Link URL etc under “Unsecure” and “Secure” sections. In Base URL fields you need to enter the regular website URL and website URL for SSL Connections. Leave other values unchanged because they’ll be set by script automatically once you’ll enter the Base URL.
Other fields are meant for URLs of the skinmedia and JavaScript folders. Drop Down fields will give options of “Yes” and “No” for allowing SSL Support in frontend and backend of website.
4. Clear your cache.
5. Now check your website frontend. Try to add a product to the cart and checkout. It should take you to https.
Note: Keep in Mind that SSL Connection over HTTPS version would be slow as compared to HTTP. So it is advised to implement it only on those pages which contain or process confidential information.

Magento- Display Products on Home Page with Pagination



If you want to display products on home page of your Magento Store with pagination, then this tutorial is for you. Follow these simple steps to add such functionality in your Magento Store:
  • Go to CMS > Manage Pages and click on the “Home page”.
  • Under the “Design” tab, insert the following code in the “Update Layout XML” field:


<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>3</category_id></action> 
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action> 
</block> 
</reference>