Add additional fields to a Joomla 1.5 registration form

If you add new fields to the jos_users table, you need to modify the following:
libraries/joomla/database/table/user.php
libraries/joomla/user/user.php
com_user/views/user/tmpl/form.php
com_user/views/register/tmpl/default.php
com_users/views/user/tmpl/form.php
http://www.mysysadmintips.com/other/web/100
http://www.youtube.com/watch?v=qzf6ZKdjLZE

Joomla(1.5)_handel_password

1. your joomla folder
2.components->com_user->controller.php
all you need to do
     echo "$password";
you can see the password!
so, you should handle joomla password md5($password.$salt)+.$salt /

Active account:

1. your joomla folder
2.components->com_user->controller.php
find->  if (JUserHelper::activateUser($activation))
put your code here.

* if you hadel pp(power_pack) user is true:
if($user->get( 'js_badge')=="pp"){ 
    $isPowerUser=true;
}



link with opencart

1. Your joomla folder
2.components/com_k2/views/itemlist/view.html.php

Joomla 1.5 edit menu

-login in to admin and goto template and you will find edit template.
-goto -> public_html -> templates and choose right template and you will find index.php and edit it.

How to Create Login Page in PHP and MySQL with Session


##########################
NEW UPDATE!!!
PHPMySimpleLogin 0.3
The production of login page using PHP and MySQL is actually very simple.
I assume that you use local web server connection (Apache and PHP) and your MySQL database configuration use ‘localhost’ as hostname and ‘root’ as username with blank password.
For this case, I recommend you to using XAMPP (http://www.apachefriends.org/en/xampp-windows.html).
Please download and install it to your path choice. e.g: C:\xampp
Run XAMPP Control Panel on desktop.
Start Apache and PHP modules.
Let’s create a database with PHPMyAdmin. Open your favorite browser, then type ‘http://localhost/phpmyadmin’ at your browser address bar.
Create database ‘phpmysimplelogin’.
Click ‘Create’.
Now, let’s create a table, name it ‘user’ with ’2′ (two) number of fields.
Click ‘Go’.
First field, name it ‘username’, type ‘varchar’, lenght/values ’25′.
Second field, name it ‘password’, type ‘varchar’, lenght/values ’255′.
Click ‘Save’.
After that, we will fill the table. Click ‘SQL’ menu, then type this query on textbox:
INSERT INTO user (username, password) VALUES (‘admin’, md5(‘admin’))
Click ‘Go’.
It means, you fill ‘username’ field with string ‘admin’ and ‘username’ field with an encryption string of ‘admin’.
MD5 ia a function to create one-way encryption (hashing) from our password, so it can be more secure.
For detail, please check: http://www.php.net/manual/en/function.md5.php
Okay, now let’s prepare the web pages.
Create folder ‘phpmysimplelogin’ in your XAMPP’s htdocs. So, it will be ‘C:\xampp\htdocs\phpmysimplelogin’.
Remember to save all of your files you will create, inside this folder.
Run your favorite PHP code editor, e.g: PHP Expert Editor, RapidPHP, etc; or just Microsoft Notepad is fine.
Save document below with name ‘config.inc’.
<?php
$hostname = 'localhost';        // Your MySQL hostname. Usualy named as 'localhost', so you're NOT necessary to change this even this script has already online on the internet.
$dbname   = 'phpmysimplelogin'; // Your database name.
$username = 'root';             // Your database username.
$password = '';                 // Your database password. If your database has no password, leave it empty.
// Let's connect to host
mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!');
// Select the database
mysql_select_db($dbname) or DIE('Database name is not available!');
?>
Next step, save document below and name it as ‘index.php’:
<?php
// Inialize session
session_start();
// Check, if user is already login, then jump to secured page
if (isset($_SESSION['username'])) {
header('Location: securedpage.php');
}
?>
<html>
<head>
<title>PHPMySimpleLogin 0.3</title>
</head>
<body>
<h3>User Login</h3>
<table border="0">
<form method="POST" action="loginproc.php">
<tr><td>Username</td><td>:</td><td><input type="text" name="username" size="20"></td></tr>
<tr><td>Password</td><td>:</td><td><input type="password" name="password" size="20"></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td><td><input type="submit" value="Login"></td></tr>
</form>
</table>
</body>
</html>
As you see, there is ‘session_start();’.
This function is used to initializes a data session. It will creates a new session or continues previous session from data session changed by GET, POST or cookie.
See the detail information about session here:http://id.php.net/function.session-start
Now, prepare a file and give it name ‘loginproc.php’ to check the validity of username and password.
<?php
// Inialize session
session_start();
// Include database connection settings
include('config.inc');
// Retrieve username and password from database according to user's input
$login = mysql_query("SELECT * FROM user WHERE (username = '" . mysql_real_escape_string($_POST['username']) . "') and (password = '" . mysql_real_escape_string(md5($_POST['password'])) . "')");
// Check username and password match
if (mysql_num_rows($login) == 1) {
// Set username session variable
$_SESSION['username'] = $_POST['username'];
// Jump to secured page
header('Location: securedpage.php');
}
else {
// Jump to login page
header('Location: index.php');
}
?>
If username and password are correct, then we’ll be directed to ‘securedpage.php’.
This is the page that we want to show if login is successful. This page cannot be accessed if the correct data session is not found when login check is passed.
This page also contains ‘logout’ menu, so we can destroy our login data session then return to login page.
This is content of ‘securedpage.php’:
<?php
// Inialize session
session_start();
// Check, if username session is NOT set then this page will jump to login page
if (!isset($_SESSION['username'])) {
header('Location: index.php');
}
?>
<html>
<head>
<title>Secured Page</title>
</head>
<body>
<p>This is secured page with session: <b><?php echo $_SESSION['username']; ?></b>
<br>You can put your restricted information here.</p>
<p><a href="logout.php">Logout</a></p>
</body>
</html>
This is content of ‘logout.php’:
<?php
// Inialize session
session_start();
// Delete certain session
unset($_SESSION['username']);
// Delete all session variables
// session_destroy();
// Jump to login page
header('Location: index.php');
?>
Try on your favorite browser, ‘http://localhost/phpmysimplelogin/’.
So easy cake, isn’t it? ;)
##########################
NEW UPDATE!!!

