Friday, 16 November 2012
Clean Cache and Session in Magento
If you have made any modifications to your Magento code, they will not appear immediately unless you clear the cache.
Magento keeps its cache in /var/cache located inside the Magento home directory. So, for example, if your Magento is installed in your main www/magento folder, the cache will be in magento/var/cache.
To clear the cache, simply delete everything from the /var/cache directory and then reload your website in your browser.
To clear all sessions, you can also delete everything from the /var/session folder within your Magento home directory.
Solution of Unable to communicate with the PayPal gateway in magento 1.7
I am using magento 1.7.0.0 version and it is quite advance then older version. When i have integrated Express Checkout in my localhost magento admin as it is quite simple, you can get many tutorials for it. But the main problem come in front of me when i placed an order using Paypal Express Checkout., it display an error msg "Unable to communicate with the PayPal gateway" ..
Solution : The fix for me was to disable SSL verification at configuration >>
system >> payment methods >> PayPal payment solutions
>> Enable SSL verification . If you were testing on the localhost
as well, re-enable the option on your live site to check whether it
works. Otherwise just disable it until a proper fix has been found for
magento 1.7 +
I think it may help you !!!!
Friday, 9 November 2012
Change logo in Magento
To change the path or filename of the default logo, simply log in to your
admin panel and navigate to System -> Configuration -> Design.
Under the Header section, change the Logo Image Src from "images/logo.gif" to whatever file path/name suits your needs.
Tuesday, 18 September 2012
Print A Div using Javascript
<html>
<head>
<script type="text/javascript">
function PrintContentDiv() {
var divPrint = document.getElementById('divContent');
var popupWin = window.open('', '_blank', 'width=300,height=300');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
</head>
<body >
<div id="divContent" >
<div style="width:300px;height:500px;">
<strong> Div Print on anchor click </strong>
</div>
</div>
<div>
<a href="javascript:void(0)" onclick="PrintContentDiv();"><img src="images/print-icon.png" /><br />Print<br />Item</a>
</div>
</body>
</html>
Monday, 17 September 2012
Get Google Map using latitude and longitude
This is a very simple way to integrate Google map using latitude and longitude in a div. Just copy+paste the code and set the lat/long according to your location or set it dynamically from database by passing lat/long parameter.
<html>
<head>
<style type="text/css">
div#map {
position: relative;
}
div#crosshair {
position: absolute;
top: 192px;
height: 19px;
width: 19px;
left: 50%;
margin-left: -8px;
display: block;
background: url(crosshair.gif);
background-position: center center;
background-repeat: no-repeat;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
var geocoder;
var centerChangedLast;
var reverseGeocodedLast;
var currentReverseGeocodeResponse;
function initialize() {
var latlng = new google.maps.LatLng(18.524220910029783,73.85761860000002);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
geocoder = new google.maps.Geocoder();
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: "Hello World!"
});
}
</script>
</head>
<body onload="initialize()">
<div id="map" style="width:200px; height:200px">
<div id="map_canvas" style="width:100%; height:200px"></div>
<div id="crosshair"></div>
</div>
</body>
</html>
<html>
<head>
<style type="text/css">
div#map {
position: relative;
}
div#crosshair {
position: absolute;
top: 192px;
height: 19px;
width: 19px;
left: 50%;
margin-left: -8px;
display: block;
background: url(crosshair.gif);
background-position: center center;
background-repeat: no-repeat;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
var geocoder;
var centerChangedLast;
var reverseGeocodedLast;
var currentReverseGeocodeResponse;
function initialize() {
var latlng = new google.maps.LatLng(18.524220910029783,73.85761860000002);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
geocoder = new google.maps.Geocoder();
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: "Hello World!"
});
}
</script>
</head>
<body onload="initialize()">
<div id="map" style="width:200px; height:200px">
<div id="map_canvas" style="width:100%; height:200px"></div>
<div id="crosshair"></div>
</div>
</body>
</html>
Wednesday, 15 August 2012
JQuery Form Validation
Doing mistakes while form submission is very common and form validation is the very best solution for this. I have found a link which i want to share it with my Web friends. So here it is :
Form Validation
If you like it and helpful for you so leave a comment.. It will be best motivator for me..
Thanks
Gaurav Goel
Delhi, India
Form Validation
If you like it and helpful for you so leave a comment.. It will be best motivator for me..
Thanks
Gaurav Goel
Delhi, India
Tuesday, 24 July 2012
Delete and Update cascading constraint in existing table
ALTER TABLE `emp_details` ADD
CONSTRAINT `foreign_key_const`
FOREIGN KEY (`emp_id`) REFERENCES `employee` (`emp_id`)
ON DELETE CASCADE ON UPDATE CASCADE
Monday, 16 July 2012
Removing Extra White Space in Google Custom Search
Hi All,
I have done a lot of R&D to find the solution of Google Custom Search White Space Issue.
1. <form action="http://www.test.newhomestar.com/search.php" id="cse-search-box">
<input type="hidden" name="cx" value="xxxxx90948434568903:14dqcrlsktw" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="31" class="inp-hdr"/>
<input type="submit" name="sa" value="" class="go-button" />
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
//Create a div and do inline styling and put height:1140px or as per your requirement.
2. <div id="cse-search-results" style="overflow: hidden;text-align: left; height:1140px"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 590; <!----you can change width
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
var googleSearchResizeIframe = true;
var a=encodeURIComponent;
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
</div>
Check it out the working solution @ click here
Friday, 6 July 2012
Attach multiple files in the mail using php
The following function will send a mail with attachment.. Just need to copy-paste the function and made basic changes in it.
/**
* parameter : Array $attach Contains the number of file and their names
* parameter : String $message Message to the user like PFA
* parameter : $mailto receiver@abc.com
* parameter : $subject This is attached mail.
**/
function mail_with_attachment($attach,$message, $mailto, $subject )
{
$files = array();
$unique_id = md5(time());
foreach($attach as $a){
$attachment = './path/to/file/folder/'.$a['filename'];
$aFile = fopen($attachment,"rb");
$data = fread($aFile,filesize($attachment));
fclose($aFile);
$data = chunk_split(base64_encode($data));
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"".$unique_id."\"\r\n\r\n";
$headers .= "--".$unique_id."\r\n";
$headers .= "Content-type:text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$headers .= $message."\r\n\r\n";
$headers .= "--".$unique_id."\r\n";
$headers .= "Content-Type: application/octet-stream; name=\"".$a['filename']."\"\r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment; filename=\"".$a['filename']."\"\r\n\r\n";
$headers .= $data."\r\n\r\n";
$headers .= "--".$unique_id."--";
//MAIL TO USER
$mailSend = mail ($mailto , $subject ," " , $headers);
if($mailSend)
{
echo "Mail Send Successfully .. :-)";
}
else
{
echo "Sorry, there is some error.. Comment to me ... :-( ";
}
}//End Function
Location:
Mumbai, Maharashtra, India
Subscribe to:
Posts (Atom)