Jump to content

I am having trouble figuring out how to display the shipping costs :S


dwr

Recommended Posts

hey guys i am facing some problems that are realy starting to anoy me :)

 

first thing is that i cant even figure out how to add shipping costs towards the item detail page ...

 

i have managed to get it in the widget but not in the item page what am i doing wrong ?

 

the $localization are where english and the languages come ....

 


<?php
/**
* This class is used to display the item details
*/
class Display_DItemDetail
{
    function listDetails($arr,$price='',$qty,$buyprice='',$lotrecords='',$total_bids='',$minprice='',$sellerid,$auctype,$ship_details='')
    {
        //print_r($arr);
        include 'admin/cache/sitesettings.php';
        if(isset($_SESSION['language']) && $_SESSION['language']!='')
            $lang = $_SESSION['language'];
        else
            $lang = $sitesettings['language'];
        $path='classes/Lib/Local/'.$lang.'/localization.php';
        include $path;

        include("classes/Core/Views/CVDateCalculation.php");
        $sel="SELECT rate_wise_bidder FROM auction_search WHERE auction_id='".$arr['auction_id']."'";
        $qry=new Lib_Query();
        $qry->executeQuery($sel);
        $rate=$qry->records[0]['rate_wise_bidder'];
        $ratewise=0;
        if($rate>0)
        {
            if(!empty($_SESSION['auctionuserid']))
            {
                $se="SELECT count(*) as num FROM feedback WHERE feedback_to='".$_SESSION['auctionuserid']."' AND user_type=1 AND feedback_type=1";
                $qr=new Lib_Query();
                $qr->executeQuery($se);
                $count=$qr->records[0]['num'];            
                if($rate<=$count)
                    $ratewise=1;
                else
                    $ratewise=0;
            }
        }
         //$ratewise=1;
        $ff= new Core_Views_CVDateCalculation();
        $string_difference = $ff->getDiff($arr['expire_on']);
        if(strlen($string_difference)<=2)
                $date ="Duraion Expired";
        $output = "";
        $output .= '<tr>
            <td colspan="2" align="left" class="profile_list_txt"><span class="details_title">'.stripslashes(html_entity_decode($arr['title'])).'</span></td>
            </tr>';
        if($string_difference!='Duration Expired')
        {
            if($auctype==4)
            {
                $se="SELECT * FROM dutch_lottype WHERE auction_id='".$_GET['id']."' AND status=0";
                $qr=new Lib_Query();
                $qr->executeQuery($se);

                $cnt=count($qr->records);
                for($i=0;$i<$cnt;$i++)
                {
                    $chk=($i==0) ? "checked": "";
                    $output .= '<tr><td class="profile_list_txt" align="right"><input name="lot" id="lot'.($i+1).'"  type="radio"  value="'.($i).'" '.$chk.' /><input type="hidden" name="lotprice'.$i.'" value="'.$qr->records[$i]['lot_price'].'" /><input type="hidden" name="lotqty'.$i.'" value="'.$qr->records[$i]['lot_qty'].'" /><strong><label for ="lot'.($i+1).'">Lot '.($i+1).'</label></strong> : </td>
                            <td class="profile_list_txt"><label>'.$qr->records[$i]['lot_qty'].' '.$localization['ENG1531'].'-'.$qr->records[$i]['lot_price'].' </label></td>
                            </tr>';
                }
                if($cnt>0)
                    $output .= '<tr><td class="profile_list_txt" align="right"> </td><td class="profile_list_txt" align="left"><input type="submit" name="btnBid" id="btnBid" value="Buy Now" class="buy_it_bttn" /></td></tr>';
            }
        }

        if($price)
        {
            if( $string_difference!='Duration Expired')
            {
                if($arr['auct_type']==0)
                {
                    $sel="SELECT * FROM closed_auctions WHERE auction_id='".$arr['auction_id']."'";
                    $qq=new Lib_Query();
                    if(!$qq->executeQuery($sel))
                    {
                        $se="SELECT buy_it_price FROM simple_auction WHERE auction_id='".$arr['auction_id']."'";
                        $qr=new Lib_Query();
                        $qr->executeQuery($se);
                        $buyit=$qr->records[0]['buy_it_price'];
                        if($buyit>0)
                        {        
                            $sql = "SELECT symbol FROM currency_setting WHERE currency_id = '".$sitesettings['currency_set']."'";
                            $query = new Lib_Query();
                            $query->executeQuery($sql);
                            $currency = $query->records[0]['symbol'];
                            $output .= '<tr><td width="29%" align="right" class="profile_list_txt"><span class="buy_it_now">'.$localization['ENG1292'].' </span> '.$localization['ENG1533'].': </td>
                                <td width="71%" class="profile_list_txt"><span class="price_txt">'.$currency.' '.$buyit.'</span> <input type="button" onclick="submt()" name="btnBid" id="btnBid" value="Buy it Now" class="buy_it_bttn" /> </td></tr>';
                        }
                    }
                }
                $sel="SELECT * FROM closed_auctions WHERE auction_id='".$arr['auction_id']."'";
                $qq=new Lib_Query();
                if(!$qq->executeQuery($sel) && $auctype !=6 && $auctype !=5)
                {
                    $sql = "SELECT symbol FROM currency_setting WHERE currency_id = '".$sitesettings['currency_set']."'";
                    $query = new Lib_Query();
                    $query->executeQuery($sql);
                    $currency = $query->records[0]['symbol'];
                    $output .='<tr><td width="29%" align="right" class="profile_list_txt"><span class="buy_it_now">'.$localization['ENG1534'].' </span> '.$localization['ENG1533'].': </td><td width="71%" class="profile_list_txt"><span class="price_txt">'.$currency.' '.$price.'</span></td></tr>';    
                }
                if( $string_difference!='Duration Expired')
                {
                    if($auctype == 2)
                    {
                        $output .= '<tr><td class="profile_list_txt" align="right"><strong>'.$localization['ENG1255'].'</strong> : </td><td class="profile_list_txt"><label><input type="text" name="txtqty" id="txtqty" class="txt_box2"><input type="hidden" name="dqty" id="dqty" value="'.$qty.'" ></label></td></tr>';                      
                    }
                    $sql = "SELECT symbol FROM currency_setting WHERE currency_id = '".$sitesettings['currency_set']."'";
                    $query = new Lib_Query();
                    $query->executeQuery($sql);
                    $currency = $query->records[0]['symbol'];
                    $sqlBid = "SELECT * FROM `closed_auctions` a,reg_users b WHERE a.won_by=b.reg_id AND auction_id='".$_GET['id']."'";                
                    $queryBid = new Lib_Query();
                    if(!$queryBid->executeQuery($sqlBid))
                    {
                        if($auctype == 5 || $auctype == 6)
                        {
                            $output .= '<tr><td class="profile_list_txt" align="right"><strong>'.$localization['ENG1370'].'</strong> : '.$currency.'</td><input type="hidden" name="price" value="'.$price.'" /> <input type="hidden" name="minprice" value="'.$price.'"/><input type="hidden" name="auctionid" value="'.$_GET['id'].'"/><td class="profile_list_txt"><label><input type="text" name="txtbid" id="txtbid" class="txt_box2" />-(Enter more than'.' '.$currency.' '.$price.')<br />';
                        }
                        else
                        {
                            $minprice = $arr['current_bid_amount'];
                            $output .= '<tr><td class="profile_list_txt" align="right"><strong>'.$localization['ENG1370'].'</strong> : '.$currency.'</td><input type="hidden" name="price" value="'.$price.'" /> <input type="hidden" name="minprice" value="'.$minprice.'"/><input type="hidden" name="auctionid" value="'.$_GET['id'].'"/><td class="profile_list_txt"><label><input type="text" name="txtbid" id="txtbid" class="txt_box2" />';
                        }
                    }    
                    else
                    {
                        if(empty($queryBid->records[0]))
                        {
                            $output .='<tr><td class="profile_list_txt" align="right"> </td><td class="profile_list_txt" align="left"><strong>---'.$localization['ENG1535'].'---<br/>---'.$localization['ENG1536'].'---</strong></td></tr>';
                        }
                        else
                        {                        
                            $output .='<tr><td class="profile_list_txt" align="right"><strong>'.$localization['ENG1921'].':</strong></td><td class="profile_list_txt" align="left"><strong>'.$queryBid->records[0]['user_name'].'</strong></td></tr>';
                        }
                    }
                    if($auctype != 2 && !$queryBid->executeQuery($sqlBid) && $auctype != 6 && $auctype != 5)
                        $output .= '-(Enter more than '.$currency.''.$minprice.')<br />';
                    $output .= '</label></td>      </tr>      <tr><td class="profile_list_txt"> </td>';
                    if(!$queryBid->executeQuery($sqlBid))
                    {
                        $output .='<td class="profile_list_txt"><label>
                        <input type="submit" name="btnBid" id="btnBid" value="'.$localization['ENG1372'].'" class="buy_it_bttn" />    </label></td><td> </td>
                      </tr>';
                    }
                    if($buyprice)
                        $output .= '<tr>
                    <td width="29%" align="right" class="profile_list_txt"><span class="buy_it_now">'.$localization['ENG1292'].'</span> '.$localization['ENG1533'].': <span class="price_txt">'.$currency.''.$buyprice.'</span></td>
                    <td width="71%" class="profile_list_txt"><input name="button6" type="submit" class="buy_it_bttn" onclick="submt();" id="button9" value="'.$localization['ENG1292'].'" /></td></tr>';
                }
            }
        }
        elseif ($buyprice)
        {
            if($string_difference!='Duration Expired' && $arr['status']!=2)
            {
                $sql = "SELECT symbol FROM currency_setting WHERE currency_id = '".$sitesettings['currency_set']."'";
                $query = new Lib_Query();
                $query->executeQuery($sql);
                $currency = $query->records[0]['symbol'];
                $output .= '<tr>
                    <td width="29%" align="right" class="profile_list_txt"><span class="buy_it_now">'.$localization['ENG1292'].'</span> '.$localization['ENG1533'].': <span class="price_txt">'.$currency.''.$buyprice.'</span></td>
                    <td width="71%" class="profile_list_txt">';
                $output .= '<input name="button6" type="submit" class="buy_it_bttn" onclick="submt();" id="button9" value="'.$localization['ENG1292'].'" />';
            }
        }
        elseif ($lotrecords)
        {
            if($_SESSION['auctionuserid'] != $sellerid)
            {
                for ($i=0;$i<count($lotrecords);$i++)
                {
                        ($lotrecords);
                }
            }
        }
        if($_GET['auctype']!="won" && $_GET['auctype']!="sold" && $_GET['auctype']!="unsold" )
        {
        $output .= '<tr>
                <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1540'].':</strong></td>
                <td class="profile_list_txt">'.$string_difference.'('.$arr['expire_on'].')</td>
                </tr>';
        }
        if($total_bids >1)
        {
            $output .= '<tr>
                <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1541'].':</strong></td>
                <td class="profile_list_txt"><a href="?do=bidhistory&id='.$_GET['id'].'">'.($total_bids-1).'</a></td>
                </tr>';
        }
        $ship_cost = (isset($ship_details['ship_cost']))?$ship_details['ship_cost']:'';
        if($ship_cost)
        {
            $output .= '<tr>
                    <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1542'].':</strong></td>
                    <td class="profile_list_txt">';
            $output .= '$'.$ship_details['ship_cost'].' <span class="number_txt">('.$localization['ENG1543'].')</span></td>
                    </tr>';
        }
        if($_GET['auctype']!="won" && $_GET['auctype']!="sold" && $_GET['auctype']!="unsold" )
        {
        $output .= '<tr>
                <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1255'].':</strong></td>
                <td class="profile_list_txt">'.$qty.' '.$localization['ENG1544'].'</td>
              </tr>';

        if(isset($_SESSION['auctionuserid']))
        {
            $s="SELECT * FROM  watchlist WHERE user_id=".$_SESSION['auctionuserid']." AND auction_id=".$_GET['id'];
            $q=new Lib_Query();
            if(!$q->executeQuery($s))
            {
                 $output .='<tr>
                        <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1545'].':</strong></td>
                        <td class="profile_list_txt"><a href="?do=itemdetail&action=watch&id='.$_GET['id'].'" class="advanced_search">'.$localization['ENG1546'].'</a></td>
                      </tr>';
            }
        }
        else
        {
            $output .='<tr>
                <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1545'].':</strong></td>
                <td class="profile_list_txt"><a href="?do=itemdetail&action=watch&id='.$_GET['id'].'" class="advanced_search">'.$localization['ENG1546'].'</a></td>
              </tr>';
        }
        }    
        $query=new Lib_Query();
        $sql="select address,city,state,country,zipcode from reg_users_personal where reg_id=".$sellerid;
        if($query->executeQuery($sql))
        {
            $address=$query->records[0]['address'];
            $city=$query->records[0]['city'];
            $state=$query->records[0]['state'];
            $country=$query->records[0]['country'];
            $zipcode=$query->records[0]['zipcode'];
        }
           
        $sql="select state_name from state_province_mas where state_value='".$state."'";
        if($query->executeQuery($sql))
            $state_name=$query->records[0]['state_name'];
           
        $sql="select country_name from country_mas where country_value='".$country."'";
        if($query->executeQuery($sql))
            $country_name=$query->records[0]['country_name'];
        $sq = "SELECT item_condition FROM auction_search WHERE auction_id = '".$_GET['id']."'";
        $q = new Lib_Query();
        if($q->executeQuery($sq))
            $item_condition = $q->records[0]['item_condition'];
        if($item_condition == 0)
            $condt = "New";    
        else if($item_condition == 1)
            $condt = "Used";    
/*        '.$address.'<br>'.$city.'<br><br>'.$zipcode.'*/
        $output.='<tr>
            <td align="right" class="profile_list_txt" valign="top"> <strong>'.$localization['ENG1272'].':</strong></td>
            <td class="profile_list_txt" valign="top">'.$state_name.'<br>'.$country_name.'</td> </tr>
            <tr>
                <td align="right" class="profile_list_txt" valign="top"> <strong>'.$localization['ENG1029'].':</strong></td>
                <td class="profile_list_txt" valign="top">'.$condt.'</td> </tr>';
        return $output;
    }
   