joomla_link_up_101

require_once ( JPATH_BASE .DS.'buzzbarn.biz/components'.DS.'com_hello/models/nusoap/func/wsdlclient1.php' );

linux_Hibernation


To get Hibernation
sudo pm-hibernate
To get Suspend
sudo pm-suspend

Opencart_paypal_express_checkout

https://www.jexaa.co.uk/index.php?route=payment/paypal_express/DoExpressCheckoutPayment

OpenCart_Header_Cart_for_checkout


<?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/Adver/stylesheet/stylesheet.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script src="https://images-na.ssl-images-amazon.com/images/G/01/cba/js/jquery.js" type="text/javascript"></script>
<script src="https://images-na.ssl-images-amazon.com/images/G/01/cba/js/common/cba_shared.js" type="text/javascript"></script>
<script src="https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js"
type="text/javascript"></script>

<SCRIPT TYPE="text/java script">
        function PopupWin(url,name){
         var options="width=700,height=640,menubar=0,toolbar=0,scrollbars=1,resizable=1,status=1";
          var ContextWindow = window.open(url,name,options);
          ContextWindow.focus();
          return false;
        }
</SCRIPT>

<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.23.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/green/jquery-ui-1.8.23.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!--[if IE]>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4-iefix.js"></script>
<![endif]-->
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php echo $google_analytics; ?>

</head>
<body>
<div id="container">
<div id="header">
  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  <?php if (count($languages) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <div id="language"><?php echo $text_language; ?><br />
      <?php foreach ($languages as $language) { ?>
      &nbsp;<img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().parent().submit();" />
      <?php } ?>
      <input type="hidden" name="language_code" value="" />
      <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
    </div>
  </form>
  <?php } ?>
  <?php if (count($currencies) > 1) { ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <div id="currency"><?php echo $text_currency; ?><br />
      <?php foreach ($currencies as $currency) { ?>
      <?php if ($currency['code'] == $currency_code) { ?>
      <?php if ($currency['symbol_left']) { ?>
      <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_left']; ?></b></a>
      <?php } else { ?>
      <a title="<?php echo $currency['title']; ?>"><b><?php echo $currency['symbol_right']; ?></b></a>
      <?php } ?>
      <?php } else { ?>
      <?php if ($currency['symbol_left']) { ?>
      <a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_left']; ?></a>
      <?php } else { ?>
      <a title="<?php echo $currency['title']; ?>" onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>').submit(); $(this).parent().parent().submit();"><?php echo $currency['symbol_right']; ?></a>
      <?php } ?>
      <?php } ?>
      <?php } ?>
      <input type="hidden" name="currency_code" value="" />
      <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
    </div>
  </form>
  <?php } ?>
