Thursday, March 29

How to install SSL Certificate in Magento


Here we will see how to install SSL certificate in Magento. Before we go to Magento SSL certificate we have to know all what is SSL and why we need SSL in our website.

What is SSL?

SSL is an acronym for Secure Sockets Layer, an encryption technology that was created by Netscape. SSL creates an encrypted connection between your web server and your visitors’ web browser allowing for private information to be transmitted without the problems of eavesdropping, data tampering, or message forgery. Once you have done the SSL install, you can access a site securely by changing the URL from http:// to https://. When an SSL certificate is installed on a website, you can be sure that the information you enter (credit card or any other information), is secured and only seen by the organization that owns the website.

Why need SSL?

If you are transmitting sensitive information on a web site, such as credit card numbers or personal information, you need to secure it with SSL encryption. It is possible for every piece of data to be seen by others unless it is secured by an SSL certificate.

 Add SSL certificate magento: Please follow the below steps for add SSL certificate in magento Here I show you with example of SSL Certificate add into cpanel.

Step1: Open your CPanel and Goto ssl-tls manager menu. 


Step2: Select Activate SSL on Your Web Site (HTTPS).


Step3: And enter the CRT and KEY for certificate and press install certificate button and install it. 


Step4: After this go to magento admin panel in System->Configuration->web in base url and set https where write http and set Use Secure URLs in Frontend = yes. 



Now you can have ssl certification in your magento site. you can see this in near by your address bar.

Thank You : Just Web Development 

Sunday, March 25

How to print coupon code and gift certificate on magento Invoice PDF

In this article we will see how to print the coupon code and gift certificate while invoice the magento order

here is the complete step by step procedure

Step 1 : Copy /app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php to /app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.php

Step 2 : Find the line $page = $this->insertTotals($page, $invoice); in the getPdf function. This was line 107 for me.

Step 3 : Add the following in the above and save the file
/* added by Wright Creative Labs */
/* print coupon code on invoice */
if($order->getCouponCode()!=""){
    $this->y -=12;
    $page->drawText('Coupon Used: '.$order->getCouponCode(), 450, $this->y, 'UTF-8');    
}
/* print gift certificate code on invoice */
if($order->getGiftcertCode()!=""){
    $this->y -=12;
    $page->drawText('Coupon Used: '.$order->getGiftcertCode(), 450, $this->y, 'UTF-8');    
}

thats it. now you can able to print the coupon and gift certificate in backend sales order.

Monday, March 5

How to Search the product within the top lovel category in Magento

The default magento supports to search the products based the search keyword. if we want to search the products within the specific category we need to change the catalog search template under teample/catalogsearch/form.mini.html

here is the script to search the products within the specific category
<?php
$category = Mage::getModel('catalog/category');
if(is_object(Mage::registry('current_category'))){
    $current_category_path=Mage::registry('current_category')->getPathIds();
}else{
    $current_category_path = array();
}
$category->load(Mage::app()->getStore()->getRootCategoryId());
$children_string = $category->getChildren();
$children = explode(',',$children_string);
$extra_options='';
foreach($children as $c){
    $selected = (in_array($c, $current_category_path))?'SELECTED':'';
    $extra_options.= '<option value="' . $c . '" ' . $selected . '>' . $category->load($c)->getName() . '</option>' . "\n";
}
?>
<form id="search_mini_form" action="<?php echo $this->helper('catalogSearch')->getResultUrl() ?>" method="get">
    <fieldset>
        <legend><?php echo $this->__('Search Site') ?></legend>
        <div class="mini-search">
            <input id="search" type="text" class="input-text" name="<?php echo $this->helper('catalogSearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogSearch')->getEscapedQueryText() ?>" />
            <select name="cat" id="cat" class="input-text">
            <option value="">All Categories</option>
            <?= $extra_options ?>
           </select>
            <input type="submit" value="Go" style="border: 1px solid #808080;" alt="<?php echo $this->__('Search') ?>" />
            <div id="search_autocomplete" class="search-autocomplete"></div>
            <script type="text/javascript">
            //<![CDATA[
                var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('search site...') ?>');
                searchForm.initAutocomplete('<?php echo $this->helper('catalogSearch')->getSuggestUrl() ?>', 'search_autocomplete');
            //]]>
            </script>
        </div>
    </fieldset>
</form>