    function listLocation($loc,$flag='')
    {
        include 'admin/cache/sitesettings.php';
        if(isset($_SESSION['language']) && $_SESSION['language']!='')
            $lang = $_SESSION['language'];
        else
            $lang = $sitesettings['language'];
        $path='classes/Lib/Local/'.$lang.'/localization.php';
        include $path;
        $output = "";
        $output .= '<tr>
            <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1272'].':</strong></td>
            <td class="profile_list_txt">'.$loc['address'].",".$loc['country_name'].'</td>
          </tr>';
         if($flag!=1)
         {
         $output .= '    
          <tr>
            <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1545'].':</strong></td>
            <td class="profile_list_txt"><a href="?do=itemdetail&action=watch&id='.$_GET['id'].'" class="advanced_search">'.$localization['ENG1546'].'</a></td>
          </tr>';
          }
          return $output;
    }
    function listPreDetails()
    {
        include 'admin/cache/sitesettings.php';
        if(isset($_SESSION['language']) && $_SESSION['language']!='')
            $lang = $_SESSION['language'];
        else
            $lang = $sitesettings['language'];
        $path='classes/Lib/Local/'.$lang.'/localization.php';
        include $path;
        include("classes/Core/Views/CVDateCalculation.php");
        include("classes/Core/Sell/CFeatureDetails.php");
        $feat = new Core_Sell_CFeatureDetails();
        $ff= new Core_Views_CVDateCalculation();
&nbs

 

thnx for looking

Link to comment
Share on other sites

this here is what i am trying to bind in to the page, but it isnt showing anywhere, except in the widget files......

 

   $ship_cost = (isset($ship_details['ship_cost']))?$ship_details['ship_cost']:'';
        if($ship_cost)
        {
            $output .= '<tr>
                    <td align="right" class="profile_list_txt"><strong>'.$localization['ENG1542'].':</strong></td>
                    <td class="profile_list_txt">';
            $output .= '$'.$ship_details['ship_cost'].' <span class="number_txt">('.$localization['ENG1543'].')</span></td>
                    </tr>';

 

 

or do you mean something else ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.