<div id="AmaCart">
<div id="globalParameters">
<input name="weight_unit" value="lb" type="hidden" />
<input name="currency_code" value="USD" type="hidden" />
<input name="merchant_id" value="A1Z53FQ7JJ1D1E" type="hidden" />
</div>
<div class="amazonPaymentsCart">
  <div class="amazonPaymentsCart_Header">
   <b>View Cart</b>
     Item(s) <span class="amazonPaymentsCart_TotalItems"></span>
     Subtotal: $ <span class="amazonPaymentsCart_SubTotal"></span>
  </div>
</div>
<?php /*
<div id="merchantConfigurations">
  <input name="debug_mode" value="true"
          type="hidden" />
  <input name="open_cart_on_add" value="true"
          type="hidden" />
<input name="continue_shopping_URL"
          value="http://buzzbarn.biz/index.php?option=com_content&view=article&id=53&Itemid=31"
          type="hidden" />
</div>
*/ ?>
</div>
  <div id="search">
    <div class="button-search"></div>
    <?php if ($filter_name) { ?>
   
    <input type="text" name="filter_name" value="<?php echo $filter_name; ?>" />
    <?php } else { ?>
    <input type="text" name="filter_name" value="<?php echo $text_search; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
    <?php } ?>
  </div>
  <div id="cart">
    <div class="heading">
      <h4><?php echo $text_cart; ?></h4>
      <a><span id="cart_total"><?php echo $text_items; ?></span></a></div>
    <div class="content"></div>
  </div>
  <!--<div id="welcome">
    <?php /*if (!$logged) { ?>
    <?php echo $text_welcome; ?>
    <?php } else { ?>
    <?php echo $text_logged; ?>
    <?php }*/ ?>
  </div>-->
 <!-- <div class="links"><a href="<?php /*echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $cart; ?>"><?php echo $text_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; */ ?></a></div>-->
</div>
  <?php if ($categories) { ?>
<div id="menu">
  <ul>
  <li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
    <?php foreach ($informations as $information) { ?>
      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
      <?php } ?>
 
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <!--<?php /*if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php }*/ ?>-->
    </li>
    <?php } ?>
  </ul>
</div>
<?php }?>

<div id="notification"></div>

OpenCart_Plimus_Amazon_Checkout


<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
<?php
/*
<script type="text/Javascript">

window.onbeforeunload = function (e) {
  var message = "Your confirmation message goes here.",
  e = e || window.event;
  // For IE and Firefox

  if (e) {
    e.returnValue = message;
<?php
$random = substr(number_format(time() * rand(),0,'',''),0,10);
//echo $random;
$to      = 'byazit@gmail.com';
$subject = 'the subject';
$message = $random;
$headers = 'From: admin@buzzbarn.com' . "\r\n" .
    'Reply-To: admin@buzzbarn.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>
  }

  // For Safari
  return message;
};
</script>
*/
?>
<h1><?php echo $heading_title; ?></h1>
   <div class="checkout">
    <div id="checkout">
      <div class="checkout-heading"><?php echo $text_checkout_option; ?></div>
      <div style="margin:0px 0px -50px 0px;" class="checkout-content"></div>
<div id="paypal_btn"><img src="http://www.buzzbarn.biz/store/image/data/paypal_button.jpg" title="paypal" alt="paypal"></div>

