The main plugin instance is available as sfw or window.sfw. To make sure the plugin was already initiated, you should add the sfw-core handle as dependency to your scripts. Read more about the included files under Scripts & Styles.
If you need to load your code earlier, you may add it as dependency to sfw-core via the sfw/js/core_dependencies filter.
The main config
To change the main config, you can use the following filters
|sfw/js||Runs only when the Shop is configured|
The best way to see what info the default config contains, is to enter ‘sfw’ into your Browser Console after the page was loaded.
sfw.get( string key )
Retrieve a config value
sfw.set( string key, mixed value )
Set a config value
sfw.api, sfw.spreadshirt, sfw.spreadshirtAPI, sfw.proxy
See PHP Proxy
|sfw.config||settings object||Filter||Change the main config before the plugin is initiated|
|sfw.register.plugins||sfw instance, jQuery instance||Action||Used to create Plugins|
|sfw.ready||sfw instance, jQuery instance||Action||Runs when everything is ready|