more commerce settings

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

View File

@ -0,0 +1,97 @@
uuid: 5b24d66f-aa58-4c95-bd8e-7989d7f70286
langcode: en
status: true
dependencies:
config:
- commerce_order.commerce_order_type.materio_order_type
- core.entity_view_mode.commerce_order.checkout
- field.field.commerce_order.materio_order_type.order_items
module:
- commerce_order
- entity_reference_revisions
- state_machine
- user
id: commerce_order.materio_order_type.checkout
targetEntityType: commerce_order
bundle: materio_order_type
mode: checkout
content:
billing_profile:
type: entity_reference_revisions_entity_view
weight: 8
region: content
label: above
settings:
view_mode: default
link: ''
third_party_settings: { }
completed:
label: above
type: timestamp
weight: 3
region: content
settings:
date_format: medium
custom_date_format: ''
timezone: ''
third_party_settings: { }
order_items:
type: commerce_order_item_table
weight: 4
label: above
settings: { }
third_party_settings: { }
region: content
order_number:
type: string
weight: 6
region: content
label: above
settings:
link_to_entity: false
third_party_settings: { }
placed:
label: above
type: timestamp
weight: 2
region: content
settings:
date_format: medium
custom_date_format: ''
timezone: ''
third_party_settings: { }
state:
label: hidden
type: state_transition_form
weight: 5
region: content
settings: { }
third_party_settings: { }
store_id:
type: entity_reference_label
weight: 7
region: content
label: above
settings:
link: true
third_party_settings: { }
total_price:
label: hidden
type: commerce_order_total_summary
weight: 1
region: content
settings: { }
third_party_settings: { }
uid:
label: above
type: author
weight: 0
region: content
settings: { }
third_party_settings: { }
hidden:
changed: true
ip_address: true
mail: true
search_api_excerpt: true
total_paid: true

View File

@ -16,5 +16,6 @@ hidden:
license: true
purchased_entity: true
quantity: true
search_api_excerpt: true
total_price: true
unit_price: true

View File

@ -18,13 +18,14 @@ content:
region: content
label: hidden
settings:
view_mode: default
view_mode: summary
link: false
third_party_settings: { }
hidden:
body: true
created: true
langcode: true
search_api_excerpt: true
stores: true
title: true
uid: true

View File

@ -23,32 +23,32 @@ bundle: materio_product_variation_type
mode: default
content:
commerce_variation_cart_form:
weight: 3
weight: 4
region: content
settings: { }
third_party_settings: { }
field_description:
weight: 2
weight: 1
label: hidden
settings: { }
third_party_settings: { }
type: text_default
region: content
field_multiple:
weight: 4
label: above
type: boolean
weight: 3
region: content
label: hidden
settings:
format: default
format_custom_false: ''
format_custom_true: ''
format_custom_false: ''
third_party_settings: { }
type: boolean
region: content
price:
label: hidden
type: commerce_price_default
weight: 1
weight: 2
region: content
label: hidden
settings:
strip_trailing_zeroes: false
currency_display: symbol

View File

@ -0,0 +1,52 @@
uuid: 33250a3b-359f-4e8d-aff3-1a8685062aae
langcode: en
status: true
dependencies:
config:
- commerce_product.commerce_product_variation_type.materio_product_variation_type
- core.entity_view_mode.commerce_product_variation.summary
- field.field.commerce_product_variation.materio_product_variation_type.billing_schedule
- field.field.commerce_product_variation.materio_product_variation_type.field_description
- field.field.commerce_product_variation.materio_product_variation_type.field_multiple
- field.field.commerce_product_variation.materio_product_variation_type.license_expiration
- field.field.commerce_product_variation.materio_product_variation_type.license_type
- field.field.commerce_product_variation.materio_product_variation_type.subscription_type
module:
- commerce_variation_cart_form
- text
third_party_settings:
commerce_variation_cart_form:
combine: '1'
id: commerce_product_variation.materio_product_variation_type.summary
targetEntityType: commerce_product_variation
bundle: materio_product_variation_type
mode: summary
content:
field_description:
weight: 1
label: hidden
settings: { }
third_party_settings: { }
type: text_default
region: content
title:
type: string
weight: 0
region: content
label: hidden
settings:
link_to_entity: true
third_party_settings: { }
hidden:
billing_schedule: true
commerce_variation_cart_form: true
field_multiple: true
langcode: true
license_expiration: true
license_type: true
list_price: true
price: true
product_id: true
search_api_excerpt: true
sku: true
subscription_type: true

View File

@ -0,0 +1,10 @@
uuid: c02324e2-a135-477a-8be1-a8e491b2fa9e
langcode: en
status: true
dependencies:
module:
- commerce_order
id: commerce_order.checkout
label: checkout
targetEntityType: commerce_order
cache: true

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(){