<?php /* -------------------edit by byazit@gmail.com---------------------- */ ?>
<?php /* -------------------getting_price_total_very_importent!--------- */ ?>
<?php
$InvoiceNumber=' USD,  Invoice Number: ';
$random = substr(number_format(time() * rand(),0,'',''),0,10); //random number generator depends on system time
$i=0; //getting total price
foreach ($totals as $total) {
$mod_price=(substr($total['text'],1));
$main_price=(substr($total['text'],1));
if($i==0)
{
define('TEST_CONSTANT',$mod_price);
define('MAIN_CONSTANT',$main_price);
}
//testThis();
$i++;
}
$total_cost='Total: '.$main_price;
/*
$products = $this->cart->getProducts();
$i = 1;
foreach ($products as $product) { ?>
  <input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product['name']; ?>" />
<?php
}
*/
//getting product name
$product_modify_name=0;
$products = $this->cart->getProducts();
$i=0;
foreach ($products as $product) {
$product_total = 0;
foreach ($products as $product_2) {
if ($product_2['product_id'] == $product['product_id']) {
$product_total += $product_2['quantity'];
$name='Name: ';
$sym='+';
$qnty='  x';
$br=',  ';
$product_modify_name .=$product['name'].$qnty.$product_2['quantity'].'  '.$product['price'].$br; //modify your own way you need for your invoice
//PRODUCT_NAME[&i]=$product['name'];
//echo PRODUCT_NAME[&i];
//define('PRODUCT_NAME',$product_modify_name);
$i++;
}
}
}
$string=$product_modify_name; //save value as string
$t_char=strlen($product_modify_name); //calculate string length
$final_list= substr($string, 1, $t_char); //get value depends on length
?>
<?php /* -------------------amazon_button_start--------------- */ ?>
<form id="CBACartFormId">


<table class="total">
  <?php foreach ($totals as $total) { ?>
  <tr>
<?php $mod_price=substr($total['text'],1); ?>
<input type="hidden" name="item_price_1" value="<?php echo $mod_price; ?>" />
<?php /* ?>
    <td align="right"><b><?php echo $total['title']; ?></b></td>
    <td align="right"><?php echo $total['text']; ?></td>
<?php */ ?>
  </tr>
  <?php } ?>
</table>
<tbody>
<tr><td>
<input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
          &nbsp;
</td>
<div id="amazon_btn">
<div id="cbaButton1"></div>
<div>
<img src="http://www.buzzbarn.biz/store/image/data/amazon_button.png" title="amazon" alt="amazon" width="150px" height="25px">
</div>
</div>
<td>
  <input name="item_merchant_id_1" value="A1Z53FQ7JJ1D1E" type="hidden" />
  <input name="item_sku_1" type="hidden" value="<?php echo $heading_title; ?>" />
  <input name="item_title_1" type="hidden" value="<?php echo $final_list.$total_cost.$InvoiceNumber; ?>" />
  <input type="hidden" name="item_quantity_1" size="2" value="1" />
  <input name="currency_code" value="USD" type="hidden" />
  <input name="aws_access_key_id" value="AKIAIUMXGIDW7LSQGFLA" type="hidden" />
</form>

<script>
  new CBA.Widgets.StandardCheckoutWidget({
    merchantId:'A1Z53FQ7JJ1D1E',
    orderInput: {format: "HTML",
                 value: "CBACartFormId"},
    buttonSettings: {size:'large',color:'orange',background:'white'}
    }).render("cbaButton1");
</script>
</td>
</tr>
</tbody>
<?php /* -------------------amazon_button_end--------------- */ ?>
</table>

<div id="plimus_btn">
<?php
//echo $final_list;
//echo substr('$product_modify_name',1);
/*...getting price from database... */
/*
 define('TEST_CONSTANT','12');
  function testThis($var=TEST_CONSTANT) {
      echo "Passing constants as default values $var";
  }
//testThis();
*/
/*...plimus implementation... */
function PlimusContractPriceForIP($contract, $quantity,$var=TEST_CONSTANT,$overridePrice=MAIN_CONSTANT, $overrideName='PRODUCT_NAME') {
/*
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ipaddress = getenv(HTTP_X_FORWARDED_FOR);
} else {
$ipaddress = getenv(REMOTE_ADDR);
}
*/
//$price =$var;
$url = 'http://www.plimus.com/jsp/get_local_price.jsp';
$postfields = 'contractId=' . $contract .
'&quantity=' . $quantity .
//'&ip=' . $ipaddress .
'&responseType=symbol_number';
$c = curl_init($url);
curl_setopt($c, CURLOPT_TIMEOUT, 3);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 3);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
$price = curl_exec($c);
curl_close($c);
$price=$var;
//echo $price;
//$price = trim($price);
return $price;
}

