OpenCart语法错误,意外T_VARIABLE,期待T_FUNCTION

时间:2015-07-06 19:27:05

标签: opencart vqmod

当有人试图在我的opencart商店结帐时,我收到此错误:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /public_html/vqmod/vqcache/vq2-catalog_model_checkout_order.php on line 197

这是来自vq2-catalog_model_checkout_order.php文件的类似197

$order_query = $this->db->query("SELECT *, (SELECT os.name FROM `" . DB_PREFIX . "order_status` os WHERE os.order_status_id = o.order_status_id AND os.language_id = o.language_id) AS order_status FROM `" . DB_PREFIX . "order` o WHERE o.order_id = '" . (int)$order_id . "'");

                $category_query = $this->db->query("SELECT cd.name FROM `" . DB_PREFIX . "product_to_category` pc INNER JOIN `" . DB_PREFIX . "category_description` cd ON pc.category_id = cd.category_id WHERE pc.product_id = '" . (int)$product['product_id'] . "' AND cd.language_id = '" . (int)$language_id . "'");

            $i = 0;
            foreach ($category_query->rows as $category) {
                $i++;
                if ($i <= 5) {
                    $category_data .= $category['name'] . '/';
                }
            }

            $category_data = rtrim($category_data, '/');

            if ($option_data) {
                $name = utf8_substr($product['name'] . ' - ' . $option_data, 0, 80);
            } else {
                $name = utf8_substr($product['name'], 0, 80);
            }

            $products[] = array(
                'name'     => $name,
                'sku'      => $product['model'],
                'category' => $category_data,
                'price'    => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), false, $order_query->row['currency_value']),
                'quantity' => $product['quantity']
            );
        }

        return array(
            'order_id'      => $order_query->row['order_id'],
            'store_name'    => $order_query->row['store_name'],
            'products'      => $products,
            'total'         => $this->currency->format($order_query->row['total'], false, $order_query->row['currency_value']),
            'currency_code' => $order_query->row['currency_code']
        );
    } else {
        return false;
    }   
}


    $order_query = $this->db->query("SELECT *, (SELECT os.name FROM `" . DB_PREFIX . "order_status` os WHERE os.order_status_id = o.order_status_id AND os.language_id = o.language_id) AS order_status FROM `" . DB_PREFIX . "order` o WHERE o.order_id = '" . (int)$order_id . "'");

    if ($order_query->num_rows) {
        $country_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "country` WHERE country_id = '" . (int)$order_query->row['payment_country_id'] . "'");

        if ($country_query->num_rows) {
            $payment_iso_code_2 = $country_query->row['iso_code_2'];
            $payment_iso_code_3 = $country_query->row['iso_code_3'];
        } else {
            $payment_iso_code_2 = '';
            $payment_iso_code_3 = '';
        }

        $zone_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE zone_id = '" . (int)$order_query->row['payment_zone_id'] . "'");

        if ($zone_query->num_rows) {
            $payment_zone_code = $zone_query->row['code'];
        } else {
            $payment_zone_code = '';
        }

        $country_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "country` WHERE country_id = '" . (int)$order_query->row['shipping_country_id'] . "'");

        if ($country_query->num_rows) {
            $shipping_iso_code_2 = $country_query->row['iso_code_2'];
            $shipping_iso_code_3 = $country_query->row['iso_code_3'];
        } else {
            $shipping_iso_code_2 = '';
            $shipping_iso_code_3 = '';
        }

        $zone_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE zone_id = '" . (int)$order_query->row['shipping_zone_id'] . "'");

        if ($zone_query->num_rows) {
            $shipping_zone_code = $zone_query->row['code'];
        } else {
            $shipping_zone_code = '';
        }

        $this->load->model('localisation/language');

        $language_info = $this->model_localisation_language->getLanguage($order_query->row['language_id']);

0 个答案:

没有答案