Call to a member in SendOrdertoClient

bron

No avatar

2007-08-12 19:36

Mam pytanie. Wlaczylem plugin SendOrderToClient. Jest zainstalowany wg instrukcji. Jednak nie dziala. Mam taki blad:
Fatal error: Call to a member function throwData() on a non-object in /core/couriers-ff.php on line 48

Nie znalazlem odpowiedzi na forum. Dodam, ze aktualizowalem baze i sklep do wersji 2.2. Wszystko poza tym dziala OK, maile z kontaktu (formularz) dochodza. Prosze o pomoc.

» Quick.Cart v2.x

treewood (OpenSolution)

Avatar: treewood

2007-08-13 08:38

bron - ciekawa sytuacja ale szczerze to musialbym zajzec do kodu PHP Twojego sklepu by sprawdzic poprawnosc inaczej to ciezko cokolwiek zasugerowac.

bron

No avatar

2007-08-13 09:27

<?php
if( !function_exists'dbSaveCourier' ) ){
  
/**
  * Save courier to file
  * @return void
  * @param array  $aForm
  * @param bool   $bExist
  */
  
function dbSaveCourier$aForm$bExist ){
    global 
$oFF;
    
$oFF->setRow( Array(  $aForm['iCourier'], $aForm['sName'], $aForm['fPrice'] ) );
    
$oFF->setData( Array( 12) );
    if( isset( 
$bExist ) )
      
$oFF->changeInFileDB_COURIERS$aForm['iCourier'], 0'sort' );
    else
      
$oFF->addToFileDB_COURIERS'sort' );
  } 
// end function dbSaveCourier
}

if( !
function_exists'dbDelCourier' ) ){
  
/**
  * Delete courier
  * @return void
  * @param int  $iCourier
  */
  
function dbDelCourier$iCourier ){
    
$GLOBALS['oFF']->deleteInFileDB_COURIERS$iCourier);
  } 
// end function dbDelCourier
}

if( !
function_exists'dbListCouriers' ) ){
  
/**
  * Return couriers list
  * @return array
  */
  
function dbListCouriers( ){
    return 
$GLOBALS['oFF']->throwFileArrayDB_COURIERS );
  } 
// end function dbListCouriers
}

if( !
function_exists'dbThrowCourier' ) ){
  
/**
  * Return courier data
  * @return array
  * @param int  $iCourier
  */
  
function dbThrowCourier$iCourier ){
    return 
$GLOBALS['oFF']->throwDataDB_COURIERS$iCourier);
  } 
// end function dbThrowCourier
}
?>

bron

No avatar

2007-08-13 09:29

Powyzej jest kod couriers-ff.php. Sam plik chyba jest dobry, bo bez pluginu wszystko dziala. Ponizej kod z pluginu sendOrdertoClient, plik actions_client.php:


<?php
if( $p == 'ordersDelivery' && isset( $_SESSION['iOrderSession_'.LANGUAGE] ) && is_numeric$_SESSION['iOrderSession_'.LANGUAGE] ) ){
  
  if( !
function_exists'throwOrdersIdTemp' ) ){
    require_once 
DIR_CORE.'orders-'.$config['db_type'].'.php';
    require_once 
DIR_CORE.'orders.php';

    require_once 
DIR_CORE.'couriers-ff.php';
    require_once 
DIR_CORE.'couriers.php';
  }

  if( isset( 
$_POST['sOption'] ) && $_POST['sOption'] == 'send' && checkOrderFields$_POST ) ){
    
$iOrder     $_SESSION['iOrderSession_'.LANGUAGE];
    
$sTo        $_POST['sEmail'];
    
$sTemplate  $config['language'].'_sendOrderToClient.tpl';
    
$sTitle     $tpl->tbHtml$sTemplate'EMAIL_TITLE' );
    
    
$sEmailContent listBasket$iOrder$sTemplate );

    if( !empty( 
$_POST['iCourier'] ) && !empty( $sEmailContent ) ){
      
$sEmailContent $tpl->tbHtml$sTemplate'EMAIL_HEAD' ).$sEmailContent;
      
$aCourier explode'|'$_POST['iCourier'] );
      
$aCourier throwCourier$aCourier[0] );
      if( 
function_exists'changeCourierPaymentPrice' ) )
        
changeCourierPaymentPrice$aCourier$iOrder );
      
$fSummary tPrice$aCourier['fPrice'] + $aList['fSummary'] );
      
$sSummary changePriceFormat$fSummary );
      
$sEmailContent .=  $tpl->tbHtml$sTemplate'EMAIL_FOOT' );
    }

    @
mail$sTo$sTitleereg_replace'\|n\|'"\n"$sEmailContent ), 'FROM: '.$config['email']."\r\nContent-Type: text/plain; charset=".$config['charset']."\r\n" );
  }
}
?>

bron

No avatar

2007-08-14 00:31

Ok problem rozwiazany. Chyba przez to, ze wklejalem wlaczanie plugina do obu plikow: actions_client i plugins.php, a w plugins.php ma go nie byc. Sorki za klopot. Moze komus sie przyda :).

Do góry
o nas | kontakt