Opencart页面意外停止,并显示一条消息“使用未定义的常数VERSION-假定为'VERSION'”?

问题描述 投票:0回答:1
Warning: Use of undefined constant VERSION - assumed 'VERSION' (this will throw an Error in a future version of PHP) in /home/xxxxxxx/you-r.in/public_html/catalog/controller/extension/module/so_extra_slider.php on line 193

该站点已停止工作,并突然显示此消息警告。 php和Opencart版本都没有更新。代码如下:

// Check Version
if(version_compare(VERSION, '2.1.0.2', '>')) {
    if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
        $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
    } else {
        $price = false;
    }
}

检查域:http://you-r.in/

php opencart opencart2.x opencart-3
1个回答
0
投票

查看index.php,其中定义了普通版本。例如

<?php
// Version
define('VERSION', '2.3.0.2.3');

您可以添加这样的版本定义

define('VERSION', 'your-version-number');
// Check Version
if(version_compare(VERSION, '2.1.0.2', '>')) {
© www.soinside.com 2019 - 2024. All rights reserved.