function plimusbuynowbuttonandtext ($contractID, $quantity=TEST_CONSTANT, $linktext, $overridePrice=MAIN_CONSTANT, $overrideName) {
echo '<tr>';
//$link = 'https://www.plimus.com/jsp/buynow.jsp?contractId=' . $contractID . '&quantity=' . $quantity .'&overridePrice=' . $overridePrice;

$link = 'https://www.plimus.com/jsp/buynow.jsp?contractId=' . $contractID . '&quantity=' . $quantity .'&overridePrice=' . $overridePrice.'&overrideName=' . $overrideName ;
$button = '<img src="http://www.buzzbarn.biz/store/image/data/bynwbttn.png" alt="buy now" width="100px" height="35px" border="0">';
$price = PlimusContractPriceForIP($contractID, $quantity);
$quantity = PlimusContractPriceForIP($contractID, $quantity);





$random = substr(number_format(time() * rand(),0,'',''),0,10);
//echo $random;
$to      = 'bbyazit@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: admin@buzzbarn.com' . "\r\n" .
    'Reply-To: admin@buzzbarn.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);




echo '<table><tr><td valign="top">';
echo '<a href="' . $link . '" rel="nofollow">' . $button . '</a>';
echo '</td>';
/*
echo '<td valign="top" align="left">';
echo $quantity . $linktext . '</a>';
//echo $price;
echo $quantity;
echo $var;
echo '</td>';
*/
echo '</tr></table>';
}
plimusbuynowbuttonandtext('3145258',1,'Product2 (1 user)',$overridePrice=$main_price, $overrideName=$final_list.$total_cost.$InvoiceNumber.$random);
//plimusbuynowbuttonandtext('3145258',1,'Product2 (1 user)',$overridePrice=MAIN_CONSTANT,$overrideName="test");
?>
</div>
<?php /*.....buyNowButton,end.... */ ?>

<div id="plimus_img"><img src="http://www.buzzbarn.biz/store/image/data/plimus_button.jpg" title="plimus" alt="plimus"></div>

<?php /* -----------------------------end------------------------------------ */ ?>
<div style="margin:30px 0px 0px 0px;"></div>
</div>
    </div>
    <?php if (!$logged) { ?>
    <div id="payment-address">
      <div class="checkout-heading"><span><?php echo $text_checkout_account; ?></span></div>
      <div class="checkout-content"></div>
    </div>
    <?php } else { ?>
    <div id="payment-address">
      <div class="checkout-heading"><span><?php echo $text_checkout_payment_address; ?></span></div>
      <div class="checkout-content"></div>
    </div>
    <?php } ?>
    <?php if ($shipping_required) { ?>
    <div id="shipping-address">
      <div class="checkout-heading"><?php echo $text_checkout_shipping_address; ?></div>
      <div class="checkout-content"></div>
    </div>
    <div id="shipping-method">
      <div class="checkout-heading"><?php echo $text_checkout_shipping_method; ?></div>
      <div class="checkout-content"></div>
    </div>
    <?php } ?>
    <div id="payment-method">
      <div class="checkout-heading"><?php echo $text_checkout_payment_method; ?></div>
      <div class="checkout-content"></div>
    </div>
    <div id="confirm">
      <div class="checkout-heading"><?php echo $text_checkout_confirm; ?></div>
      <div class="checkout-content"></div>
    </div>
  </div>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('#checkout .checkout-content input[name=\'account\']').live('change', function() {
if ($(this).attr('value') == 'register') {
$('#payment-address .checkout-heading span').html('<?php echo $text_checkout_account; ?>');
} else {
$('#payment-address .checkout-heading span').html('<?php echo $text_checkout_payment_address; ?>');
}
});

$('.checkout-heading a').live('click', function() {
$('.checkout-content').slideUp('slow');

$(this).parent().parent().find('.checkout-content').slideDown('slow');
});
<?php if (!$logged) { ?>
$(document).ready(function() {
$.ajax({
url: 'index.php?route=checkout/login',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#checkout .checkout-content').html(json['output']);

$('#checkout .checkout-content').slideDown('slow');
}
}
});
});
<?php } else { ?>
$(document).ready(function() {
$.ajax({
url: 'index.php?route=checkout/address/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-address .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideDown('slow');
}
}
});
});
<?php } ?>

// Checkout
$('#button-account').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/' + $('input[name=\'account\']:checked').attr('value'),
dataType: 'json',
beforeSend: function() {
$('#button-account').attr('disabled', true);
$('#button-account').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-account').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-address .checkout-content').html(json['output']);

$('#checkout .checkout-content').slideUp('slow');

