Archive for the ‘Magento’ Category

public function massRunprofileAction() {
$connection = Mage::getSingleton(’core/resource’)->getConnection(’core_write’);
$vantgeimportIds = $this->getRequest()->getParam(’vantgeimport’);
if (!is_array($vantgeimportIds)) {
Mage::getSingleton(’adminhtml/session’)->addError($this->__(’Please select item(s)’));
} else {
try {
foreach ($vantgeimportIds as $vantgeimportId) {
//Here Added Customer Data
$vantgeimport = Mage::getSingleton(’vantgeimport/vantgeimport’)
->load($vantgeimportId)->getData();
// XML Read Content
$xmlfile = Mage::getBaseDir(’media’) . DS . ‘vantagecustomer’ . DS . $vantgeimport[’filename’];
$doc = new DOMDocument();
$doc->load($xmlfile);
$arrFeeds = array();
foreach ($doc->getElementsByTagName(’Customer’) as $node) {
$itemRSS = array(
‘Company’ => $node->getElementsByTagName(’Company’)->item(0)->nodeValue,
‘Name’ => $node->getElementsByTagName(’Name’)->item(0)->nodeValue,
‘EMailAddress’ => $node->getElementsByTagName(’EMailAddress’)->item(0)->nodeValue,
‘Country’ => $node->getElementsByTagName(’Country’)->item(0)->nodeValue,
‘PhoneNum’ => $node->getElementsByTagName(’PhoneNum’)->item(0)->nodeValue,
‘FaxNum’ => $node->getElementsByTagName(’FaxNum’)->item(0)->nodeValue,
‘City’ => $node->getElementsByTagName(’City’)->item(0)->nodeValue,
‘State’ => $node->getElementsByTagName(’State’)->item(0)->nodeValue,
‘Zip’ => $node->getElementsByTagName(’Zip’)->item(0)->nodeValue,
‘CreditHold’ => $node->getElementsByTagName(’CreditHold’)->item(0)->nodeValue,
‘Address1’ => $node->getElementsByTagName(’Address1’)->item(0)->nodeValue,
‘GroupCode’ => $node->getElementsByTagName(’GroupCode’)->item(0)->nodeValue
);
array_push($arrFeeds, $itemRSS);
}
$array_leg = count($arrFeeds);
for ($i = 0; $i < $array_leg; $i++) {
$customer_model = Mage::getModel(’customer/customer’);
$customer_model->setData(’firstname’, $arrFeeds[$i][’Name’]);
if ($arrFeeds[$i][’EMailAddress’] == ‘’) {
$email = rand() . ‘xxx@gmail.com’;
} else {$email = $arrFeeds[$i][’EMailAddress’];}
if ($arrFeeds[$i][’CreditHold’] == true) {
$vantagehold = ‘Hold’;}$customer_model->setData(’email’, $email);$customer_model->setData(’lastname’, ‘’);
$customer_model->setData(’vantagehold’, $vantagehold);
$getgroupid = “select customer_group_id from customer_group where customer_group_code=’” . $arrFeeds[$i][’GroupCode’] . “‘“;
$get_groupid = $connection->query($getgroupid);
while ($rowgr = $get_groupid->fetch()) {
$groupid_value = $ids[] = $rowgr[’customer_group_id’];}
if ($groupid_value == ‘’) {$customer_model->setData(’group_id’, 1);
} else {$customer_model->setData(’group_id’, $groupid_value);}
$customer_model->setData(’website_id’, 1);
$customer_model->setData(’created_in’, ‘Admin’);
$customer_model->setData(’default_billing’, ‘’);
$customer_model->setData(’password_hash’, ‘’);
$customer_model->save();
$customerdata_load = Mage::getModel(’customer/customer’);
$customerdata_load->setWebsiteId(1)->loadByEmail($email)->getData();
$customer_id = $customerdata_load[’entity_id’];

$billingAddress1 = Mage::getModel(’customer/address’);
$billingAddress1->setFirstname($arrFeeds[$i][’Name’]);
$billingAddress1->setRegion($arrFeeds[$i][’State’]);
$billingAddress1->setCity($arrFeeds[$i][’City’]);
$billingAddress1->setCompany($arrFeeds[$i][’Company’]);
$country = substr($arrFeeds[$i][’Country’], 0, 2);
$billingAddress1->setCountryId($country);
$billingAddress1->setFax($arrFeeds[$i][’FaxNum’]);
$billingAddress1->setPostcode($arrFeeds[$i][’Zip’]);
$billingAddress1->setTelephone($arrFeeds[$i][’PhoneNum’]);
$billingAddress1->setStreet($arrFeeds[$i][’Address1’]);
$billingAddress1->setEntityTypeId(2);
$billingAddress1->setAttributeSetId(0);
$billingAddress1->setParentId($customer_id);
$billingAddress1->save();}}$this->_getSession()->addSuccess(
$this->__(’Total of %d record(s) were successfully updated’, count($vantgeimportIds)));
} catch (Exception $e) {$this->_getSession()->addError($e->getMessage());}
}$this->_redirect(’*/*/index’);}

Example:

app\code\local\Cataloggallery\Gallerycheck\Block\Template\Edit\Tab\General.php

This is my custom module file folder structure on General Tab file.

$fieldset->addField(’Sku’, ‘text’, array(
‘name’ => ‘Sku’,
‘class’=>’checkskuval’,
‘label’ => Mage::helper(’Gallerycheck’)->__(’Sku’),
‘title’ => Mage::helper(’Gallerycheck’)->__(’Sku’),

‘required’ => true,

));

The above fieldset is my prepareform field.

I want to check the Sku value is already exist or not.

On that same file bottom of the file i have write the following Jquery script for validation purpose

$js_url= Mage::getBaseUrl(’js’);
?>
<script src=”<?php echo $js_url;?>jquery.js” type=”text/javascript\” ></script>
<script type=”text/javascript\”>
jQuery.noConflict();
(function($) {
$(function()
{
$(document).ready(function()
{

var urlth=’<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>galleryajax.php?’;
$(’.checkskuval’).blur(function()
{
//alert(“hai”);
var parametri=”skuvalue=”+jQuery(’#Gallery_Sku’).val();

jQuery.ajax({
type: “POST”,
url: urlth,
data: parametri,
dataType: ‘html’,
timeout: 1000,
async:false,
success: function(msg){
if(msg==’Please Enter Valid Sku’)
{
alert(msg);
//var error=’Please Enter Valid Sku’;
//$(’.validation-advice’).html(msg);
// document.getElementById(’Gallery_Sku’).value.select();
//document.getElementById(’Gallery_Sku’).focus();
return false;
}
else
{
//alert(msg);
return false;
}

}
});

});
});
});
})(jQuery);
</script>

The following script is galleryajax.php file script.

<?php
require_once(“app/Mage.php”);
Mage::app();
if($_REQUEST[‘skuvalue’]!=”)
{
$skuval= trim ($_REQUEST[‘skuvalue’]);

$product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$skuval);
/*echo “<pre>”;
print_r($product);
exit;
if($product==”)*/

/*$val=$product->getData();
echo “<pre>”;
print_r($val);
exit;*/
if($product==”)
{
echo “Please Enter Valid Sku”;
}
else
{
echo “1”;
}
exit;
}

 

?>

 

First we will call the UPSRequest XML .It will give to response XML with shipmentdigestnumber.

After that we will call that UPSAccept Request XML it will give to response XML with UPS Tracking number, transport charge, service charge, etc.

Here i have attached with class file.

///Call the UPS XML file Class//
$upsclass=new upswebservicecall();
//Call the upsconfirmrequestxml function
$shipconfirresponse=$upsclass->upsconfirmrequest($cur_od_id,$shi_Addr_id,$descval,$code,$region_code);
$errornotificatio=$shipconfirresponse[’errornotification’];
$shipconfirdigenumber=$shipconfirresponse[’shipmentdigestnumber’];

//Call the upsacceptrequestxml function
$shipacceptrespone=$upsclass->upsacceptrequest($shipconfirdigenumber);
$ups_tracking_number=$shipacceptrespone[’Trackinnumber’];
$ups_shipmentidentification=$shipacceptrespone[’Shiidentifynum’];
$ups_transpotchare=$shipacceptrespone[’transportcharge’];
$ups_servicecharge=$shipacceptrespone[’servicecharge’];
$ups_totalcharge=$shipacceptrespone[’TotalCharges’];
$ups_negocharge=$shipacceptrespone[’negotatiedcharge’];
$ups_pickupnum=$shipacceptrespone[’pickrequestnum’];

Here i have wrote the class file….

 

<?php
class upswebservicecall
{
function upsconfirmrequest($order_id,$shipadd_id,$descval,$code,$region_code)
{

$connection = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);

$order = Mage::getModel(‘sales/order’);
$order->load($order_id);
$val=$order->getData();

$shiping_desc=$val[‘shipping_description’];

$shiping_addr_id=$val[‘shipping_address_id’];

 
$shipping_address = Mage::getModel(‘sales/order_address’);
$shipping_address->load($shiping_addr_id);
$valship=$shipping_address->getData();
$ship_companyname=$valship[‘company’];
$ship_name=$valship[‘firstname’];
$ship_phone=$valship[‘telephone’];
$ship_city=$valship[‘city’];
$ship_state=$valship[‘company’];
$ship_countrycode=$valship[‘country_id’];
$ship_postalcode=$valship[‘postcode’];
$ship_street=$valship[‘street’];

$store_name=Mage::app()->getStore()->getName();

$AccessLicenseNumber = ‘6C736EDBE5A1F6E0’; // Your license number
$UserId = ‘cgt777’; // Username
$Password = ‘meister’; // Password

// =============== DON’T CHANGE BELOW THIS LINE ===============

$data =”<?xml version=’1.0′?>
<AccessRequest xml:lang=’en-US’>
<AccessLicenseNumber>6C736EDBE5A1F6E0</AccessLicenseNumber>
<UserId>cgt777</UserId>
<Password>meister</Password>
</AccessRequest>
<ShipmentConfirmRequest xml:lang=’en-US’>
<Request>
<TransactionReference>
<CustomerContext>Customer Comment</CustomerContext>
<XpciVersion/>
</TransactionReference>
<RequestAction>ShipConfirm</RequestAction>
<RequestOption>validate</RequestOption>
</Request>
<LabelSpecification>
<LabelPrintMethod>
<Code>GIF</Code>
<Description>gif file</Description>
</LabelPrintMethod>
<HTTPUserAgent>Mozilla/4.5</HTTPUserAgent>
<LabelImageFormat>
<Code>GIF</Code>
<Description>gif</Description>
</LabelImageFormat>
</LabelSpecification>
<Shipment>
<RateInformation>
<NegotiatedRatesIndicator/>
</RateInformation>
<Description/>
<Shipper>
<Name>Edwin</Name>
<PhoneNumber>9003349450</PhoneNumber>
<ShipperNumber>8V948R</ShipperNumber>
<TaxIdentificationNumber>1234567877</TaxIdentificationNumber>
<Address>
<AddressLine1>12782 Monarch Street</AddressLine1>
<City>GARDEN GROVE</City>
<StateProvinceCode>CA</StateProvinceCode>
<PostalCode>92842</PostalCode>
<PostcodeExtendedLow></PostcodeExtendedLow>
<CountryCode>US</CountryCode>
</Address>
</Shipper>
<ShipTo>
<CompanyName>Fast stream Technologies</CompanyName>
<AttentionName>”.$ship_name.”</AttentionName>
<PhoneNumber>”.$ship_phone.”</PhoneNumber>
<Address>
<AddressLine1>”.$ship_street.”</AddressLine1>
<City>”.$ship_city.”</City>
<StateProvinceCode>”.$region_code.”</StateProvinceCode>
<PostalCode>”.$ship_postalcode.”</PostalCode>
<CountryCode>”.$ship_countrycode.”</CountryCode>
</Address>
</ShipTo>
<ShipFrom>
<CompanyName>Custom Greekth</CompanyName>
<AttentionName>Edwin</AttentionName>
<PhoneNumber>9600569055</PhoneNumber>
<TaxIdentificationNumber>1234567877</TaxIdentificationNumber>
<Address>
<AddressLine1>12782 Monarch Street</AddressLine1>
<City>GARDEN GROVE</City>
<StateProvinceCode>CA</StateProvinceCode>
<PostalCode>92842</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</ShipFrom>
<PaymentInformation>
<Prepaid>
<BillShipper>
<AccountNumber>8V948R</AccountNumber>
</BillShipper>
</Prepaid>
</PaymentInformation>
<Service>
<Code>”.$code.”</Code>
<Description>”.$descval.”</Description>
</Service>
<Package>
<PackagingType>
<Code>02</Code>
<Description>Customer Supplied</Description>
</PackagingType>
<Description>Package Description</Description>
<ReferenceNumber>
<Code>00</Code>
<Value>Package</Value>
</ReferenceNumber>
<PackageWeight>
<UnitOfMeasurement/>
<Weight>60.0</Weight>
</PackageWeight>
<LargePackageIndicator/>
<AdditionalHandling>0</AdditionalHandling>
</Package>
</Shipment>
</ShipmentConfirmRequest>”; // https://wwwcie.ups.com/ups.app/xml/ShipConfirm

$ch = curl_init(“https://wwwcie.ups.com/ups.app/xml/ShipConfirm&#8221;);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_TIMEOUT, 60);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$result=curl_exec ($ch);
// ‘<!– ‘. $result. ‘ –>’;
// THIS LINE IS FOR DEBUG PURPOSES ONLY-IT WILL SHOW IN HTML COMMENTS
$data = strstr($result, ‘<?’);
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
$params = array();
$level = array();
foreach ($vals as $xml_elem) {
if ($xml_elem[‘type’] == ‘open’) {
if (array_key_exists(‘attributes’,$xml_elem)) {
list($level[$xml_elem[‘level’]],$extra) = array_values($xml_elem[‘attributes’]);
} else {
$level[$xml_elem[‘level’]] = $xml_elem[‘tag’];
}
}
if ($xml_elem[‘type’] == ‘complete’) {
$start_level = 1;
$php_stmt = ‘$params’;
while($start_level < $xml_elem[‘level’]) {
$php_stmt .= ‘[$level[‘.$start_level.’]]’;
$start_level++;
}
$php_stmt .= ‘[$xml_elem[\’tag\’]] = $xml_elem[\’value\’];’;
eval($php_stmt);
}
}
curl_close($ch);
//echo
$paramsxmlresponseval = array();
//return $params[‘RATINGSERVICESELECTIONRESPONSE’][‘RATEDSHIPMENT’][‘TOTALCHARGES’][‘MONETARYVALUE’];
$paramsxmlresponseval[‘customercontext’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘RESPONSE’][‘TRANSACTIONREFERENCE’][‘CUSTOMERCONTEXT’];
$paramsxmlresponseval[‘XPCIVERSION’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘RESPONSE’][‘TRANSACTIONREFERENCE’][‘XPCIVERSION’];
$paramsxmlresponseval[‘RESPONSESTATUSCODE’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘RESPONSE’][‘RESPONSESTATUSCODE’];
$paramsxmlresponseval[‘ResponseStatusDescription’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘RESPONSE’][‘RESPONSESTATUSDESCRIPTION’];
$paramsxmlresponseval[‘shipmentdigestnumber’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘SHIPMENTDIGEST’];
$paramsxmlresponseval[‘errornotification’]=$params[‘SHIPMENTCONFIRMRESPONSE’][‘RESPONSE’][‘ERROR’][‘ERRORDESCRIPTION’];
//ResponseStatusDescriptionShipmentDigest
/*echo “<pre>”;
print_r($params);
exit;*/
return $paramsxmlresponseval;

}

function upsacceptrequest($shidignum)
{
$AccessLicenseNumber = ‘6C736EDBE5A1F6E0’; // Your license number
$UserId = ‘cgt777’; // Username
$Password = ‘meister’; // Password

// =============== DON’T CHANGE BELOW THIS LINE ===============

$data =”<?xml version=’1.0′ encoding=’ISO-8859-1′?>
<AccessRequest>
<AccessLicenseNumber>6C736EDBE5A1F6E0</AccessLicenseNumber>
<UserId>cgt777</UserId>
<Password>meister</Password>
</AccessRequest>
<?xml version=’1.0′ encoding=’ISO-8859-1′?>
<ShipmentAcceptRequest>
<Request>
<TransactionReference>
<CustomerContext>Customer Comment</CustomerContext>
</TransactionReference>
<RequestAction>ShipAccept</RequestAction>
<RequestOption>1</RequestOption>
</Request>
<ShipmentDigest>”.$shidignum.”</ShipmentDigest>
</ShipmentAcceptRequest>
“;
$ch = curl_init(“https://wwwcie.ups.com/ups.app/xml/ShipAccept&#8221;);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_TIMEOUT, 60);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$result=curl_exec ($ch);
//echo ‘<!– ‘. $result. ‘ –>’;
// THIS LINE IS FOR DEBUG PURPOSES ONLY-IT WILL SHOW IN HTML COMMENTS
$data = strstr($result, ‘<?’);
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
$params = array();
$level = array();
foreach ($vals as $xml_elem) {
if ($xml_elem[‘type’] == ‘open’) {
if (array_key_exists(‘attributes’,$xml_elem)) {
list($level[$xml_elem[‘level’]],$extra) = array_values($xml_elem[‘attributes’]);
} else {
$level[$xml_elem[‘level’]] = $xml_elem[‘tag’];
}
}
if ($xml_elem[‘type’] == ‘complete’) {
$start_level = 1;
$php_stmt = ‘$params’;

while($start_level < $xml_elem[‘level’]) {
$php_stmt .= ‘[$level[‘.$start_level.’]]’;
$start_level++;
}
$php_stmt .= ‘[$xml_elem[\’tag\’]] = $xml_elem[\’value\’];’;
eval($php_stmt);
}
}

$paramsxmlresponsevalacc = array();
$paramsxmlresponsevalacc[‘Trackinnumber’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘PACKAGERESULTS’][‘TRACKINGNUMBER’];
$paramsxmlresponsevalacc[‘Shiidentifynum’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘SHIPMENTIDENTIFICATIONNUMBER’];
$paramsxmlresponsevalacc[‘pickrequestnum’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘PICKUPREQUESTNUMBER’];
$paramsxmlresponsevalacc[‘Labelimagehtmlimage’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘PACKAGERESULTS’][‘LABELIMAGE’][‘HTMLIMAGE’];
$paramsxmlresponsevalacc[‘Graphicimage’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘PACKAGERESULTS’][‘LABELIMAGE’][‘GRAPHICIMAGE’];
$paramsxmlresponsevalacc[‘transportcharge’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘SHIPMENTCHARGES’][‘TRANSPORTATIONCHARGES’][‘MONETARYVALUE’];
$paramsxmlresponsevalacc[‘servicecharge’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘SHIPMENTCHARGES’][‘SERVICEOPTIONSCHARGES’][‘MONETARYVALUE’];
$paramsxmlresponsevalacc[‘TotalCharges’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘SHIPMENTCHARGES’][‘TOTALCHARGES’][‘MONETARYVALUE’];
$paramsxmlresponsevalacc[‘negotatiedcharge’]=$params[‘SHIPMENTACCEPTRESPONSE’][‘SHIPMENTRESULTS’][‘NEGOTIATEDRATES’][‘NETSUMMARYCHARGES’][‘GRANDTOTAL’][‘MONETARYVALUE’];
/*echo “<pre>”;
print_r($params);
exit;*/
//print_r(base64_decode($params));*/
//ShipmentIdentificationNumber

$data_xml=”<?xml version=’1.0′ encoding=’ISO-8859-1′?>
<ShipmentAcceptResponse>
<Response>
<TransactionReference>
<CustomerContext>Customer Comment</CustomerContext>
</TransactionReference>
<ResponseStatusCode>1</ResponseStatusCode>
<ResponseStatusDescription>Success</ResponseStatusDescription>
</Response>
<ShipmentResults>
<ShipmentCharges>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>118.48</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>118.48</MonetaryValue>
</TotalCharges>
</ShipmentCharges>
<NegotiatedRates>
<NetSummaryCharges>
<GrandTotal>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>115.14</MonetaryValue>
</GrandTotal>
</NetSummaryCharges>
</NegotiatedRates>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>90.0</Weight>
</BillingWeight>
<ShipmentIdentificationNumber>1Z2220060292353829</ShipmentIdentificationNumber>
<PickupRequestNumber>297BL02P1A3</PickupRequestNumber>
<PackageResults>
<TrackingNumber>1Z2220060292353829</TrackingNumber>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<LabelImage>
<LabelImageFormat>
<Code>GIF</Code>
</LabelImageFormat>
<GraphicImage>”.$paramsxmlresponsevalacc[‘Graphicimage’].”</GraphicImage>
<HTMLImage>”.$paramsxmlresponsevalacc[‘Labelimagehtmlimage’].”</HTMLImage>
</LabelImage>
</PackageResults>
</ShipmentResults>
</ShipmentAcceptResponse>
“;
$f=fopen(“Upsimage/ShipAccept_Tool_SampleResponse.xml”,”w”);
$dat=fwrite($f,$data_xml);
fclose($f);

return $paramsxmlresponsevalacc;
}
}
?>

Country Collection:

public function getCountryCollection(){
				   $countryCollection = Mage::getModel('directory/country_api')->items();
				   return $countryCollection;
				   }

Region Collection:
Here You will pass the your country code.
public function getRegionCollection($countryCode){
			      $regionCollection = Mage::getModel('directory/region_api')->items($countryCode);
			      return $regionCollection;
				  }
Shipping Address Details:

$addr_entity_id="Your shipping Address id";
$shippingaddress = Mage::getModel('sales/order_address');
$shippingaddress->load($addr_entity_id);
$shipaddgetdat =$shippingaddress->getData();

Billing Address Details:

$biladdr_entity_id="Your Billing Address ID";
$billingaddress = Mage::getModel('sales/order_address');
$billingaddress->load($biladdr_entity_id);
$billaddgetdat =$billingaddress->getData();

$this->_redirect(‘*/*/’,array(‘Websitecat’ =>’assign’));

 

Here Websitecat is your parameter naem and assign is your value.

Step1–>  You will create you custom module renderer folder the following structure app\code\local\namespace\modulename\Block\Adminhtml\modulename\Edit\Renderer\yourfieldnamefile.php

Step2–> If example you want create multiple checkbox on your custom form means you create you file name like as moulenamecheckbox.php

Step–>3 then open that php file

class namespace_modulename_Block_Adminhtml_modulename_Edit_Renderer_modulenameCheckbox extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface

{

    public function render(Varien_Data_Form_Element_Abstract $element)
    {
         $connection = Mage::getSingleton('core/resource')->getConnection('core_write'); 
         $select_allwebsite="select * from core_website";
	     $slectweb = $connection->query($select_allwebsite);
        $html="<table border='0' width='100%'>
            <tr><td width='30%'>Choose Website</td>";
         while ($row=$slectweb->fetch()) {
              if($ids[]=$row['name']!='Admin'){
				 $websiteid=$ids[]=$row['website_id'];
                  $html.="<td><input type='checkbox' name='web_id[]' id='web_id[]' class='webid'  value='".$ids[]=$row['website_id']."'/>".$ids[]=$row['name']."</td>";
         }
        
       
    }
    $html.="</tr></table>";
     return $html;
    }
}
Step-->4 now you will call this class on your form.php file this file location is 
app\code\local\namespace\modulename\Block\Adminhtml\
modulename\Edit\Tab\Form.php
 $field = $fieldset->addField('storecode', 'text', array(
'label'     => Mage::helper('modulename')->__('Check Data'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'storecode',
      ));
$rendercallcheckbox=new namespace_modulename_Block_Adminhtml_modulename
_Edit_Renderer_modulenameCheckbox();
    
    $field->setRenderer($rendercallcheckbox);