more commerce settings
This commit is contained in:
@@ -30,6 +30,9 @@ function materio_decoupled_help($route_name, RouteMatchInterface $route_match) {
|
||||
*/
|
||||
function materio_decoupled_page_attachments(array &$attachments) {
|
||||
$current_path = \Drupal::service('path.current')->getPath();
|
||||
$route_name = \Drupal::routeMatch()->getRouteName();
|
||||
// $route_parameters = \Drupal::routeMatch()->getParameters()->all();
|
||||
// ksm($route_parameters);
|
||||
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
$is_front = \Drupal::service('path.matcher')->isFrontPage();
|
||||
|
||||
@@ -48,8 +51,10 @@ function materio_decoupled_page_attachments(array &$attachments) {
|
||||
}
|
||||
}
|
||||
|
||||
// route_parameters:'".json_encode($route_parameters)."',\n
|
||||
$js_str = "var drupalDecoupled = {\n
|
||||
sys_path:'".$current_path."',\n
|
||||
route_name:'".$route_name."',\n
|
||||
is_front:".($is_front ? 'true':'false').",\n
|
||||
lang_code:'".$current_language."',\n
|
||||
entity_type:'".$entity_type."',\n
|
||||
|
Reference in New Issue
Block a user