more commerce settings

This commit is contained in:
2019-10-07 20:26:23 +02:00
parent 0437964793
commit 10c2bb8d13
9 changed files with 184 additions and 13 deletions

View File

@@ -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

File diff suppressed because one or more lines are too long

View File

@@ -46,8 +46,13 @@ import 'theme/assets/styles/main.scss'
}
function checkNoVuePages(){
return drupalDecoupled.sys_path != '/cart'
&& drupalDecoupled.sys_path.indexOf('checkout') != 1;
// return drupalDecoupled.sys_path != '/cart'
// && drupalDecoupled.sys_path.indexOf('checkout') != 1;
if( drupalDecoupled.route_name.indexOf('commerce') == -1 ){
return true;
}else{
return false;
}
}
function initVues(){