$('#payment-address .checkout-content').slideDown('slow');

$('.checkout-heading a').remove();

$('#checkout .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
});

// Login
$('#button-login').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/login',
type: 'post',
data: $('#checkout #login :input'),
dataType: 'json',
beforeSend: function() {
$('#button-login').attr('disabled', true);
$('#button-login').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-login').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['total']) {
$('#cart_total').html(json['total']);
}

if (json['logged']) {
$('#welcome').html(json['logged']);
}

if (json['error']) {
$('#checkout .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');

$('.warning').fadeIn('slow');
} else {
$.ajax({
url: 'index.php?route=checkout/address/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-address .checkout-content').html(json['output']);

$('#checkout .checkout-content').slideUp('slow');

$('#payment-address .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading span').html('<?php echo $text_checkout_payment_address; ?>');

$('.checkout-heading a').remove();
}
}
});
}
}
});
});

// Register
$('#button-register').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/register',
type: 'post',
data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'password\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address select'),
dataType: 'json',
beforeSend: function() {
$('#button-register').attr('disabled', true);
$('#button-register').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-register').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();
$('.error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['warning']) {
$('#payment-address .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');

$('.warning').fadeIn('slow');
}

if (json['error']['firstname']) {
$('#payment-address input[name=\'firstname\'] + br').after('<span class="error">' + json['error']['firstname'] + '</span>');
}

if (json['error']['lastname']) {
$('#payment-address input[name=\'lastname\'] + br').after('<span class="error">' + json['error']['lastname'] + '</span>');
}

if (json['error']['email']) {
$('#payment-address input[name=\'email\'] + br').after('<span class="error">' + json['error']['email'] + '</span>');
}

if (json['error']['telephone']) {
$('#payment-address input[name=\'telephone\'] + br').after('<span class="error">' + json['error']['telephone'] + '</span>');
}

if (json['error']['address_1']) {
$('#payment-address input[name=\'address_1\'] + br').after('<span class="error">' + json['error']['address_1'] + '</span>');
}

if (json['error']['city']) {
$('#payment-address input[name=\'city\'] + br').after('<span class="error">' + json['error']['city'] + '</span>');
}

if (json['error']['postcode']) {
$('#payment-address input[name=\'postcode\'] + br').after('<span class="error">' + json['error']['postcode'] + '</span>');
}

if (json['error']['country']) {
$('#payment-address select[name=\'country_id\'] + br').after('<span class="error">' + json['error']['country'] + '</span>');
}

if (json['error']['zone']) {
$('#payment-address select[name=\'zone_id\'] + br').after('<span class="error">' + json['error']['zone'] + '</span>');
}

if (json['error']['password']) {
$('#payment-address input[name=\'password\'] + br').after('<span class="error">' + json['error']['password'] + '</span>');
}

if (json['error']['confirm']) {
$('#payment-address input[name=\'confirm\'] + br').after('<span class="error">' + json['error']['confirm'] + '</span>');
}
} else {
<?php if ($shipping_required) { ?>
var shipping_address = $('#payment-address input[name=\'shipping_address\']:checked').attr('value');

if (shipping_address) {
$.ajax({
url: 'index.php?route=checkout/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-method .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#shipping-method .checkout-content').slideDown('slow');

$('#checkout .checkout-heading a').remove();
$('#payment-address .checkout-heading a').remove();
$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#shipping-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');

$.ajax({
url: 'index.php?route=checkout/address/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);
}
}
});
}
}
});
} else {
$.ajax({
url: 'index.php?route=checkout/address/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#shipping-address .checkout-content').slideDown('slow');

$('#checkout .checkout-heading a').remove();
$('#payment-address .checkout-heading a').remove();
$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
}
<?php } else { ?>
$.ajax({
url: 'index.php?route=checkout/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-method .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#payment-method .checkout-content').slideDown('slow');

$('#checkout .checkout-heading a').remove();
$('#payment-address .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
<?php } ?>

$.ajax({
url: 'index.php?route=checkout/address/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-address .checkout-content').html(json['output']);

$('#payment-address .checkout-heading span').html('<?php echo $text_checkout_payment_address; ?>');
}
}
});
}
}
});
});

