dsafew1231
2015-02-18 09:06 阅读 20
已采纳

OpenCart和支付模块mollie - 返回str_replace

I hope to receive some information here on the following subject:

calling this function:

protected function getAdminDirectory()
{
    return str_replace(HTTP_SERVER, '', HTTP_ADMIN);
}

ends in this php statement:

PHP Notice: Use of undefined constant HTTP_ADMIN - assumed 'HTTP_ADMIN' in /xx/xxx/xxx/www/catalog/controller/payment/mollie_ideal.php on line 452

This statements seems to retrieve the admin directory but the constant is undefined, I'm uncertain on where to define it there for my question would be if I could make this static since the directory is known.

If so how would it look like?

{
    return str_replace(HTTP_SERVER, 'admin', admin);
}

Using opencart 2.0.1.1 and Mollie version 5.2.6 https://github.com/mollie/OpenCart/releases

Thank you in advanced.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    donglun2024 donglun2024 2015-02-19 15:33

    For anyone else having this problem:

     */
    protected function getAdminDirectory()
    {
        // if no default admin url defined in the config, use the default admin directory.
        if (!defined('HTTP_ADMIN'))
        {
            return 'admindirectory/';
        }
    
        return str_replace(HTTP_SERVER, '', HTTP_ADMIN);
    }
    

    in catalog/controller/payment/mollie_ideal.php

    点赞 评论 复制链接分享
  • dongmiyu8979 dongmiyu8979 2015-02-18 14:56

    You should add an admin directory directive in your config.php file.

    define('HTTP_ADMIN', 'http://xxxx.xx/admindirectory/'); (usually just admin/)

    点赞 评论 复制链接分享

相关推荐