Hi there,
I am making a shopping cart script.
Coding diffrent type of paymodule.
For some reason doesnt want to show paypal.
In administion panel, paypal module is on.
No matter what is on , its always on check money order.
How can i make this ?
I am posting bunch oh html code, my excuse for that to all readers of this post.
Thank you ,
Rutin,
code:
<? if ($pay_mode_t == "paypall") { ?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form1">
<? } else {?>
</form>
<form name="form1" method="post" action="">
<? } ?>
Step1 Shipping Address Payment Details
<table width="98%" border="0" align="center" class="borderrosu">
<tr bgcolor="#8A4105">
<td colspan="2">Shipping Address</td>
</tr>
<tr class="bodytextmare">
<td colspan="2"> <? if ($address_no == "n/a" or $address_no == "") { ?>
<? echo $row_address_prim[2]?><? echo $row_address_prim[3]?>
<? } else { ?>
<? echo $row_address_sup[2]?><? echo $row_address_sup[3]?>
<? } ?>
<? if ($address_no == "n/a" or $address_no == "") { ?>
<? echo $row_address_prim[7]?>
<? } else { ?>
<? echo $row_address_sup[5]?>
<? } ?>
<? if ($address_no == "n/a" or $address_no == "") { ?>
<? echo $row_address_prim[8]?>, <? echo $row_address_prim[9]?>
<? $ship_id = 0;?>
<? } else { ?>
<? echo $row_address_sup[6]?>, <? echo $row_address_sup[7]?>
<? $ship_id = $row_address_sup[0];?>
<? } ?> </td>
</tr>
<tr>
<td>
<? if ($address_no == "n/a" or $address_no == "") { ?>
<? echo $row_address_prim[10]?>, <? echo $row_address_prim[11]?>
<? $country = $row_address_prim[11]; ?>
<? } else { ?>
<? echo $row_address_sup[8]?>, <? echo $row_address_sup[9]?>
<? $country = $row_address_sup[9]; ?>
<? } ?> </td>
<td><a href="checkout_shipping_address.php"><img src="images/change.gif" width="51" height="19" border="0"></a></div></td>
</tr>
</table>
<table width="98%" border="0" align="center" class="borderrosu">
<?
for ($i = mysql_num_rows($sel_shop) - 1; $i >= 0; $i--)
{
mysql_data_seek($sel_shop, $i);
$row_shop = mysql_fetch_array($sel_shop);
$sel_prod = mysql_query("SELECT * from products where products_id = '" . $row_shop[2] . "'");
$row_prod = mysql_fetch_array($sel_prod);
?>
<? } ?>
<?
$sel_ship = mysql_query("SELECT * from shipping_tax where country = 'ALL' and prod_id = '" . $row_prod[0] . "'");
if (mysql_num_rows($sel_ship) == 0)
{
$sel_ship = mysql_query("SELECT * from shipping_tax where country = '" . $country . "' and prod_id = '" . $row_prod[0] . "'"); }
if (mysql_num_rows($sel_ship) <> 0) {
?>
<tr>
<td colspan="2"> <select name="shipping_meth" id="shipping_meth" onChange="javascript:submit();">
<?
for ($oo = mysql_num_rows($sel_ship) - 1; $oo >= 0; $oo--)
{
mysql_data_seek($sel_ship, $oo);
$row_ship = mysql_fetch_array($sel_ship);
?>
<option value="<? echo $row_ship[1]?>" <? if ($shipping_meth == $row_ship[1]) { echo "selected";} ?>><? echo $row_ship[1]?></option>
<?
}
?>
</select>
</div>
<input name="pay_mode_t" type="radio" value="cc" <? if ($pay_mode_t == "cc" or $pay_mode_t == "") echo "checked";?> onClick="javascript:submit();">
Credit Card
<input type="radio" name="pay_mode_t" value="paypall" <? if ($pay_mode_t == "paypall") echo "checked";?> onClick="javascript:submit();">
Pay Pal
<input type="radio" name="pay_mode_t" value="mo" <? if ($pay_mode_t == "mo") echo "checked";?> onClick="javascript:submit();">
Check/Money Order
<div> <? echo $simbol?>
<?
for ($i = mysql_num_rows($sel_shop) - 1; $i >= 0; $i--)
{
mysql_data_seek($sel_shop, $i);
$row_shop = mysql_fetch_array($sel_shop);
if ($shipping_meth == "")
{
$sel_ship_2 = mysql_query("SELECT * from shipping_tax where country = 'ALL' and prod_id = '" . $row_shop[2] . "'");
if (mysql_num_rows($sel_ship_2) == 0)
{
$sel_ship_2 = mysql_query("SELECT * from shipping_tax where country = '" . $country . "' and prod_id = '" . $row_shop[2] . "'");
}
if (mysql_num_rows($sel_ship_2) <> 0)
{
$row_ship_2 = mysql_fetch_array($sel_ship_2);
$ship_tax_tot = number_format($row_ship_2[3], 2);
$ship_tax_tot_list = $ship_tax_tot_list + $ship_tax_tot;
$ship_met_send = $row_ship_2[1];
}
else
{
$ship_tax_tot = 0;
$ship_tax_tot_list = $ship_tax_tot_list + $ship_tax_tot;
}
}
else
{
$sel_ship_2 = mysql_query("SELECT * from shipping_tax where country = 'ALL' and denumire = '" . $shipping_meth . "' and prod_id = '" . $row_shop[2] . "'");
if (mysql_num_rows($sel_ship_2) == 0)
{
$sel_ship_2 = mysql_query("SELECT * from shipping_tax where country = '" . $country . "' and denumire = '" . $shipping_meth . "' and prod_id = '" . $row_shop[2] . "'");
}
if (mysql_num_rows($sel_ship_2) <> 0)
{
$row_ship_2 = mysql_fetch_array($sel_ship_2);
$ship_tax_tot = number_format($row_ship_2[3], 2);
$ship_tax_tot_list = $ship_tax_tot_list + $ship_tax_tot;
$ship_met_send = $row_ship_2[1];
}
else
{
$ship_tax_tot = 0;
$ship_tax_tot_list = $ship_tax_tot_list + $ship_tax_tot;
}
}
}
echo $ship_tax_tot_list*$paritate;
?>
</strong></div> <div><? echo $simbol?>
<?
echo number_format(($sum_total1*$row_vat[3]/100)*$paritate, 2)
?>
</div> <div align="right"><? echo $simbol?> <? echo number_format((($sum_total1+$row_ship[1] + $sum_total1*$row_vat[3]/100) + $ship_tax_tot_list)*$paritate, 2) ?></div></td>
<? } ?>
</tr>
<?
$sel_paytype = mysql_query("SELECT * from paytype Where paytypes = 'Pay Flow Pro' and pay_active = 'yes'");
if (mysql_num_rows($sel_paytype) <> 0) {
?>
<?
$sel_paytype = mysql_query("SELECT * from paytype Where paytypes = 'Pay Pall' and pay_active =' yes'");
if (mysql_num_rows($sel_paytype) <> 0) {
?>
<? } ?>
<?
$sel_paytype = mysql_query("SELECT * from paytype Where paytypes = 'Check/Money Order' and pay_active = 'yes'");
if (mysql_num_rows($sel_paytype) <> 0) {
?>
<? } ?>
<tr >
<td colspan="2"><div></div></td>
</tr>
<tr>
<td colspan="2"><div>
<? if ($pay_mode_t == "cc" or $pay_mode_t == "") { ?>
<a href="pay_2.php?tot=<? echo number_format(($sum_total1+$row_ship[1] + $sum_total1*$row_vat[3]/100) + $ship_tax_tot_list, 2) ?>&send_to=<? echo $ship_id?>&ship_met_send=<? echo $ship_tax_tot_list?>&shop_tax=<? echo number_format($sum_total1*$row_vat[3]/100, 2)?>"><img src="images/next.gif" width="51" height="19" border="0"></a>
<? } ?>
<? if ($pay_mode_t == "mo") {
?>
<a href="pay_mo.php?tot=<? echo number_format(($sum_total1+$row_ship[1] + $sum_total1*$row_vat[3]/100) + $ship_tax_tot_list, 2) ?>&send_to=<? echo $ship_id?>&ship_met_send=<? echo $ship_tax_tot_list?>&shop_tax=<? echo number_format($sum_total1*$row_vat[3]/100, 2)?>"><img src="images/next.gif" ></a>
<? } ?>
<? if ($pay_mode_t == "paypall") { ?>
<? include "pay_pall.php"?>
<input name="image" type="image" title=" Next " src="images/next.gif">
<? } ?>
</div></td>
</tr>
</table>
</form>