// Payment Address
$('#payment-address #button-address').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/address/payment',
type: 'post',
data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'password\'], #payment-address input[type=\'checkbox\']:checked, #payment-address input[type=\'radio\']:checked, #payment-address select'),
dataType: 'json',
beforeSend: function() {
$('#payment-address #button-address').attr('disabled', true);
$('#payment-address #button-address').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#payment-address #button-address').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['firstname']) {
$('#payment-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
}

if (json['error']['lastname']) {
$('#payment-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
}

if (json['error']['telephone']) {
$('#payment-address input[name=\'telephone\']').after('<span class="error">' + json['error']['telephone'] + '</span>');
}

if (json['error']['address_1']) {
$('#payment-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
}

if (json['error']['city']) {
$('#payment-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
}

if (json['error']['postcode']) {
$('#payment-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
}

if (json['error']['country']) {
$('#payment-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
}

if (json['error']['zone']) {
$('#payment-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
}
} else {
<?php if ($shipping_required) { ?>
$.ajax({
url: 'index.php?route=checkout/address/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#shipping-address .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading a').remove();
$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
<?php } else { ?>
$.ajax({
url: 'index.php?route=checkout/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-method .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#payment-method .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
<?php } ?>

$.ajax({
url: 'index.php?route=checkout/address/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-address .checkout-content').html(json['output']);
}
}
});
}
}
});
});

// Shipping Address
$('#shipping-address #button-address').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/address/shipping',
type: 'post',
data: $('#shipping-address input[type=\'text\'], #shipping-address input[type=\'password\'], #shipping-address input[type=\'checkbox\']:checked, #shipping-address input[type=\'radio\']:checked, #shipping-address select'),
dataType: 'json',
beforeSend: function() {
$('#shipping-address #button-address').attr('disabled', true);
$('#shipping-address #button-address').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#shipping-address #button-address').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['firstname']) {
$('#shipping-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
}

if (json['error']['lastname']) {
$('#shipping-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
}

if (json['error']['email']) {
$('#shipping-address input[name=\'email\']').after('<span class="error">' + json['error']['email'] + '</span>');
}

if (json['error']['telephone']) {
$('#shipping-address input[name=\'telephone\']').after('<span class="error">' + json['error']['telephone'] + '</span>');
}

if (json['error']['address_1']) {
$('#shipping-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
}

if (json['error']['city']) {
$('#shipping-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
}

if (json['error']['postcode']) {
$('#shipping-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
}

if (json['error']['country']) {
$('#shipping-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
}

if (json['error']['zone']) {
$('#shipping-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
}
} else {
$.ajax({
url: 'index.php?route=checkout/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-method .checkout-content').html(json['output']);

$('#shipping-address .checkout-content').slideUp('slow');

$('#shipping-method .checkout-content').slideDown('slow');

$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#shipping-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}

$.ajax({
url: 'index.php?route=checkout/address/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);
}
}
});
}
});
}
}
});
});

// Guest
$('#button-guest').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/guest',
type: 'post',
data: $('#payment-address input[type=\'text\'], #payment-address input[type=\'checkbox\']:checked, #payment-address select'),
dataType: 'json',
beforeSend: function() {
$('#button-guest').attr('disabled', true);
$('#button-guest').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-guest').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['firstname']) {
$('#payment-address input[name=\'firstname\'] + br').after('<span class="error">' + json['error']['firstname'] + '</span>');
}

if (json['error']['lastname']) {
$('#payment-address input[name=\'lastname\'] + br').after('<span class="error">' + json['error']['lastname'] + '</span>');
}

if (json['error']['email']) {
$('#payment-address input[name=\'email\'] + br').after('<span class="error">' + json['error']['email'] + '</span>');
}

if (json['error']['telephone']) {
$('#payment-address input[name=\'telephone\'] + br').after('<span class="error">' + json['error']['telephone'] + '</span>');
}

if (json['error']['address_1']) {
$('#payment-address input[name=\'address_1\'] + br').after('<span class="error">' + json['error']['address_1'] + '</span>');
}

if (json['error']['city']) {
$('#payment-address input[name=\'city\'] + br').after('<span class="error">' + json['error']['city'] + '</span>');
}

if (json['error']['postcode']) {
$('#payment-address input[name=\'postcode\'] + br').after('<span class="error">' + json['error']['postcode'] + '</span>');
}

if (json['error']['country']) {
$('#payment-address select[name=\'country_id\'] + br').after('<span class="error">' + json['error']['country'] + '</span>');
}

