routing

Allows to add custom frontend or backend routing rules.

Shop-Script

Input (passed by reference)

$route array Current route parameters.
… your plugin code …

Output

$output
Custom routing rules in the form of an associative array similar to the way default rules are specified in Shop-Script config file routing.php. To ensure that custom routing rules are used only in the frontend or only in the backend, use the value returned by the wa()->getEnv() method when returning a result by an event handler.
Shop-Script

Plugin code example

PHP

public function customRouting(&$route)
{
    if (wa()->getEnv() == 'frontend') {    
        return [
            'myplugin/*' => 'frontend/',
        ];
    }
}