lightspeedretail / webstore

Web Store eCommerce solution for Lightspeed
http://www.lightspeedpos.com/webstore
Open Software License 3.0
85 stars 63 forks source link

URL issues on Windows #551

Closed kevinvangelder closed 11 years ago

kevinvangelder commented 11 years ago

The site was not loading up stylesheets or javascript files on my local Windows development machine.

I was able to trace the issue back to use of dirname() which returns \ instead of / on Windows. Specifically, line 795 of includes/xlsws/_functions.php I think the best solution is to create a new function in includes/qcodo/_core/framework/QApplicationBase.class.php that runs the dirname() function but replaces backslashes with forwardslashes.

    public static function GetScriptDirectory() {
        return str_replace("\\", "/", dirname(QApplication::$ScriptName));
    }

and referencing it in _functions.php:

    $strHost = $_SERVER['HTTP_HOST'] . QApplication::GetScriptDirectory();

Now all of my stylesheets are loading as is most of the javascript (some of them link to website.com/website.com/... for some reason)

kevinvangelder commented 11 years ago

I was able to fix the second issue (qcodo's javascript files not loading) by removing __SUBDIRECTORY__ from line 63 of includes/configurationpaths.inc.php

    define ('__JS_ASSETS__', '/assets/js');