Pri zvolení platby cez PayPal sa my neprenesie na PayPal konečná cena výrobku (cena sa musí zadať ručne).
Predpokladám že chyba bude niekde tu:
echo '<script>document.location="./paypal/process.php?oid='.$oid.'&email='.$Paypal_Email.'&amount='.$enter_amount.'";</script>';
Prikladám celý PHP kód:
<?php
if($_SESSION['SESSIONUSERID']=='')
echo '<script>document.location="index.php?show=login"; </script>';
if($payment_opt)
{
$ord_id=$CURRENT_TIME;
$Res=$dbh->query("select b.auction_type,b.target_price,b.start_price,b.fina l_bid,b.end_bid,d.title,b.normal_rate,b.delivery_c ost,b.delivery_condition,b.fixed_price from bid as b left join bid_details as d on b.id=d.item_id where b.id='$item_id' and d.lang='".$_SESSION['LANG']."'");
$Data1=@mysql_fetch_object($Res);
if($Data1->auction_type=='P')
$purchase_price=$Data1->normal_rate;
if($Data1->delivery_condition=='B')
$enter_amount=($purchase_price+$Data1->delivery_cost);
else if($Data1->delivery_condition=='S')
{
if($Data1->target_price<$Data1->final_bid)
$enter_amount=$purchase_price;
else
$enter_amount=$purchase_price+$Data1->delivery_cost;
}
$result=$dbh->query("select paytime from account where item_id ='$item_id' and paystatus='Pending' order by id desc");
if(@mysql_num_rows($result)>0)
{
$Data2=@mysql_fetch_object($result);
$Currtime=$CURRENT_TIME;
$Remtime=($Currtime-$Data2->paytime);
if($Remtime<$Wait_time)
$Paystatus='N';
else
$Paystatus='Y';
}
else
{
$Paystatus='Y';
}
if($Data1->end_bid=='Y' || $Data1->end_bid=='S' || $Paystatus=='N')
{
if($Paystatus=='N')
echo '<script>document.location="index.php?show=add_bid &item_id='.$item_id.'&error=6";</script>';
else
echo '<script>document.location="index.php?show=add_bid &item_id='.$item_id.'&error=3";</script>';
}
else
{
$qrySavePage="insert into account(user_id,amount ,payment_opt,entrydate,order_id,item_id)values('". $_SESSION['SESSIONUSERID']."','$enter_amount','$payment_opt','$CURRENT_Time' ,'$ord_id','$item_id')";
$result=$dbh->query($qrySavePage);
$oid=md5($ord_id);
if($result)
{
$Item_title=ucfirst($Data1->title);
if($payment_opt=='A')
echo '<script>document.location="./authorise.net/zaplatte_teraz-objednavka.html?oid='.$oid.'&amount=
'.$enter_amount.'";</script>';
else if($payment_opt=='P')
echo '<script>document.location="./paypal/process.php?oid='.$oid.'&email=
'.$Paypal_Email.'&amount='.$enter_amount.'";</script>';
else if($payment_opt=='DIBS')
echo '<script>document.location="./dibs/payform.php?oid='.$oid.'&des=
'.$Item_title.'&amount='.$enter_amount.'&item_id=' .$item_id.'";</script>';
}
}
}
$sqlResult=$dbh->query("select b.*, d.title from bid as b left join bid_details as d on b.id=d.item_id where b.id='$item_id' and b.status='Y' and b.start='Y' and b.running='Y' and b.deleted='N' and b.end_bid!='Y' and b.end_bid!='S' and d.lang='".$_SESSION['LANG']."'");
$sqlRow=@mysql_fetch_object($sqlResult);
if($sqlRow->auction_type=='P')
{
$Item_title=ucfirst($sqlRow->title);
$image_path="bid_images/watermark_".$sqlRow->image_path;
if($sqlRow->image_path!='' && file_exists($image_path))
$update_image=$functions->Get_newimage($image_path,400,310);
else
$update_image=$functions->Get_newimage("images/mainsite/400x310_img_nfound.jpg",400,310);
$imge=' <div style="background:url('.$update_image.') center no-repeat; height:310px; width:400px;">
<div> <img src="'.$watermark.'" border="0" style="padding-left:3px;" align="left" height="187" width="186" /></div>
</div>';
if($sqlRow->end_bid=='Y')
{
$normal_price='<tr>
<td width="100%" align="left"><div class="text61">'.$lang['purchase_price'].' : </div>
<div class="pause2"><strong>'.$functions->Get_Price_format($sqlRow->normal_rate).'</strong></div></td>
</tr>
<tr><td height="5"></td></tr>';
$Bid_link='<div class="text11">'.$lang['bid_sold'].'</div>';
}
else
{
$normal_price='<tr>
<td width="50%" align="right"><div class="text61">'.$lang['purchase_price'].' : </div></td>
<td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($sqlRow->normal_rate).'</strong></div></td>
</tr>
<tr><td height="5"></td></tr>
<tr>
<td width="50%" align="right"><div class="text61">'.$lang['shipping_charges'].' : </div></td>
<td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($sqlRow->delivery_cost).'</strong></div></td>
</tr>
<tr><td height="5"></td></tr>';
if($sqlRow->auction_type=='P')
$purchase_price=$sqlRow->normal_rate;
if($sqlRow->delivery_condition=='B')
$total_cost=($purchase_price+$sqlRow->delivery_cost);
else if($sqlRow->delivery_condition=='S')
{
if($sqlRow->target_price<$sqlRow->final_bid)
$total_cost=$purchase_price;
else
$total_cost=$purchase_price+$sqlRow->delivery_cost;
}
$normal_price.='<tr>
<td width="50%" align="right"><div class="text61">'.$lang['total_cost'].' : </div></td>
<td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($total_cost).'</strong></div></td>
</tr>
<tr><td height="5"></td></tr> ';
$Bid_link='<input type="submit" name="submit" value='.$lang['buy'].'>';
if($Paypal_status=='Y')
$pay_opt1='<input type="radio" name="payment_opt" value="P" checked="checked"> '.$lang['pay'].'';
if($Authorize_status=='Y')
$pay_opt2='<input type="radio" name="payment_opt" value="A" checked="checked">
'.$lang['cc'].' ('.$lang['au_net'].') ';
if($Paypal_status=='N' && $Authorize_status=='N')
$pay_opt2=$lang['No_payment_option_available'];
}
}
?>
Za pomoc vopred ďakujem.


