diff --git a/composer.json b/composer.json index 16a435d..03547dd 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,8 @@ "minimum-stability": "dev", "require": { "drupal/core": "^10.3 || ^11", - "drupal/commerce": "^2.40 || ^3.0" + "drupal/commerce": "^2.40 || ^3.0", + "drupal/commerce_shipping": "^2.11", + "drupal/commerce_stripe": "^1.2" } } diff --git a/eleos_charity_checkout_flow/config/commerce_checkout.commerce_checkout_flow.default.yml b/eleos_charity_checkout_flow/config/commerce_checkout.commerce_checkout_flow.default.yml new file mode 100644 index 0000000..93f4328 --- /dev/null +++ b/eleos_charity_checkout_flow/config/commerce_checkout.commerce_checkout_flow.default.yml @@ -0,0 +1,66 @@ +langcode: en +status: true +dependencies: + module: + - commerce_payment + - commerce_shipping + - commerce_stripe +_core: + default_config_hash: 1BxQSpt9FMh77dg9LMMrriQ4JRWHwnBKzywwOwSpQ04 +label: Default +id: default +plugin: multistep_default +configuration: + display_checkout_progress: true + display_checkout_progress_breadcrumb_links: true + guest_order_assign: true + guest_new_account: true + guest_new_account_notify: false + panes: + contact_information: + step: order_information + weight: 0 + double_entry: false + shipping_information: + step: order_information + weight: 1 + auto_recalculate: true + require_shipping_profile: true + payment_information: + step: order_information + weight: 2 + stripe_review: + step: review + weight: 3 + button_id: edit-actions-next + auto_submit_review_form: false + setup_future_usage: '' + review: + step: review + weight: 4 + payment_process: + step: payment + weight: 5 + capture: true + completion_message: + step: complete + weight: 6 + message: + value: "Your order number is [commerce_order:order_number].\r\nYou can view your order on your account page when logged in." + format: plain_text + order_summary: + step: _sidebar + weight: 7 + view: null + customer_comments: + step: _disabled + weight: 8 + completion_register: + step: _disabled + weight: 9 + login: + step: _disabled + weight: 10 + allow_guest_checkout: true + allow_registration: false + registration_form_mode: register diff --git a/eleos_charity_checkout_flow/config/commerce_order.commerce_order_type.default.yml b/eleos_charity_checkout_flow/config/commerce_order.commerce_order_type.default.yml new file mode 100644 index 0000000..f99e846 --- /dev/null +++ b/eleos_charity_checkout_flow/config/commerce_order.commerce_order_type.default.yml @@ -0,0 +1,30 @@ +langcode: en +status: true +dependencies: + module: + - commerce_cart + - commerce_checkout + - commerce_shipping +third_party_settings: + commerce_cart: + cart_block_view: commerce_cart_block + cart_form_view: commerce_cart_form + cart_expiration: { } + enable_cart_message: false + commerce_checkout: + checkout_flow: default + commerce_shipping: + shipment_type: default +_core: + default_config_hash: kYapI397yx2zFJGyDEs85Hyqgfc9jhmzxqPZMl2Fqhk +id: default +label: Default +traits: { } +locked: false +workflow: order_default +numberPattern: order_default +refresh_mode: customer +refresh_frequency: 300 +sendReceipt: true +receiptBcc: '' +receiptSubject: '' diff --git a/eleos_charity_checkout_flow/config/commerce_payment.commerce_payment_gateway.stripe_payment_element.yml b/eleos_charity_checkout_flow/config/commerce_payment.commerce_payment_gateway.stripe_payment_element.yml new file mode 100644 index 0000000..c09085e --- /dev/null +++ b/eleos_charity_checkout_flow/config/commerce_payment.commerce_payment_gateway.stripe_payment_element.yml @@ -0,0 +1,46 @@ +langcode: en +status: true +dependencies: + module: + - commerce_stripe +id: stripe_payment_element +label: 'Stripe Payment Element' +weight: null +plugin: stripe_payment_element +configuration: + display_label: 'Stripe Payment Element' + mode: test + payment_method_types: + - stripe_card + collect_billing_information: true + publishable_key: placeholder + secret_key: placeholder + webhook_signing_secret: placeholder + payment_method_usage: on_session + capture_method: automatic + style: + theme: stripe + layout: accordion + checkout_form_display_label: + custom_label: '' + show_payment_method_logos: 'no' + include_logos: + amex: amex + discover: discover + mastercard: mastercard + visa: visa + affirm: '0' + alipay: '0' + amazon_pay: '0' + dinersclub: '0' + jcb: '0' + maestro: '0' + unionpay: '0' + applepay: '0' + googlepay: '0' + cashapp: '0' + klarna: '0' + us_bank_account: '0' + wechat_pay: '0' +conditions: { } +conditionOperator: AND diff --git a/eleos_charity_checkout_flow/config/commerce_product.commerce_product_variation_type.basic.yml b/eleos_charity_checkout_flow/config/commerce_product.commerce_product_variation_type.basic.yml new file mode 100644 index 0000000..8745f34 --- /dev/null +++ b/eleos_charity_checkout_flow/config/commerce_product.commerce_product_variation_type.basic.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: { } +id: basic +label: 'Basic Product' +traits: + - purchasable_entity_shippable +locked: false +orderItemType: default +generateTitle: false diff --git a/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_order.default.default.yml b/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_order.default.default.yml new file mode 100644 index 0000000..2b9eb03 --- /dev/null +++ b/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_order.default.default.yml @@ -0,0 +1,59 @@ +langcode: en +status: true +dependencies: + config: + - commerce_order.commerce_order_type.default + - field.field.commerce_order.default.shipments + module: + - commerce_order + - inline_entity_form +_core: + default_config_hash: OxAaChovIat28naja81fSKWGZHYQHv6xrrmhnK-bXUI +id: commerce_order.default.default +targetEntityType: commerce_order +bundle: default +mode: default +content: + adjustments: + type: commerce_adjustment_default + weight: 2 + region: content + settings: { } + third_party_settings: { } + billing_profile: + type: commerce_billing_profile + weight: 0 + region: content + settings: { } + third_party_settings: { } + cart: + type: boolean_checkbox + weight: 20 + region: content + settings: + display_label: true + third_party_settings: { } + order_items: + type: inline_entity_form_complex + weight: 1 + region: content + settings: + form_mode: default + override_labels: true + label_singular: 'order item' + label_plural: 'order items' + allow_new: true + allow_existing: false + match_operator: CONTAINS + removed_reference: delete + third_party_settings: { } +hidden: + created: true + customer_comments: true + ip_address: true + mail: true + order_number: true + shipments: true + state: true + store_id: true + uid: true diff --git a/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_product_variation.basic.default.yml b/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_product_variation.basic.default.yml new file mode 100644 index 0000000..5564cf3 --- /dev/null +++ b/eleos_charity_checkout_flow/config/core.entity_form_display.commerce_product_variation.basic.default.yml @@ -0,0 +1,87 @@ +langcode: en +status: true +dependencies: + config: + - commerce_product.commerce_product_variation_type.basic + - field.field.commerce_product_variation.basic.field_bpv_weight + - field.field.commerce_product_variation.basic.field_stock + - field.field.commerce_product_variation.basic.weight + module: + - commerce_price + - commerce_stock_field + - physical +id: commerce_product_variation.basic.default +targetEntityType: commerce_product_variation +bundle: basic +mode: default +content: + commerce_stock_always_in_stock: + type: boolean_checkbox + weight: 4 + region: content + settings: + display_label: true + third_party_settings: { } + field_bpv_weight: + type: number + weight: 2 + region: content + settings: + placeholder: '' + third_party_settings: { } + field_stock: + type: commerce_stock_level_simple_transaction + weight: 5 + region: content + settings: + step: '1' + custom_transaction_note: false + default_transaction_note: 'Transaction issued by stock level field.' + third_party_settings: { } + list_price: + type: commerce_list_price + weight: 2 + region: content + settings: { } + third_party_settings: { } + price: + type: commerce_price_default + weight: 3 + region: content + settings: { } + third_party_settings: { } + sku: + type: string_textfield + weight: 1 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + status: + type: boolean_checkbox + weight: 6 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + weight: + type: physical_measurement_default + weight: 91 + region: content + settings: + default_unit: '' + allow_unit_change: true + available_units: { } + third_party_settings: { } +hidden: + created: true + uid: true diff --git a/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.default.yml b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.default.yml new file mode 100644 index 0000000..2ff4f8e --- /dev/null +++ b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.default.yml @@ -0,0 +1,150 @@ +langcode: en +status: true +dependencies: + config: + - commerce_order.commerce_order_type.default + - field.field.commerce_order.default.shipments + module: + - commerce_order + - commerce_price + - state_machine + - user +_core: + default_config_hash: w_RqUP8MNGcriL4erePe8rSRx3V5yDtEZDgc14AgzW0 +id: commerce_order.default.default +targetEntityType: commerce_order +bundle: default +mode: default +content: + balance: + type: commerce_price_default + label: inline + settings: + strip_trailing_zeroes: false + currency_display: symbol + third_party_settings: { } + weight: 9 + region: content + changed: + type: timestamp + label: inline + settings: + date_format: short + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 4 + region: content + completed: + type: timestamp + label: inline + settings: + date_format: short + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 2 + region: content + customer_comments: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 10 + region: content + ip_address: + type: string + label: inline + settings: + link_to_entity: false + third_party_settings: { } + weight: 7 + region: content + mail: + type: basic_string + label: inline + settings: { } + third_party_settings: { } + weight: 6 + region: content + order_items: + type: commerce_order_item_table + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content + placed: + type: timestamp + label: inline + settings: + date_format: short + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 3 + region: content + state: + type: state_transition_form + label: hidden + settings: + require_confirmation: true + use_modal: true + third_party_settings: { } + weight: 8 + region: content + store_id: + type: entity_reference_label + label: inline + settings: + link: true + third_party_settings: { } + weight: 5 + region: content + total_price: + type: commerce_order_total_summary + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + region: content + uid: + type: author + label: inline + settings: { } + third_party_settings: { } + weight: 5 + region: content +hidden: + billing_profile: true + order_number: true + shipments: true + total_paid: true diff --git a/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.user.yml b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.user.yml new file mode 100644 index 0000000..3f07d12 --- /dev/null +++ b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_order.default.user.yml @@ -0,0 +1,126 @@ +langcode: en +status: true +dependencies: + config: + - commerce_order.commerce_order_type.default + - core.entity_view_mode.commerce_order.user + - field.field.commerce_order.default.shipments + module: + - commerce_order + - commerce_price + - entity_reference_revisions + - options +_core: + default_config_hash: XRgGhXKcDeqhvgwHROyCDmRx7wfApZmGqxYl_9fE7SU +id: commerce_order.default.user +targetEntityType: commerce_order +bundle: default +mode: user +content: + balance: + type: commerce_price_default + label: hidden + settings: + strip_trailing_zeroes: false + currency_display: symbol + third_party_settings: { } + weight: 0 + region: content + billing_profile: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 0 + region: content + completed: + type: timestamp + label: inline + settings: + date_format: short + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 2 + region: content + customer_comments: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 7 + region: content + mail: + type: basic_string + label: inline + settings: { } + third_party_settings: { } + weight: 1 + region: content + order_items: + type: commerce_order_item_table + label: hidden + settings: { } + third_party_settings: { } + weight: 5 + region: content + order_number: + type: string + label: inline + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content + placed: + type: timestamp + label: inline + settings: + date_format: short + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 3 + region: content + state: + type: list_default + label: inline + settings: { } + third_party_settings: { } + weight: 4 + region: content + total_price: + type: commerce_order_total_summary + label: hidden + settings: { } + third_party_settings: { } + weight: 6 + region: content +hidden: + changed: true + ip_address: true + shipments: true + store_id: true + total_paid: true + uid: true diff --git a/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_product_variation.basic.teaser.yml b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_product_variation.basic.teaser.yml new file mode 100644 index 0000000..3b3f79f --- /dev/null +++ b/eleos_charity_checkout_flow/config/core.entity_view_display.commerce_product_variation.basic.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - commerce_product.commerce_product_variation_type.basic + - core.entity_view_mode.commerce_product_variation.teaser + - field.field.commerce_product_variation.basic.field_bpv_weight + - field.field.commerce_product_variation.basic.field_stock + - field.field.commerce_product_variation.basic.weight + module: + - commerce_variation_cart_form +third_party_settings: + commerce_variation_cart_form: + combine: false +id: commerce_product_variation.basic.teaser +targetEntityType: commerce_product_variation +bundle: basic +mode: teaser +content: + commerce_variation_cart_form: + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + field_bpv_weight: true + field_stock: true + list_price: true + price: true + product_id: true + sku: true + title: true + weight: true diff --git a/eleos_charity_checkout_flow/content/commerce_shipping_method/d11ec7da-32b6-4c84-a412-d024fa09de81.yml b/eleos_charity_checkout_flow/content/commerce_shipping_method/d11ec7da-32b6-4c84-a412-d024fa09de81.yml new file mode 100644 index 0000000..6b5863b --- /dev/null +++ b/eleos_charity_checkout_flow/content/commerce_shipping_method/d11ec7da-32b6-4c84-a412-d024fa09de81.yml @@ -0,0 +1,34 @@ +_meta: + version: '1.0' + entity_type: commerce_shipping_method + uuid: d11ec7da-32b6-4c84-a412-d024fa09de81 + default_langcode: en +default: + plugin: + - + target_plugin_id: flat_rate + target_plugin_configuration: + rate_label: Standard + rate_description: '' + rate_amount: + number: '4.99' + currency_code: GBP + services: + - default + default_package_type: custom_box + workflow: shipment_default + name: + - + value: Standard + condition_operator: + - + value: AND + weight: + - + value: 0 + status: + - + value: true + created: + - + value: 1738251635 diff --git a/eleos_charity_checkout_flow/content/commerce_shipping_method/d8a219ce-faeb-4b74-805b-8f79efc07a4e.yml b/eleos_charity_checkout_flow/content/commerce_shipping_method/d8a219ce-faeb-4b74-805b-8f79efc07a4e.yml new file mode 100644 index 0000000..1df7aaf --- /dev/null +++ b/eleos_charity_checkout_flow/content/commerce_shipping_method/d8a219ce-faeb-4b74-805b-8f79efc07a4e.yml @@ -0,0 +1,34 @@ +_meta: + version: '1.0' + entity_type: commerce_shipping_method + uuid: d8a219ce-faeb-4b74-805b-8f79efc07a4e + default_langcode: en +default: + plugin: + - + target_plugin_id: flat_rate + target_plugin_configuration: + rate_label: 'First Class' + rate_description: '' + rate_amount: + number: '6.49' + currency_code: GBP + services: + - default + default_package_type: custom_box + workflow: shipment_default + name: + - + value: 'First Class' + condition_operator: + - + value: AND + weight: + - + value: 0 + status: + - + value: true + created: + - + value: 1738251616 diff --git a/eleos_charity_checkout_flow/recipe.yml b/eleos_charity_checkout_flow/recipe.yml new file mode 100644 index 0000000..92d791e --- /dev/null +++ b/eleos_charity_checkout_flow/recipe.yml @@ -0,0 +1,28 @@ +name: 'Eleos Charity - Checkout Flow' +description: 'A customised checkout flow' +type: 'Commerce' +install: + - commerce + - commerce_log + - commerce_number_pattern + - commerce_order + - commerce_store + - commerce_price + - commerce_cart + - commerce_product + - commerce_shipping + - commerce_stripe + - commerce_checkout +config: + import: + commerce: '*' + commerce_log: '*' + commerce_number_pattern: '*' + commerce_order: '*' + commerce_store: '*' + commerce_price: '*' + commerce_cart: '*' + commerce_product: '*' + commerce_shipping: '*' + commerce_stripe: '*' + commerce_checkout: '*' diff --git a/recipe.yml b/recipe.yml index 77a9056..63b729a 100644 --- a/recipe.yml +++ b/recipe.yml @@ -5,3 +5,4 @@ recipes: - recipes/contrib/eleos_charity/eleos_charity_commerce_base - recipes/contrib/eleos_charity/eleos_charity_shop_category - recipes/contrib/eleos_charity/eleos_charity_basic_product + - recipes/contrib/eleos_charity/eleos_charity_checkout_flow