Thứ Ba, 30 tháng 8, 2011

How to get contact us email address in magento

Here’s the code to get Contacts email:



<?php echo Mage::getStoreConfig('contacts/email/recipient_email');?>

Or you can change it from admin -> System-> Configuration. From the left tab select Contacts then On the right side you will see Email Options Tab. From that tab you can see there is a field for send Emails To.Change th evalue to your require email address

Thứ Năm, 4 tháng 8, 2011

How to uncheck Radio button by jquery








Write the Below code to Unchecked Radio Button by Jquery




<script type="text/javascript">
$(document).ready(function(){
$("#btn").click(function(){
$('input[name="rd"][type="radio"]:checked').each(function(){
$(this).attr("checked", false);
});
});
});
</script>






<form action="" name="aa" method="post">
<input type="radio" name="rd" value="1"/>
<input type="radio" name="rd" value="2"/>
<input type="radio" name="rd" value="3"/>
<input type="button" id="btn" value="Click" />
</form>

How to change value and fetch value of Minimum Order Amounts of free shipping in magento


First of all to make Minimum Order Amounts of Free Shipping to [STORE VIEW] instead of [WEBSITE] then Go to app->code->core->Mage->Shipping->etc->System.xml


then change the value of <show_in_store> to 1 under carriers -> groups -> freeshipping ->free_shipping_subtotal.


Now to fetch the value of the Minimum Order Amount according to store view write the below code



<?php echo Mage::getStoreConfig('carriers/freeshipping/free_shipping_subtotal'); ?>

Thứ Sáu, 29 tháng 7, 2011

How to remove validation on zip code in magento checkout page


In the World some of the country has no zip code like Ireland, But magento has default zip code validation to make that optional for specific country magento has added a new feature in admin panel. To make Zip code optional please follow the following steps.


Login to your your magento admin panel then go to System -> Configuration->General. From Country option tab you can see there is an option " Postal code is optional for the following countries " Select the country which you want to Optional/Not validate . then click on save config to save your settings. To be more clear on this please see the below screenshot.



Thứ Bảy, 16 tháng 7, 2011

How to change default quantity on Magento Product Page

By default magento shows zero in the place of quantity text field in product details page, if you wish to change then just login to your admin panel go to System->Configuration->Catalog->inventory.


There, add your minimal quantity from Minimum Qty Allowed in Shopping Cart


See the below screenshot to make it more clear



Thứ Năm, 16 tháng 6, 2011

How to change css padding property using javascript dynamically


Using Javascript we can change css value. Here I have written how to change the value of padding top, padding bottom, padding left, padding right differently.

var ab = 20;

//To change Padding-top value write
document.getElementById("div_Id").style.paddingTop = ab.toString()+"px"
//To change Padding-left value write
document.getElementById("div_Id").style.paddingLeft = ab.toString()+"px"
//To change Padding-right value write
document.getElementById("div_Id").style.paddingRight = ab.toString()+"px"
//To change Padding-bottom value write
document.getElementById("div_Id").style.paddingBottom = ab.toString()+"px"

Thứ Ba, 17 tháng 5, 2011

How to send Email in magento

Any body can send mail using php mail() function.But in magento all the functionality has wriiten you need to just send argument inside those functions. See the following code to send mail using magento function



<?php

$mail = Mage::getModel('core/email');

$mail->setToName('Your Name');

$mail->setToEmail('Youe Email');

$mail->setBody('Mail Text / Mail Content');

$mail->setSubject('Mail Subject');

$mail->setFromEmail('Sender Mail Id');

$mail->setFromName("Msg to Show on Subject");

$mail->setType('html');// YOu can use Html or text as Mail format


try {

$mail->send();

Mage::getSingleton('core/session')->addSuccess('Your request has been sent');

$this->_redirect('');

}

catch (Exception $e) {

Mage::getSingleton('core/session')->addError('Unable to send.');

$this->_redirect('');

}

?>