--- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -489,15 +489,16 @@ class ShopCore extends ObjectModel */ public function getBaseURL($auto_secure_mode = true, $add_base_uri = true) { - if ($auto_secure_mode && Tools::usingSecureMode()) { - if (!$this->domain_ssl) { - return false; - } - $url = 'https://' . $this->domain_ssl; + // EduBox: use the current request host so local access on non-standard + // ports (e.g. localhost:8088) and reverse-proxy domains both work. + $host = Tools::getHttpHost(false, false, false); + if (substr($host, -3) === ':80' || substr($host, -4) === ':443') { + $host = substr($host, 0, strrpos($host, ':')); + } + + if ($auto_secure_mode && Tools::usingSecureMode()) { + $url = 'https://' . $host; } else { - if (!$this->domain) { - return false; - } - $url = 'http://' . $this->domain; + $url = 'http://' . $host; } if ($add_base_uri) {