kilbot / WooCommerce-POS

:bangbang: All development now at https://github.com/wcpos.
http://wcpos.com
GNU General Public License v3.0
353 stars 125 forks source link

Headers & Footers formating #189

Open JeremyDulon opened 6 years ago

JeremyDulon commented 6 years ago

Hi,

One of my customers tried to install your plugin in Wordpress. He reported to me that the plugin didn't work as expected. The /pos page wasn't loading correctly because of some misslinked resources. As a matter of fact, WC_POS_PLUGIN_URL was not returning a whole url, but only the path to the resource (e.g. "/content-website/website-plugins/woocommerce-pos")

I proceeded to a quick fix in includes/template.php, in both format_css and format_js options.

For each, I concatenated a test to the second condition which was previously only testing if the string was starting with "http". I made it also check if the string is starting with WC_POS_PLUGIN_URL.

Here is what I did: ( substr( $script, 0, 4 ) === 'http' || substr( $script, 0, strlen( WC_POS_PLUGIN_URL ) ) === WC_POS_PLUGIN_URL )

I won't be able to fork and submit a pull request shortly, so I figured it was more helpful to submit an issue.

I'm also open to ideas if better options are available.