Friday 20 November 2015

Extension PHP Intl is missing during magento 2 installation - Magento 2

As we all know Magento 2 is out and every one is trying to install and learn.When i was installing the magento 2 on my local i got the error of PHP Extension intl missing while in the PHP extension check during the magento 2 installation

so solution to this error is look for the php.ini file in the local open that file and find the below line from that file

;extension=php_intl.dll

and remove starting semicolon and save the file and then restart your xampp or wampp server and refresh the installation page.This error will be gone.

screen shot of this error is as follows:-



Monday 9 November 2015

How to Remove Discount Coupon code form from the Shopping cart page in Magento - Magento

To Remove the Discount Coupon form from Magento Shopping Cart Page follow the following steps

Add the following code in your theme's local.xml

<?xml version="1.0" encoding="UTF-8" ?>
<layout>
<checkout_cart_index>
<reference name="content">
<remove name="checkout.cart.coupon"/>
</reference>
</checkout_cart_index>
</layout>


Please Note clear the cache and check

Shopping cart quantity not able to update after magento upgrade - Magento

After upgrading your magento to 1.8.1.0, there has been problem with update quantity of shopping cart in community version 1.8.1.0. For example just change quantity from 1 to 2 and hit update, the quantity did not change.

If you are facing this issue that means you are using the custom template file for the /checkout/cart.phtml in yout theme.with the recent upgrade magento has been introduced in the base version of the magento since you are using the custom template this changes won't be reflected in your page.

The better approach is to add the updated lines to your own cart.phtml file.

In your theme directory

In your /app/design/frontend/<theme>/default/template/checkout/cart.phtml file or /app/design/frontend/default/<theme>/template/checkout/cart.phtml file

Just place on line 50 just after
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
paste the below code

<?php echo $this->getBlockHtml('formkey'); ?>


it will work fine now.

Sunday 8 November 2015

How to check whether user is logged-in or not in magento - Magento

Some times we want to check whether user is already logged in or not in magento for this we can use the following code


<?php
    if(!Mage::getSingleton('customer/session')->isLoggedIn()){
        //not logged in
    }else{
        // logged in
    }
?>

Tuesday 3 November 2015

Adding A Suffix or Prefix to Title Tag in Magento - Magento

SEO best practices dictate that you should include your website name at the end of your title tag. This is really very important for brands who have retailers competing for their keywords and because it also helps with branding.

You might see a title tag like this:

Keywords | YourWebsiteName.com
or
Keywords - YourWebsiteName.com

To get set up your store title tag suffix or prefix go to System > Configuration > Design > Html Head their you can see "Title Suffix" you can give your title "- YourWebsiteName.com" or "| YourWebsiteName.com" here which will add in all the page at last like

for eg:-

Keywords - YourWebsiteName.com
or
Keywords | YourWebsiteName.com

If you add "Title Prefix" as "- YourWebsiteName.com" or "| YourWebsiteName.com" then you will be seeing the prefix which you have been added at the start of the keywords in all pages

for eg:-

YourWebsiteName.com - Keywords
    or
YourWebsiteName.com | Keywords

How get the current loggedin admin user details in magento - Magento

Some times we want to get the current loggedin admin user details to process the data.so in magento we can get currently logged in admin user details.we can get currently logged in admin user id, firstname, lastname , username, email, by using the following code

<?php
$admin_user = Mage::getSingleton('admin/session')->getUser();
echo $admin_user->getUserId();
echo $admin_user->getFirstname();
echo $admin_user->getlastname();
echo $admin_user->getEmail();
echo $admin_user->getUsername();
?>