질문/조언질답게시판
Extra Form
PHP PHP 7.2
CMS XpressEngine

아파치

php7.2.24

XE1.11.5

누리고 2.6.5  https://github.com/bjrambo/nurigo

 

결제->결제정보입력->

마일리지 부분에서 아래와 같은 오류가 나타납니다.

 

Fatal error: Uncaught Error: Using $this when not in object context in /home/masanwatch/www/modules/nproduct/nproduct.item.php:89 Stack trace: #0 /home/masanwatch/www/files/cache/template_compiled/3a2e9f2cf85b939b1b1026ccb734f400.compiled.php(82): nproductItem::printPrice(0) #1 /home/masanwatch/www/classes/template/TemplateHandler.class.php(430): include('/home/masanwatc...') #2 /home/masanwatch/www/classes/template/TemplateHandler.class.php(197): TemplateHandler->_fetch('file:///home/ma...') #3 /home/masanwatch/www/classes/display/HTMLDisplayHandler.php(61): TemplateHandler->compile('./modules/ncart...', 'ordercomplete.h...') #4 /home/masanwatch/www/classes/display/DisplayHandler.class.php(64): HTMLDisplayHandler->toDoc(Object(ncartView)) #5 /home/masanwatch/www/classes/module/ModuleHandler.class.php(1153): DisplayHandler->printContent(Object(ncartView)) #6 /home/masanwatch/www/index.php(59): ModuleHandler->displayContent(Object(ncartView)) #7 {main} thrown in /home/masanwatch/www/modules/nproduct/nproduct.item.php on line 89

  • profile
    $this 오브젝트에 요구하는 값이 없나보네요
  • profile profile
    function printPrice($price = null)
    {

    $oCurrencyModel = getModel('currency');

    if(!$price && printPrice->price)
    {
    $price = $this->price;
    }
    return $oCurrencyModel->printPrice($price);
    }
    =========================
    여기 $this를 클래스명인 $printPrice 으로 고치니 되네요!;