if (json['error']['zone']) {
$('#payment-address select[name=\'zone_id\'] + br').after('<span class="error">' + json['error']['zone'] + '</span>');
}
} else {
<?php if ($shipping_required) { ?>
var shipping_address = $('#payment-address input[name=\'shipping_address\']:checked').attr('value');

if (shipping_address) {
$.ajax({
url: 'index.php?route=checkout/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-method .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#shipping-method .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading a').remove();
$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
$('#shipping-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}

$.ajax({
url: 'index.php?route=checkout/guest/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);
}
}
});
}
});
} else {
$.ajax({
url: 'index.php?route=checkout/guest/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-address .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#shipping-address .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading a').remove();
$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
}
<?php } else { ?>
$.ajax({
url: 'index.php?route=checkout/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-method .checkout-content').html(json['output']);

$('#payment-address .checkout-content').slideUp('slow');

$('#payment-method .checkout-content').slideDown('slow');

$('#payment-address .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#payment-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
<?php } ?>
}
}
});
});

// Guest Shipping
$('#button-guest-shipping').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/guest/shipping',
type: 'post',
data: $('#shipping-address input[type=\'text\'], #shipping-address select'),
dataType: 'json',
beforeSend: function() {
$('#button-guest-shipping').attr('disabled', true);
$('#button-guest-shipping').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-guest-shipping').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['firstname']) {
$('#shipping-address input[name=\'firstname\']').after('<span class="error">' + json['error']['firstname'] + '</span>');
}

if (json['error']['lastname']) {
$('#shipping-address input[name=\'lastname\']').after('<span class="error">' + json['error']['lastname'] + '</span>');
}

if (json['error']['address_1']) {
$('#shipping-address input[name=\'address_1\']').after('<span class="error">' + json['error']['address_1'] + '</span>');
}

if (json['error']['city']) {
$('#shipping-address input[name=\'city\']').after('<span class="error">' + json['error']['city'] + '</span>');
}

if (json['error']['postcode']) {
$('#shipping-address input[name=\'postcode\']').after('<span class="error">' + json['error']['postcode'] + '</span>');
}

if (json['error']['country']) {
$('#shipping-address select[name=\'country_id\']').after('<span class="error">' + json['error']['country'] + '</span>');
}

if (json['error']['zone']) {
$('#shipping-address select[name=\'zone_id\']').after('<span class="error">' + json['error']['zone'] + '</span>');
}
} else {
$.ajax({
url: 'index.php?route=checkout/shipping',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#shipping-method .checkout-content').html(json['output']);

$('#shipping-address .checkout-content').slideUp('slow');

$('#shipping-method .checkout-content').slideDown('slow');

$('#shipping-address .checkout-heading a').remove();
$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#shipping-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
}
});
}
}
});
});

$('#button-shipping').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/shipping',
type: 'post',
data: $('#shipping-method input[type=\'radio\']:checked, #shipping-method textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-shipping').attr('disabled', true);
$('#button-shipping').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-shipping').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['warning']) {
$('#shipping-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');

$('.warning').fadeIn('slow');
}
} else {
$.ajax({
url: 'index.php?route=checkout/payment',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#payment-method .checkout-content').html(json['output']);

$('#shipping-method .checkout-content').slideUp('slow');

$('#payment-method .checkout-content').slideDown('slow');

$('#shipping-method .checkout-heading a').remove();
$('#payment-method .checkout-heading a').remove();

$('#shipping-method .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError);
}
});
}
}
});
});

$('#button-payment').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/payment',
type: 'post',
data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-payment').attr('disabled', true);
$('#button-payment').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-payment').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['error']) {
if (json['error']['warning']) {
$('#payment-method .checkout-content').prepend('<div class="warning" style="display: none;">' + json['error']['warning'] + '</div>');

$('.warning').fadeIn('slow');
}
} else {
$.ajax({
url: 'index.php?route=checkout/confirm',
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}

if (json['output']) {
$('#confirm .checkout-content').html(json['output']);

$('#payment-method .checkout-content').slideUp('slow');

$('#confirm .checkout-content').slideDown('slow');

$('#payment-method .checkout-heading a').remove();

$('#payment-method .checkout-heading').append('<a><?php echo $text_modify; ?></a>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError);
}
});
}
}
});
});
//--></script>
<?php echo $footer; ?>