2013-06-06 1 views
-2

98 번째 줄에이 오류가 있습니다. 오류가 발생한 클래스가 무엇인지 발견했습니다.

구문 분석 오류 : 구문 오류, 라인 /var/zpanel/hostdata/tsalopulos/public_html/tsalopoulos_gr/fuel/app/modules/checkoutv2/classes/handle.php에서 예상치 못한 $ 끝 98

<?php 

namespace Checkoutv2; 

class Handle{ 

    public static $_items; 

    public $product; 

    public $image; 

    public $price; 

    public $location; 

    public $totals = array(
     'total' => 0, 
     'items' => 0 
    ); 

    public $_user; 


    public $items = array ('items' => array()); 

    public function __construct($cart_items, $user) 
    { 
     static::$_items = $cart_items; 
     $this->price = new \ProductPrice(); 
     $this->image = new \ProductImage(); 

     $this->_user = $user; 
    } 


    public function boot() 
    { 
     foreach(static::$_items as $item) 
     { 
      $this->product = \Model_Product::query() 
       ->related('description') 
       ->where('description.lang_code','=',\Session::get("lang")) 
       ->where('id',$item->get_id()) 
       ->get_one(); 

      $description = $this->getProductDescription($this->product->description); 

      $this->totals['items'] += $item->get_qty(); 
      $this->totals['total'] += round(
        $this->price->getPriceDiscountedInternet(
         $this->price->getPriceDiscounted(
          $item->get_price() 
         ) 
        ),2) * $item->get_qty(); 




      $this->items['items'][] = array(
       'rowid' => $item->get_rowid(), 
       'id'  => $item->get_id(), 
       'ids' => $this->product->id_one.' | '.$this->product->id_two, 
       'image' => $this->image->resizeProductImage($item->get_id()), 
       'description' => $description, 
       'title' => $item->get_name(), 
       'qty' => $item->get_qty(), 
       'qty_north' => $this->product->qty_north, 
       'qty_south' => $this->product->qty_south, 
       'price' => round(
        $this->price->getPriceDiscountedInternet(
         $this->price->getPriceDiscounted(
          $item->get_price() 
         ) 
        ),2), 
       'available' => $this->checkQty($this->product,$item), 
       'have' => $this->product->qty, 
       'sub_total' =>round(
        $this->price->getPriceDiscountedInternet(
         $this->price->getPriceDiscounted(
          $item->get_price() 
         ) 
        ),2) * $item->get_qty(), 
      ); 

     } 

     return array(
      'items' => $this->items, 
      'total' => $this->totals['total'], 
      'total_items' => $this->totals['items'] 
     ); 
    } 

    public function checkQty($product, $item) 
    { 
     $local_qty = $this->getLocalQty(); // line 98 

     if($product->$local_qty < $item->get_qty()) 
      return false; 
     else 
      return true; 
    } 

    public function getLocalQty() 
    { 
     $local = $this->checkUserLocation(); 
     return $local; 
    } 

    //check user location 
    public function checkUserLocation($reverse = false) 
    { 
     if($reverse){ 
      if($this->location == 0) 
       return 'qty_south'; 
      else 
       return 'qty_north'; 
     }else{ 
      if($this->location == 0) 
       return 'qty_north'; 
      else 
       return 'qty_south'; 
     } 
    } 

    public function prepareUser() 
    { 
     $this->location = $this->_user->store; 
    } 


    public function getProductDescription($description) 
    { 
     foreach($description as $desc){ 
      return $desc->title; 
     } 

    } 
} 
+0

'$ (static :: $ _ items as $ item) {'너는이 괄호를 닫지 않았다. –

+2

나는 눈이 먼 @DarylGill을 보지 않으면, 그것 모두가 일치한다고 생각했다. 마지막 줄에'예기치 않은 $ end'라고 써야합니다 :/ – Prisoner

+0

@Prisoner 당신이 나를 혼란스럽게 만들었습니다. –

답변

1

파일은 정상입니다.

Nathans-iMac:Desktop nathan$ php -l Untitled.php

No syntax errors detected in Untitled.php

파일을 웹 서버에 다시 업로드하십시오.

+0

그것은 파일 업로드 오류 일뿐입니다. 이상한 것은 내가 여기에 질문을 게시하기 전에 업로드하려고하는 것입니다. 3 ~ 4 번 .. 흠 –