spree_core 6.0.0.beta4 → 6.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/helpers/spree/images_helper.rb +0 -57
- data/app/jobs/spree/base_job.rb +21 -0
- data/app/jobs/spree/carts/reap_expired_job.rb +2 -2
- data/app/jobs/spree/collections/regenerate_time_based_job.rb +6 -3
- data/app/jobs/spree/orders/finalize_stale_drafts_job.rb +8 -5
- data/app/jobs/spree/payments/cancel_unused_sessions_job.rb +61 -0
- data/app/jobs/spree/seller_payouts/sweep_seller_job.rb +2 -0
- data/app/mailers/spree/admin_user_mailer.rb +4 -19
- data/app/mailers/spree/base_mailer.rb +96 -13
- data/app/mailers/spree/email_template_mailer.rb +27 -0
- data/app/mailers/spree/export_mailer.rb +3 -4
- data/app/mailers/spree/import_mailer.rb +3 -4
- data/app/mailers/spree/invitation_mailer.rb +24 -7
- data/app/mailers/spree/seller_user_mailer.rb +4 -16
- data/app/mailers/spree/webhook_mailer.rb +2 -2
- data/app/models/concerns/spree/acted_by.rb +1 -1
- data/app/models/concerns/spree/admin_user_methods.rb +13 -1
- data/app/models/concerns/spree/api_typed.rb +91 -0
- data/app/models/concerns/spree/calculator/tiers.rb +76 -0
- data/app/models/concerns/spree/customer_methods.rb +15 -14
- data/app/models/concerns/spree/email_template_identity.rb +52 -0
- data/app/models/concerns/spree/parameterizable_name.rb +2 -0
- data/app/models/concerns/spree/payment_session_transitions.rb +8 -2
- data/app/models/concerns/spree/post_sale/taxation.rb +54 -0
- data/app/models/concerns/spree/post_sale/taxed_line.rb +51 -0
- data/app/models/concerns/spree/preference_schema.rb +4 -12
- data/app/models/concerns/spree/product_scopes.rb +11 -1
- data/app/models/concerns/spree/provider_listing.rb +41 -0
- data/app/models/concerns/spree/publishable.rb +82 -14
- data/app/models/concerns/spree/purchase/addresses.rb +23 -10
- data/app/models/concerns/spree/purchase/currency.rb +1 -1
- data/app/models/concerns/spree/purchase/deprecated_aliases.rb +87 -0
- data/app/models/concerns/spree/purchase/gift_cards.rb +10 -4
- data/app/models/concerns/spree/purchase/locale.rb +1 -1
- data/app/models/concerns/spree/purchase/payment_processing.rb +7 -3
- data/app/models/concerns/spree/purchase/purchase_order.rb +2 -2
- data/app/models/concerns/spree/purchase/totals.rb +49 -1
- data/app/models/concerns/spree/receivable.rb +1 -1
- data/app/models/concerns/spree/searchable.rb +0 -4
- data/app/models/concerns/spree/secret_preferences.rb +59 -0
- data/app/models/concerns/spree/single_store_resource.rb +1 -1
- data/app/models/concerns/spree/stores/email_branding.rb +31 -0
- data/app/models/concerns/spree/type_labels.rb +38 -0
- data/app/models/concerns/spree/typed_adjustment_line.rb +1 -1
- data/app/models/concerns/spree/typed_associations.rb +6 -0
- data/app/models/spree/address.rb +11 -1
- data/app/models/spree/adjusters/promotion.rb +1 -15
- data/app/models/spree/allowed_origin.rb +0 -1
- data/app/models/spree/api_key.rb +5 -6
- data/app/models/spree/authentication/strategies/oidc_strategy.rb +5 -5
- data/app/models/spree/base.rb +70 -22
- data/app/models/spree/calculator/flat_percent_item_total.rb +1 -3
- data/app/models/spree/calculator/flat_rate.rb +1 -3
- data/app/models/spree/calculator/flexi_rate.rb +1 -3
- data/app/models/spree/calculator/percent_on_line_item.rb +1 -1
- data/app/models/spree/calculator/price_sack.rb +1 -3
- data/app/models/spree/calculator/shipping/digital_delivery.rb +1 -3
- data/app/models/spree/calculator/shipping/flat_percent_item_total.rb +1 -3
- data/app/models/spree/calculator/shipping/flat_rate.rb +1 -3
- data/app/models/spree/calculator/shipping/flexi_rate.rb +1 -3
- data/app/models/spree/calculator/shipping/per_item.rb +1 -3
- data/app/models/spree/calculator/shipping/price_sack.rb +1 -3
- data/app/models/spree/calculator/tiered_flat_rate.rb +6 -23
- data/app/models/spree/calculator/tiered_percent.rb +7 -25
- data/app/models/spree/cart.rb +78 -18
- data/app/models/spree/channel/gating.rb +1 -1
- data/app/models/spree/channel.rb +4 -4
- data/app/models/spree/claim.rb +21 -1
- data/app/models/spree/claim_line_item.rb +41 -6
- data/app/models/spree/collection.rb +0 -1
- data/app/models/spree/collection_rule.rb +5 -21
- data/app/models/spree/commission_line.rb +1 -1
- data/app/models/spree/commission_rate.rb +2 -3
- data/app/models/spree/commission_rate_value.rb +1 -1
- data/app/models/spree/commission_rule.rb +4 -11
- data/app/models/spree/commission_rules/product_rule.rb +1 -1
- data/app/models/spree/company_invitation.rb +1 -0
- data/app/models/spree/consent_record.rb +0 -1
- data/app/models/spree/credit_card.rb +1 -1
- data/app/models/spree/current.rb +23 -0
- data/app/models/spree/custom_field.rb +2 -2
- data/app/models/spree/custom_field_definition.rb +9 -23
- data/app/models/spree/custom_fields/boolean.rb +1 -1
- data/app/models/spree/custom_fields/json.rb +1 -1
- data/app/models/spree/data_feed/google.rb +0 -2
- data/app/models/spree/data_request.rb +1 -1
- data/app/models/spree/delivery_method.rb +30 -13
- data/app/models/spree/delivery_method_rule.rb +4 -11
- data/app/models/spree/delivery_rate.rb +4 -5
- data/app/models/spree/delivery_rate_provider/base.rb +1 -0
- data/app/models/spree/delivery_zone.rb +0 -1
- data/app/models/spree/delivery_zone_member.rb +4 -4
- data/app/models/spree/digital_asset.rb +7 -0
- data/app/models/spree/digital_asset_provider/base.rb +2 -0
- data/app/models/spree/digital_link.rb +2 -5
- data/app/models/spree/discount.rb +1 -1
- data/app/models/spree/email_template.rb +25 -0
- data/app/models/spree/email_template_draft.rb +13 -0
- data/app/models/spree/email_template_revision.rb +17 -0
- data/app/models/spree/email_templates/entry.rb +118 -0
- data/app/models/spree/email_templates/sample_record.rb +16 -0
- data/app/models/spree/emails/branding.rb +80 -0
- data/app/models/spree/exchange.rb +15 -1
- data/app/models/spree/exchange_line_item.rb +121 -5
- data/app/models/spree/export.rb +0 -1
- data/app/models/spree/exports/products.rb +10 -1
- data/app/models/spree/exports/report.rb +1 -1
- data/app/models/spree/fee.rb +4 -2
- data/app/models/spree/fulfillment.rb +53 -27
- data/app/models/spree/fulfillment_changer.rb +2 -2
- data/app/models/spree/fulfillment_item.rb +0 -4
- data/app/models/spree/fulfillment_provider/base.rb +1 -0
- data/app/models/spree/gateway/bogus.rb +4 -0
- data/app/models/spree/gateway/custom_payment_source_method.rb +5 -0
- data/app/models/spree/gateway.rb +5 -1
- data/app/models/spree/gift_card.rb +12 -1
- data/app/models/spree/gift_card_batch.rb +0 -1
- data/app/models/spree/import.rb +2 -7
- data/app/models/spree/import_mapping.rb +1 -2
- data/app/models/spree/import_row.rb +2 -2
- data/app/models/spree/import_schemas/products.rb +1 -0
- data/app/models/spree/integration.rb +8 -18
- data/app/models/spree/invitation.rb +5 -5
- data/app/models/spree/line_item.rb +13 -2
- data/app/models/spree/locale.rb +11 -8
- data/app/models/spree/market.rb +1 -0
- data/app/models/spree/newsletter_subscriber.rb +3 -0
- data/app/models/spree/order.rb +56 -138
- data/app/models/spree/order_group.rb +11 -2
- data/app/models/spree/order_inventory.rb +10 -5
- data/app/models/spree/order_promotion.rb +1 -1
- data/app/models/spree/order_routing/has_strategy_preference.rb +1 -1
- data/app/models/spree/order_routing/strategy/base.rb +4 -2
- data/app/models/spree/order_routing/strategy/rules.rb +1 -1
- data/app/models/spree/order_routing_rule.rb +6 -22
- data/app/models/spree/package_type.rb +1 -2
- data/app/models/spree/payment/gateway_options.rb +14 -52
- data/app/models/spree/payment/processing.rb +2 -4
- data/app/models/spree/payment.rb +20 -5
- data/app/models/spree/payment_method/session_instrumentation.rb +1 -0
- data/app/models/spree/payment_method/store_credit.rb +4 -4
- data/app/models/spree/payment_method.rb +36 -4
- data/app/models/spree/payment_session.rb +5 -1
- data/app/models/spree/payment_setup_session.rb +1 -0
- data/app/models/spree/payout_provider/base.rb +3 -1
- data/app/models/spree/pickup_point_provider/base.rb +2 -0
- data/app/models/spree/price_list.rb +1 -2
- data/app/models/spree/price_rules/channel_rule.rb +1 -1
- data/app/models/spree/price_rules/customer_group_rule.rb +1 -1
- data/app/models/spree/product.rb +31 -7
- data/app/models/spree/product_submission.rb +0 -12
- data/app/models/spree/product_type.rb +0 -1
- data/app/models/spree/promotion/actions/create_line_items.rb +27 -17
- data/app/models/spree/promotion/rules/category.rb +0 -4
- data/app/models/spree/promotion/rules/channel.rb +0 -4
- data/app/models/spree/promotion/rules/country.rb +0 -4
- data/app/models/spree/promotion/rules/currency.rb +0 -4
- data/app/models/spree/promotion/rules/customer_group.rb +0 -4
- data/app/models/spree/promotion/rules/first_order.rb +0 -4
- data/app/models/spree/promotion/rules/item_total.rb +4 -8
- data/app/models/spree/promotion/rules/market.rb +0 -4
- data/app/models/spree/promotion/rules/one_use_per_user.rb +0 -4
- data/app/models/spree/promotion/rules/option_value.rb +0 -3
- data/app/models/spree/promotion/rules/product.rb +0 -4
- data/app/models/spree/promotion/rules/user.rb +0 -4
- data/app/models/spree/promotion/rules/user_logged_in.rb +0 -4
- data/app/models/spree/promotion.rb +35 -6
- data/app/models/spree/promotion_action.rb +7 -14
- data/app/models/spree/promotion_action_line_item.rb +1 -1
- data/app/models/spree/promotion_handler/coupon.rb +59 -27
- data/app/models/spree/promotion_rule.rb +7 -14
- data/app/models/spree/purchase_order.rb +1 -0
- data/app/models/spree/quantity_rule.rb +1 -1
- data/app/models/spree/refund.rb +28 -3
- data/app/models/spree/return.rb +30 -2
- data/app/models/spree/return_line_item.rb +65 -14
- data/app/models/spree/role.rb +7 -7
- data/app/models/spree/saved_report.rb +1 -1
- data/app/models/spree/seller.rb +2 -1
- data/app/models/spree/seller_payout.rb +7 -0
- data/app/models/spree/seller_requirement.rb +4 -12
- data/app/models/spree/seller_requirement_custom_field.rb +1 -2
- data/app/models/spree/seller_requirement_submission.rb +2 -2
- data/app/models/spree/seller_requirements/accept_terms.rb +2 -3
- data/app/models/spree/seller_transfer.rb +5 -0
- data/app/models/spree/shipping_label.rb +1 -0
- data/app/models/spree/stock/availability_validator.rb +2 -2
- data/app/models/spree/stock/inventory_unit_builder.rb +1 -1
- data/app/models/spree/stock/packer.rb +2 -2
- data/app/models/spree/stock/splitter/weight.rb +1 -1
- data/app/models/spree/stock_level/custom_events.rb +6 -0
- data/app/models/spree/stock_level.rb +1 -1
- data/app/models/spree/stock_movement.rb +1 -1
- data/app/models/spree/stock_receipt_item.rb +1 -1
- data/app/models/spree/stock_reservation.rb +2 -2
- data/app/models/spree/stock_transfer.rb +4 -2
- data/app/models/spree/store.rb +33 -7
- data/app/models/spree/store_credit.rb +8 -9
- data/app/models/spree/store_credit_event.rb +5 -5
- data/app/models/spree/tax_exemption_certificate.rb +2 -0
- data/app/models/spree/tax_identifier.rb +3 -1
- data/app/models/spree/tax_line.rb +53 -3
- data/app/models/spree/tax_provider/base.rb +71 -14
- data/app/models/spree/tax_provider/internal.rb +59 -33
- data/app/models/spree/tax_provider/recorded_share.rb +114 -0
- data/app/models/spree/tax_rate.rb +1 -2
- data/app/models/spree/taxonomy.rb +0 -1
- data/app/models/spree/variant.rb +4 -3
- data/app/models/spree/variant_media.rb +1 -1
- data/app/models/spree/webhook_endpoint.rb +10 -13
- data/app/models/spree/wishlist.rb +1 -6
- data/app/models/spree/wishlist_item/custom_events.rb +6 -0
- data/app/presenters/spree/csv/customer_presenter.rb +1 -1
- data/app/presenters/spree/csv/newsletter_subscriber_presenter.rb +1 -1
- data/app/presenters/spree/csv/order_line_item_presenter.rb +1 -1
- data/app/presenters/spree/csv/product_variant_presenter.rb +42 -12
- data/app/serializers/spree/emails/base_serializer.rb +14 -0
- data/app/serializers/spree/emails/export_serializer.rb +13 -0
- data/app/serializers/spree/emails/import_serializer.rb +19 -0
- data/app/serializers/spree/emails/invitation_serializer.rb +28 -0
- data/app/serializers/spree/emails/store_serializer.rb +31 -0
- data/app/serializers/spree/emails/user_serializer.rb +12 -0
- data/app/serializers/spree/emails/webhook_endpoint_serializer.rb +16 -0
- data/app/services/spree/carts/create.rb +8 -2
- data/app/services/spree/carts/destroy.rb +2 -2
- data/app/services/spree/carts/remove_out_of_stock_items.rb +2 -2
- data/app/services/spree/carts/split_by_seller.rb +1 -1
- data/app/services/spree/carts/update.rb +19 -5
- data/app/services/spree/catalogs/set_product_terms.rb +1 -1
- data/app/services/spree/categories/add_products.rb +13 -31
- data/app/services/spree/categories/remove_products.rb +12 -51
- data/app/services/spree/checkout/advance.rb +1 -4
- data/app/services/spree/collections/add_products.rb +10 -23
- data/app/services/spree/collections/remove_products.rb +7 -43
- data/app/services/spree/coupon_codes/bulk_generate.rb +8 -14
- data/app/services/spree/data_requests/create.rb +1 -1
- data/app/services/spree/deliveries/destroy.rb +2 -2
- data/app/services/spree/email_templates/check.rb +58 -0
- data/app/services/spree/email_templates/no_sample_record.rb +7 -0
- data/app/services/spree/email_templates/preview.rb +99 -0
- data/app/services/spree/emails/file_system.rb +23 -0
- data/app/services/spree/emails/filters.rb +84 -0
- data/app/services/spree/emails/liquid_context.rb +48 -0
- data/app/services/spree/emails/rendered_email.rb +14 -0
- data/app/services/spree/emails/renderer.rb +125 -0
- data/app/services/spree/emails/template.rb +51 -0
- data/app/services/spree/emails/template_data.rb +23 -0
- data/app/services/spree/emails/template_resolver.rb +109 -0
- data/app/services/spree/emails/text_converter.rb +72 -0
- data/app/services/spree/emails/translation_inliner.rb +134 -0
- data/app/services/spree/imports/row_processors/price_list_price.rb +10 -10
- data/app/services/spree/imports/row_processors/product_variant.rb +65 -34
- data/app/services/spree/imports/row_processors/purchase_order.rb +13 -13
- data/app/services/spree/locales.rb +4 -5
- data/app/services/spree/newsletter/subscribe.rb +8 -12
- data/app/services/spree/orders/build_fulfillments.rb +3 -2
- data/app/services/spree/orders/create.rb +2 -1
- data/app/services/spree/orders/discounts/create.rb +7 -4
- data/app/services/spree/orders/discounts/destroy.rb +1 -0
- data/app/services/spree/orders/discounts/update.rb +1 -0
- data/app/services/spree/orders/fees/create.rb +1 -0
- data/app/services/spree/orders/fees/destroy.rb +1 -0
- data/app/services/spree/orders/fees/update.rb +1 -0
- data/app/services/spree/orders/remove_line_item.rb +13 -3
- data/app/services/spree/orders/update.rb +10 -6
- data/app/services/spree/orders/update_item.rb +6 -3
- data/app/services/spree/orders/update_statuses.rb +3 -1
- data/app/services/spree/product_memberships.rb +61 -0
- data/app/services/spree/returns/eligibility_validator.rb +1 -1
- data/app/services/spree/search_provider/custom_field_schema.rb +2 -2
- data/app/services/spree/seeds/commission_rates.rb +1 -1
- data/app/services/spree/seeds/digital_delivery.rb +1 -1
- data/app/services/spree/seeds/payment_methods.rb +2 -2
- data/app/services/spree/seeds/saved_reports.rb +3 -3
- data/app/services/spree/sellers/requirements.rb +1 -2
- data/app/services/spree/shipping_labels/confirm_refund.rb +1 -1
- data/app/services/spree/shipping_labels/store_file.rb +3 -3
- data/app/services/spree/stock_levels/correct.rb +3 -3
- data/app/services/spree/stock_reservations/reserve.rb +2 -3
- data/app/services/spree/store_credits/apply.rb +15 -13
- data/app/services/spree/stores/provision_defaults.rb +15 -14
- data/app/subscribers/spree/seller_onboarding_subscriber.rb +1 -1
- data/app/views/layouts/spree/base_mailer.html.erb +2 -43
- data/app/views/layouts/spree/base_mailer.liquid +79 -0
- data/app/views/spree/admin_user_mailer/password_reset_email.liquid +14 -0
- data/app/views/spree/export_mailer/export_done.liquid +12 -0
- data/app/views/spree/import_mailer/import_done.liquid +15 -0
- data/app/views/spree/invitation_mailer/invitation_accepted.liquid +9 -0
- data/app/views/spree/invitation_mailer/invitation_email.liquid +13 -0
- data/app/views/spree/seller_user_mailer/password_reset_email.liquid +14 -0
- data/app/views/spree/shared/_mailer_button.html.erb +4 -5
- data/app/views/spree/shared/_mailer_hero.html.erb +6 -5
- data/app/views/spree/shared/_summary_row.liquid +8 -0
- data/app/views/spree/webhook_mailer/endpoint_disabled.liquid +21 -0
- data/app/workflows/spree/carts/add_item.rb +4 -4
- data/app/workflows/spree/carts/complete.rb +13 -3
- data/app/workflows/spree/carts/merge.rb +1 -1
- data/app/workflows/spree/carts/recalculate_totals.rb +5 -0
- data/app/workflows/spree/carts/upsert_items.rb +18 -9
- data/app/workflows/spree/claims/approve.rb +5 -22
- data/app/workflows/spree/claims/cancel.rb +5 -21
- data/app/workflows/spree/claims/create.rb +15 -0
- data/app/workflows/spree/claims/deny.rb +7 -0
- data/app/workflows/spree/claims/resolve.rb +34 -31
- data/app/workflows/spree/customers/anonymize.rb +3 -4
- data/app/workflows/spree/customers/create.rb +1 -1
- data/app/workflows/spree/data_requests/fulfill.rb +2 -2
- data/app/workflows/spree/deliveries/update_tracking.rb +1 -1
- data/app/workflows/spree/email_templates/discard_draft.rb +20 -0
- data/app/workflows/spree/email_templates/publish.rb +70 -0
- data/app/workflows/spree/email_templates/restore_revision.rb +33 -0
- data/app/workflows/spree/email_templates/revert.rb +29 -0
- data/app/workflows/spree/email_templates/save_draft.rb +85 -0
- data/app/workflows/spree/exchanges/approve.rb +5 -22
- data/app/workflows/spree/exchanges/cancel.rb +5 -21
- data/app/workflows/spree/exchanges/create.rb +6 -0
- data/app/workflows/spree/exchanges/fulfill.rb +75 -51
- data/app/workflows/spree/exchanges/receive.rb +6 -65
- data/app/workflows/spree/fulfillments/cancel.rb +1 -1
- data/app/workflows/spree/fulfillments/create.rb +51 -47
- data/app/workflows/spree/fulfillments/fulfill.rb +23 -27
- data/app/workflows/spree/fulfillments/mark_delivered.rb +1 -1
- data/app/workflows/spree/fulfillments/replacements.rb +59 -0
- data/app/workflows/spree/gift_cards/apply.rb +2 -2
- data/app/workflows/spree/orders/add_item.rb +5 -1
- data/app/workflows/spree/orders/cancel.rb +3 -3
- data/app/workflows/spree/orders/complete.rb +16 -8
- data/app/workflows/spree/payments/process.rb +2 -2
- data/app/workflows/spree/post_sale/approval.rb +35 -0
- data/app/workflows/spree/post_sale/cancellation.rb +44 -0
- data/app/workflows/spree/post_sale/receipt.rb +92 -0
- data/app/workflows/spree/products/nested_attributes.rb +1 -1
- data/app/workflows/spree/purchase_orders/cancel.rb +1 -1
- data/app/workflows/spree/purchase_orders/close.rb +3 -31
- data/app/workflows/spree/purchase_orders/mark_draft.rb +2 -2
- data/app/workflows/spree/purchase_orders/mark_ordered.rb +2 -2
- data/app/workflows/spree/purchase_orders/receive.rb +1 -1
- data/app/workflows/spree/purchase_orders/update.rb +5 -34
- data/app/workflows/spree/receivables/closing_short.rb +46 -0
- data/app/workflows/spree/receivables/draft_editing.rb +48 -0
- data/app/workflows/spree/refunds/create.rb +5 -2
- data/app/workflows/spree/refunds/order_payments.rb +14 -2
- data/app/workflows/spree/refunds/tax_credit.rb +67 -0
- data/app/workflows/spree/returns/approve.rb +5 -22
- data/app/workflows/spree/returns/cancel.rb +5 -22
- data/app/workflows/spree/returns/create.rb +8 -0
- data/app/workflows/spree/returns/receive.rb +5 -76
- data/app/workflows/spree/returns/refund.rb +31 -8
- data/app/workflows/spree/seller_requirement_submissions/create.rb +1 -2
- data/app/workflows/spree/seller_transfers/reverse.rb +28 -1
- data/app/workflows/spree/shipping_labels/purchase.rb +8 -8
- data/app/workflows/spree/shipping_labels/record.rb +5 -5
- data/app/workflows/spree/shipping_labels/refund.rb +2 -2
- data/app/workflows/spree/stock_receipts/recording.rb +4 -4
- data/app/workflows/spree/stock_transfers/cancel.rb +2 -2
- data/app/workflows/spree/stock_transfers/close.rb +3 -30
- data/app/workflows/spree/stock_transfers/mark_draft.rb +1 -1
- data/app/workflows/spree/stock_transfers/mark_in_transit.rb +3 -3
- data/app/workflows/spree/stock_transfers/mark_ready.rb +2 -2
- data/app/workflows/spree/stock_transfers/receive.rb +1 -1
- data/app/workflows/spree/stock_transfers/update.rb +5 -33
- data/config/i18n-tasks.yml +32 -18
- data/config/initializers/alba.rb +7 -0
- data/config/language_names.csv +264 -0
- data/config/locales/ar.yml +811 -0
- data/config/locales/be.yml +855 -0
- data/config/locales/bg.yml +723 -0
- data/config/locales/ca.yml +689 -0
- data/config/locales/cs.yml +855 -0
- data/config/locales/da.yml +771 -0
- data/config/locales/de-CH.yml +248 -0
- data/config/locales/de.yml +835 -0
- data/config/locales/el.yml +769 -0
- data/config/locales/en.yml +37 -503
- data/config/locales/es-CL.yml +301 -0
- data/config/locales/es-EC.yml +186 -0
- data/config/locales/es-MX.yml +334 -0
- data/config/locales/es.yml +831 -0
- data/config/locales/et.yml +644 -0
- data/config/locales/fa.yml +709 -0
- data/config/locales/fi.yml +771 -0
- data/config/locales/fr.yml +830 -0
- data/config/locales/hu.yml +751 -0
- data/config/locales/id.yml +756 -0
- data/config/locales/it.yml +833 -0
- data/config/locales/ja.yml +726 -0
- data/config/locales/km.yml +759 -0
- data/config/locales/ko.yml +575 -0
- data/config/locales/ku.yml +753 -0
- data/config/locales/lt.yml +821 -0
- data/config/locales/lv.yml +685 -0
- data/config/locales/nb.yml +824 -0
- data/config/locales/ne.yml +823 -0
- data/config/locales/nl.yml +826 -0
- data/config/locales/pl.yml +835 -0
- data/config/locales/pt-BR.yml +547 -0
- data/config/locales/pt.yml +636 -0
- data/config/locales/ro.yml +750 -0
- data/config/locales/ru.yml +834 -0
- data/config/locales/sk.yml +680 -0
- data/config/locales/sl-SI.yml +600 -0
- data/config/locales/sv.yml +827 -0
- data/config/locales/th.yml +745 -0
- data/config/locales/tr.yml +777 -0
- data/config/locales/uk.yml +836 -0
- data/config/locales/vi.yml +768 -0
- data/config/locales/zh-CN.yml +786 -0
- data/config/locales/zh-TW.yml +834 -0
- data/db/migrate/20260925000001_add_replacement_to_spree_fulfillment_items.rb +5 -0
- data/db/migrate/20261001000001_add_post_sale_tax.rb +30 -0
- data/db/migrate/20261001000001_convert_preferences_to_json.rb +166 -0
- data/db/migrate/20261001000001_create_spree_email_templates.rb +52 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +0 -9
- data/lib/generators/spree/dummy/templates/rails/test.rb +7 -0
- data/lib/spree/checkout/default_requirements.rb +37 -13
- data/lib/spree/core/configuration.rb +1 -1
- data/lib/spree/core/controller_helpers/store.rb +1 -1
- data/lib/spree/core/dependencies.rb +5 -4
- data/lib/spree/core/emails/escaped_output.rb +60 -0
- data/lib/spree/core/engine.rb +48 -167
- data/lib/spree/core/permissions/default_catalog.rb +5 -0
- data/lib/spree/core/preferences/json_conversion.rb +182 -0
- data/lib/spree/core/preferences/masking.rb +4 -1
- data/lib/spree/core/preferences/preferable.rb +137 -83
- data/lib/spree/core/preferences/preferable_class_methods.rb +81 -146
- data/lib/spree/core/previews/import_preview.rb +10 -0
- data/lib/spree/core/tax/provider_error.rb +37 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/core.rb +85 -370
- data/lib/spree/emails/editable_templates.rb +82 -0
- data/lib/spree/events/catalog.rb +189 -0
- data/lib/spree/events.rb +21 -1
- data/lib/spree/hooks.rb +0 -17
- data/lib/spree/i18n.rb +32 -15
- data/lib/spree/reporting/adapters/live.rb +6 -6
- data/lib/spree/reporting/default_vocabulary.rb +22 -10
- data/lib/spree/reporting/hydration.rb +1 -1
- data/lib/spree/reporting/query.rb +8 -0
- data/lib/spree/reporting/schema.rb +10 -10
- data/lib/spree/testing_support/editable_email_templates.rb +61 -0
- data/lib/spree/testing_support/emails.rb +22 -0
- data/lib/spree/testing_support/factories/cart_factory.rb +1 -1
- data/lib/spree/testing_support/factories/email_template_factory.rb +28 -0
- data/lib/spree/testing_support/factories/order_factory.rb +2 -2
- data/lib/spree/testing_support/factories/refund_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_factory.rb +1 -1
- data/lib/spree/testing_support/i18n.rb +3 -94
- data/lib/spree/testing_support/lifecycle_events.rb +1 -1
- data/lib/spree/testing_support/order_walkthrough.rb +1 -1
- data/lib/spree/testing_support/preferences.rb +0 -5
- data/lib/spree/testing_support/store.rb +9 -1
- data/lib/spree/upgrades/5_6_to_6_0/manifest.yml +45 -0
- data/lib/tasks/categories_and_collections.rake +3 -3
- data/lib/tasks/core.rake +6 -4
- data/lib/tasks/media.rake +3 -3
- data/lib/tasks/package_types.rake +1 -1
- data/lib/tasks/preferences_json.rake +101 -0
- data/spec/fixtures/mailer_views/custom_views_probe_mailer/welcome_email.html.erb +4 -0
- metadata +188 -44
- data/app/models/acts_as_taggable_on/tag_decorator.rb +0 -10
- data/app/models/concerns/spree/has_image_alt_text.rb +0 -18
- data/app/models/spree/base_analytics_event_handler.rb +0 -54
- data/app/models/spree/invitations/store.rb +0 -6
- data/app/models/spree/preference.rb +0 -14
- data/app/models/spree/promotion_handler/page.rb +0 -25
- data/app/models/spree/promotion_handler/promotion_duplicator.rb +0 -60
- data/app/models/spree/stock/differentiator.rb +0 -45
- data/app/presenters/spree/filters/options_presenter.rb +0 -47
- data/app/services/spree/carts/empty.rb +0 -42
- data/app/services/spree/country_to_timezone.rb +0 -273
- data/app/services/spree/payments/create.rb +0 -92
- data/app/validators/spree/url_validator.rb +0 -23
- data/app/views/active_storage/blobs/_blob.html.erb +0 -14
- data/app/views/spree/admin_user_mailer/password_reset_email.html.erb +0 -8
- data/app/views/spree/export_mailer/export_done.html.erb +0 -7
- data/app/views/spree/import_mailer/import_done.html.erb +0 -12
- data/app/views/spree/invitation_mailer/invitation_accepted.html.erb +0 -4
- data/app/views/spree/invitation_mailer/invitation_email.html.erb +0 -12
- data/app/views/spree/seller_user_mailer/password_reset_email.html.erb +0 -8
- data/app/views/spree/shared/_base_mailer_footer.html.erb +0 -19
- data/app/views/spree/shared/_base_mailer_header.html.erb +0 -8
- data/app/views/spree/shared/_base_mailer_stylesheets.html.erb +0 -399
- data/app/views/spree/shared/_mailer_logo.html.erb +0 -41
- data/app/views/spree/shared/_purchased_items_styles.html.erb +0 -119
- data/app/views/spree/webhook_mailer/endpoint_disabled.html.erb +0 -51
- data/app/views/spree/webhook_mailer/endpoint_disabled.text.erb +0 -10
- data/app/workflows/spree/fulfillments/purchase_label.rb +0 -40
- data/app/workflows/spree/returns/purchase_label.rb +0 -32
- data/lib/spree/analytics.rb +0 -11
- data/lib/spree/core/preferences/scoped_store.rb +0 -34
- data/lib/spree/core/preferences/store.rb +0 -105
- data/lib/spree/translation_migrations.rb +0 -52
data/lib/spree/core.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'ostruct'
|
|
2
1
|
require 'action_controller/railtie'
|
|
3
2
|
require 'action_view/railtie'
|
|
4
3
|
require 'active_job/railtie'
|
|
@@ -12,17 +11,23 @@ require 'action_mailer/railtie'
|
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
require 'acts_as_list'
|
|
14
|
+
require 'alba'
|
|
15
15
|
require 'acts-as-taggable-on'
|
|
16
16
|
require 'awesome_nested_set'
|
|
17
17
|
require 'cancan'
|
|
18
18
|
require 'countries/global'
|
|
19
19
|
require 'friendly_id'
|
|
20
20
|
require 'jwt'
|
|
21
|
+
require 'liquid'
|
|
22
|
+
require 'spree/core/emails/escaped_output'
|
|
21
23
|
require 'monetize'
|
|
22
24
|
require 'mobility'
|
|
25
|
+
require 'mrml'
|
|
23
26
|
require 'name_of_person'
|
|
24
27
|
require 'nokogiri'
|
|
28
|
+
require 'oj'
|
|
25
29
|
require 'rails-html-sanitizer'
|
|
30
|
+
require 'rails-i18n'
|
|
26
31
|
require 'paranoia'
|
|
27
32
|
require 'request_store'
|
|
28
33
|
require 'ransack'
|
|
@@ -53,21 +58,29 @@ module Spree
|
|
|
53
58
|
ActiveRecord::Base.connection.adapter_name.match?(/mysql|trilogy/i)
|
|
54
59
|
end
|
|
55
60
|
|
|
61
|
+
# Class settings hold a name rather than the class itself, so a reloaded
|
|
62
|
+
# class is never served stale.
|
|
63
|
+
def self.resolve_class_setting(name, value, constantize)
|
|
64
|
+
raise "Spree.#{name} MUST be a String or Symbol object, not a Class object." if value.is_a?(Class)
|
|
65
|
+
return unless value.is_a?(String) || value.is_a?(Symbol)
|
|
66
|
+
|
|
67
|
+
constantize ? value.to_s.constantize : value.to_s
|
|
68
|
+
end
|
|
69
|
+
private_class_method :resolve_class_setting
|
|
70
|
+
|
|
71
|
+
def self.storage_service_name(value)
|
|
72
|
+
return Rails.application.config.active_storage.service unless value
|
|
73
|
+
|
|
74
|
+
value.to_sym if value.is_a?(String) || value.is_a?(Symbol)
|
|
75
|
+
end
|
|
76
|
+
private_class_method :storage_service_name
|
|
77
|
+
|
|
56
78
|
def self.base_class(constantize: true)
|
|
57
|
-
@@base_class ||= 'Spree::Base'
|
|
58
|
-
if @@base_class.is_a?(Class)
|
|
59
|
-
raise 'Spree.base_class MUST be a String or Symbol object, not a Class object.'
|
|
60
|
-
elsif @@base_class.is_a?(String) || @@base_class.is_a?(Symbol)
|
|
61
|
-
constantize ? @@base_class.to_s.constantize : @@base_class.to_s
|
|
62
|
-
end
|
|
79
|
+
resolve_class_setting(:base_class, @@base_class ||= 'Spree::Base', constantize)
|
|
63
80
|
end
|
|
64
81
|
|
|
65
82
|
def self.customer_class(constantize: true)
|
|
66
|
-
|
|
67
|
-
raise 'Spree.customer_class MUST be a String or Symbol object, not a Class object.'
|
|
68
|
-
elsif @@customer_class.is_a?(String) || @@customer_class.is_a?(Symbol)
|
|
69
|
-
constantize ? @@customer_class.to_s.constantize : @@customer_class.to_s
|
|
70
|
-
end
|
|
83
|
+
resolve_class_setting(:customer_class, @@customer_class, constantize)
|
|
71
84
|
end
|
|
72
85
|
|
|
73
86
|
# @deprecated Spree.user_class was renamed to Spree.customer_class in 6.0; removed in 6.1.
|
|
@@ -83,39 +96,19 @@ module Spree
|
|
|
83
96
|
end
|
|
84
97
|
|
|
85
98
|
def self.admin_user_class(constantize: true)
|
|
86
|
-
|
|
87
|
-
raise 'Spree.admin_user_class MUST be a String or Symbol object, not a Class object.'
|
|
88
|
-
elsif @@admin_user_class.is_a?(String) || @@admin_user_class.is_a?(Symbol)
|
|
89
|
-
constantize ? @@admin_user_class.to_s.constantize : @@admin_user_class.to_s
|
|
90
|
-
end
|
|
99
|
+
resolve_class_setting(:admin_user_class, @@admin_user_class, constantize)
|
|
91
100
|
end
|
|
92
101
|
|
|
93
102
|
def self.private_storage_service_name
|
|
94
|
-
|
|
95
|
-
if @@private_storage_service_name.is_a?(String) || @@private_storage_service_name.is_a?(Symbol)
|
|
96
|
-
@@private_storage_service_name.to_sym
|
|
97
|
-
end
|
|
98
|
-
else
|
|
99
|
-
Rails.application.config.active_storage.service
|
|
100
|
-
end
|
|
103
|
+
storage_service_name(@@private_storage_service_name)
|
|
101
104
|
end
|
|
102
105
|
|
|
103
106
|
def self.public_storage_service_name
|
|
104
|
-
|
|
105
|
-
if @@public_storage_service_name.is_a?(String) || @@public_storage_service_name.is_a?(Symbol)
|
|
106
|
-
@@public_storage_service_name.to_sym
|
|
107
|
-
end
|
|
108
|
-
else
|
|
109
|
-
Rails.application.config.active_storage.service
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
def self.root_domain
|
|
114
|
-
@@root_domain
|
|
107
|
+
storage_service_name(@@public_storage_service_name)
|
|
115
108
|
end
|
|
116
109
|
|
|
117
110
|
def self.queues
|
|
118
|
-
@@queues ||=
|
|
111
|
+
@@queues ||= ActiveSupport::OrderedOptions.new.update(
|
|
119
112
|
default: :default,
|
|
120
113
|
events: :default,
|
|
121
114
|
exports: :default,
|
|
@@ -147,7 +140,7 @@ module Spree
|
|
|
147
140
|
|
|
148
141
|
# @deprecated Renamed with the stock level rename in 6.0; removed in 6.1.
|
|
149
142
|
#
|
|
150
|
-
# The writer matters as much as the reader here:
|
|
143
|
+
# The writer matters as much as the reader here: these are ordered options, so
|
|
151
144
|
# an existing initializer assigning the old name would quietly define a
|
|
152
145
|
# field nobody reads and its jobs would fall back to the default queue.
|
|
153
146
|
queues.define_singleton_method(:stock_location_stock_items) do
|
|
@@ -206,17 +199,7 @@ module Spree
|
|
|
206
199
|
# @param constantize [Boolean] whether to return the class or the string
|
|
207
200
|
# @return [Class, String] the adapter class or its name
|
|
208
201
|
def self.events_adapter_class(constantize: true)
|
|
209
|
-
@@events_adapter_class ||= 'Spree::Events::Adapters::ActiveSupportNotifications'
|
|
210
|
-
|
|
211
|
-
if @@events_adapter_class.is_a?(Class)
|
|
212
|
-
raise 'Spree.events_adapter_class MUST be a String or Symbol object, not a Class object.'
|
|
213
|
-
elsif @@events_adapter_class.is_a?(String) || @@events_adapter_class.is_a?(Symbol)
|
|
214
|
-
constantize ? @@events_adapter_class.to_s.constantize : @@events_adapter_class.to_s
|
|
215
|
-
end
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
def self.google_places_api_key
|
|
219
|
-
@@google_places_api_key
|
|
202
|
+
resolve_class_setting(:events_adapter_class, @@events_adapter_class ||= 'Spree::Events::Adapters::ActiveSupportNotifications', constantize)
|
|
220
203
|
end
|
|
221
204
|
|
|
222
205
|
def self.always_use_translations?
|
|
@@ -239,20 +222,12 @@ module Spree
|
|
|
239
222
|
->(locale) { locale.name == Spree::Current.content_locale }
|
|
240
223
|
end
|
|
241
224
|
|
|
242
|
-
# Stable anonymous identifier for this Spree installation
|
|
243
|
-
#
|
|
244
|
-
# installation only
|
|
225
|
+
# Stable anonymous identifier for this Spree installation, kept on the
|
|
226
|
+
# default store, which generates it when it is first saved.
|
|
245
227
|
#
|
|
246
|
-
#
|
|
247
|
-
# of truth, so processes that race to generate the first value converge on
|
|
248
|
-
# the winning row at the next read instead of each holding a different id
|
|
249
|
-
# for their lifetime.
|
|
250
|
-
#
|
|
251
|
-
# @return [String] UUID
|
|
228
|
+
# @return [String, nil] UUID, or nil before the default store exists
|
|
252
229
|
def self.install_id
|
|
253
|
-
|
|
254
|
-
store.get('spree/install_id') { nil }.presence ||
|
|
255
|
-
SecureRandom.uuid.tap { |id| store.set('spree/install_id', id) }
|
|
230
|
+
Spree::Store.default&.preferred_install_id
|
|
256
231
|
end
|
|
257
232
|
|
|
258
233
|
# Used to configure Spree.
|
|
@@ -285,41 +260,24 @@ module Spree
|
|
|
285
260
|
yield(Spree::Dependencies)
|
|
286
261
|
end
|
|
287
262
|
|
|
263
|
+
def self.spree_config
|
|
264
|
+
Rails.application.config.spree
|
|
265
|
+
end
|
|
266
|
+
private_class_method :spree_config
|
|
267
|
+
|
|
288
268
|
# Environment accessors for easier configuration access
|
|
289
269
|
# Instead of Rails.application.config.spree.payment_methods
|
|
290
270
|
# you can use Spree.payment_methods
|
|
291
271
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
Rails.application.config.spree.validators
|
|
302
|
-
end
|
|
303
|
-
|
|
304
|
-
def self.validators=(value)
|
|
305
|
-
Rails.application.config.spree.validators = value
|
|
306
|
-
end
|
|
307
|
-
|
|
308
|
-
def self.payment_methods
|
|
309
|
-
Rails.application.config.spree.payment_methods
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
def self.payment_methods=(value)
|
|
313
|
-
Rails.application.config.spree.payment_methods = value
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
def self.adjusters
|
|
317
|
-
Rails.application.config.spree.adjusters
|
|
318
|
-
end
|
|
319
|
-
|
|
320
|
-
def self.adjusters=(value)
|
|
321
|
-
Rails.application.config.spree.adjusters = value
|
|
322
|
-
end
|
|
272
|
+
singleton_class.delegate :calculators, :calculators=, :validators, :validators=, :payment_methods, :payment_methods=,
|
|
273
|
+
:adjusters, :adjusters=, :fulfillment_providers, :fulfillment_providers=, :tracking_carriers,
|
|
274
|
+
:tracking_carriers=, :stock_splitters, :stock_splitters=, :delivery_method_rules,
|
|
275
|
+
:delivery_method_rules=, :order_routing, :order_routing=, :promotions, :promotions=,
|
|
276
|
+
:line_item_comparison_hooks, :line_item_comparison_hooks=, :data_feed_types, :data_feed_types=,
|
|
277
|
+
:export_types, :export_types=, :import_types, :import_types=, :taxon_rules, :taxon_rules=,
|
|
278
|
+
:translatable_resources, :translatable_resources=, :custom_fields, :integrations, :integrations=,
|
|
279
|
+
:pricing, :pricing=,
|
|
280
|
+
to: :spree_config
|
|
323
281
|
|
|
324
282
|
# Model names a {Spree::Media} row may be placed on — where a file *lives*.
|
|
325
283
|
# The viewable column is polymorphic, so this is what keeps it from accepting
|
|
@@ -331,13 +289,7 @@ module Spree
|
|
|
331
289
|
# Spree.media_viewable_types += ['MyApp::Lookbook']
|
|
332
290
|
#
|
|
333
291
|
# @return [Array<String>]
|
|
334
|
-
|
|
335
|
-
Rails.application.config.spree.media_viewable_types
|
|
336
|
-
end
|
|
337
|
-
|
|
338
|
-
def self.media_viewable_types=(value)
|
|
339
|
-
Rails.application.config.spree.media_viewable_types = value
|
|
340
|
-
end
|
|
292
|
+
singleton_class.delegate :media_viewable_types, :media_viewable_types=, to: :spree_config
|
|
341
293
|
|
|
342
294
|
# The tax engine used when a market names none — the fallback behind
|
|
343
295
|
# {Spree::Purchase::Taxation#tax_provider}, which is what call sites actually
|
|
@@ -366,60 +318,30 @@ module Spree
|
|
|
366
318
|
# name and finding out at checkout.
|
|
367
319
|
#
|
|
368
320
|
# @return [Array<Class>]
|
|
369
|
-
|
|
370
|
-
Rails.application.config.spree.tax_providers
|
|
371
|
-
end
|
|
372
|
-
|
|
373
|
-
def self.tax_providers=(value)
|
|
374
|
-
Rails.application.config.spree.tax_providers = value
|
|
375
|
-
end
|
|
321
|
+
singleton_class.delegate :tax_providers, :tax_providers=, to: :spree_config
|
|
376
322
|
|
|
377
323
|
# Pricing engines a store can be pointed at. Connector gems append their own,
|
|
378
324
|
# so a merchant picks from what is actually installed.
|
|
379
325
|
#
|
|
380
326
|
# @return [Array<Class>]
|
|
381
|
-
|
|
382
|
-
Rails.application.config.spree.pricing_providers
|
|
383
|
-
end
|
|
384
|
-
|
|
385
|
-
def self.pricing_providers=(value)
|
|
386
|
-
Rails.application.config.spree.pricing_providers = value
|
|
387
|
-
end
|
|
327
|
+
singleton_class.delegate :pricing_providers, :pricing_providers=, to: :spree_config
|
|
388
328
|
|
|
389
329
|
# Inventory sources a store can be pointed at.
|
|
390
330
|
#
|
|
391
331
|
# @return [Array<Class>]
|
|
392
|
-
|
|
393
|
-
Rails.application.config.spree.inventory_providers
|
|
394
|
-
end
|
|
395
|
-
|
|
396
|
-
def self.inventory_providers=(value)
|
|
397
|
-
Rails.application.config.spree.inventory_providers = value
|
|
398
|
-
end
|
|
332
|
+
singleton_class.delegate :inventory_providers, :inventory_providers=, to: :spree_config
|
|
399
333
|
|
|
400
334
|
# How sellers get paid. Core ships {Spree::PayoutProvider::System}, which
|
|
401
335
|
# keeps the books and leaves the operator to settle; a provider gem appends
|
|
402
336
|
# one that moves the money itself.
|
|
403
337
|
#
|
|
404
338
|
# @return [Array<Class>]
|
|
405
|
-
|
|
406
|
-
Rails.application.config.spree.payout_providers
|
|
407
|
-
end
|
|
408
|
-
|
|
409
|
-
def self.payout_providers=(value)
|
|
410
|
-
Rails.application.config.spree.payout_providers = value
|
|
411
|
-
end
|
|
339
|
+
singleton_class.delegate :payout_providers, :payout_providers=, to: :spree_config
|
|
412
340
|
|
|
413
341
|
# The provider a store pays through when it has named none.
|
|
414
342
|
#
|
|
415
343
|
# @return [Class]
|
|
416
|
-
|
|
417
|
-
Rails.application.config.spree.default_payout_provider
|
|
418
|
-
end
|
|
419
|
-
|
|
420
|
-
def self.default_payout_provider=(value)
|
|
421
|
-
Rails.application.config.spree.default_payout_provider = value
|
|
422
|
-
end
|
|
344
|
+
singleton_class.delegate :default_payout_provider, :default_payout_provider=, to: :spree_config
|
|
423
345
|
|
|
424
346
|
# Validator enforcing the password policy on the default auth models
|
|
425
347
|
# ({Spree::Customer}, {Spree::AdminUser}). Defaults to
|
|
@@ -433,80 +355,30 @@ module Spree
|
|
|
433
355
|
# Spree.password_validator = MyApp::PasswordValidator
|
|
434
356
|
#
|
|
435
357
|
# @return [Class]
|
|
436
|
-
|
|
437
|
-
Rails.application.config.spree.password_validator
|
|
438
|
-
end
|
|
439
|
-
|
|
440
|
-
def self.password_validator=(value)
|
|
441
|
-
Rails.application.config.spree.password_validator = value
|
|
442
|
-
end
|
|
358
|
+
singleton_class.delegate :password_validator, :password_validator=, to: :spree_config
|
|
443
359
|
|
|
444
|
-
def self.fulfillment_providers
|
|
445
|
-
Rails.application.config.spree.fulfillment_providers
|
|
446
|
-
end
|
|
447
|
-
|
|
448
|
-
def self.fulfillment_providers=(value)
|
|
449
|
-
Rails.application.config.spree.fulfillment_providers = value
|
|
450
|
-
end
|
|
451
|
-
|
|
452
|
-
def self.tracking_carriers
|
|
453
|
-
Rails.application.config.spree.tracking_carriers
|
|
454
|
-
end
|
|
455
|
-
|
|
456
|
-
def self.tracking_carriers=(value)
|
|
457
|
-
Rails.application.config.spree.tracking_carriers = value
|
|
458
|
-
end
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
def self.stock_splitters
|
|
462
|
-
Rails.application.config.spree.stock_splitters
|
|
463
|
-
end
|
|
464
|
-
|
|
465
|
-
def self.stock_splitters=(value)
|
|
466
|
-
Rails.application.config.spree.stock_splitters = value
|
|
467
|
-
end
|
|
468
360
|
|
|
469
361
|
# Commission rule kinds selectable on a commission rate.
|
|
470
362
|
#
|
|
471
363
|
# @return [Array<Class>]
|
|
472
|
-
|
|
473
|
-
Rails.application.config.spree.commission_rules
|
|
474
|
-
end
|
|
475
|
-
|
|
476
|
-
def self.commission_rules=(value)
|
|
477
|
-
Rails.application.config.spree.commission_rules = value
|
|
478
|
-
end
|
|
364
|
+
singleton_class.delegate :commission_rules, :commission_rules=, to: :spree_config
|
|
479
365
|
|
|
480
366
|
# Seller onboarding requirement kinds an operator can configure
|
|
481
367
|
# (docs/plans/6.0-seller-onboarding-requirements.md).
|
|
482
368
|
#
|
|
483
369
|
# @return [Array<Class>]
|
|
484
|
-
|
|
485
|
-
Rails.application.config.spree.seller_requirements
|
|
486
|
-
end
|
|
487
|
-
|
|
488
|
-
def self.seller_requirements=(value)
|
|
489
|
-
Rails.application.config.spree.seller_requirements = value
|
|
490
|
-
end
|
|
491
|
-
|
|
492
|
-
def self.delivery_method_rules
|
|
493
|
-
Rails.application.config.spree.delivery_method_rules
|
|
494
|
-
end
|
|
495
|
-
|
|
496
|
-
def self.delivery_method_rules=(value)
|
|
497
|
-
Rails.application.config.spree.delivery_method_rules = value
|
|
498
|
-
end
|
|
370
|
+
singleton_class.delegate :seller_requirements, :seller_requirements=, to: :spree_config
|
|
499
371
|
|
|
500
372
|
# Quoting strategies selectable on a delivery method.
|
|
501
373
|
#
|
|
502
374
|
# @return [Array<Class>]
|
|
503
|
-
|
|
504
|
-
Rails.application.config.spree.delivery_rate_providers
|
|
505
|
-
end
|
|
375
|
+
singleton_class.delegate :delivery_rate_providers, :delivery_rate_providers=, to: :spree_config
|
|
506
376
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
377
|
+
# Third-party pickup point networks selectable on a pickup-point delivery
|
|
378
|
+
# method. Empty in core; carrier gems append theirs.
|
|
379
|
+
#
|
|
380
|
+
# @return [Array<Class>]
|
|
381
|
+
singleton_class.delegate :pickup_point_providers, :pickup_point_providers=, to: :spree_config
|
|
510
382
|
|
|
511
383
|
# Re-resolves every provider registry entry by name, in place.
|
|
512
384
|
#
|
|
@@ -525,7 +397,8 @@ module Spree
|
|
|
525
397
|
# @return [void]
|
|
526
398
|
def self.refresh_provider_registries!
|
|
527
399
|
[Rails.application.config.spree.delivery_rate_providers,
|
|
528
|
-
Rails.application.config.spree.fulfillment_providers
|
|
400
|
+
Rails.application.config.spree.fulfillment_providers,
|
|
401
|
+
Rails.application.config.spree.pickup_point_providers].compact.each do |registry|
|
|
529
402
|
registry.map! { |entry| entry.is_a?(Module) && entry.name ? entry.name.constantize : entry }
|
|
530
403
|
end
|
|
531
404
|
end
|
|
@@ -535,80 +408,12 @@ module Spree
|
|
|
535
408
|
# deliverable elsewhere (a licensing system, a code pool).
|
|
536
409
|
#
|
|
537
410
|
# @return [Array<Class>]
|
|
538
|
-
|
|
539
|
-
Rails.application.config.spree.digital_asset_providers
|
|
540
|
-
end
|
|
541
|
-
|
|
542
|
-
def self.digital_asset_providers=(value)
|
|
543
|
-
Rails.application.config.spree.digital_asset_providers = value
|
|
544
|
-
end
|
|
411
|
+
singleton_class.delegate :digital_asset_providers, :digital_asset_providers=, to: :spree_config
|
|
545
412
|
|
|
546
413
|
# Fulfillment profile kinds selectable when creating a profile.
|
|
547
414
|
#
|
|
548
415
|
# @return [Array<Class>]
|
|
549
|
-
|
|
550
|
-
Rails.application.config.spree.delivery_profile_types
|
|
551
|
-
end
|
|
552
|
-
|
|
553
|
-
def self.delivery_profile_types=(value)
|
|
554
|
-
Rails.application.config.spree.delivery_profile_types = value
|
|
555
|
-
end
|
|
556
|
-
|
|
557
|
-
def self.order_routing
|
|
558
|
-
Rails.application.config.spree.order_routing
|
|
559
|
-
end
|
|
560
|
-
|
|
561
|
-
def self.order_routing=(value)
|
|
562
|
-
Rails.application.config.spree.order_routing = value
|
|
563
|
-
end
|
|
564
|
-
|
|
565
|
-
def self.promotions
|
|
566
|
-
Rails.application.config.spree.promotions
|
|
567
|
-
end
|
|
568
|
-
|
|
569
|
-
def self.promotions=(value)
|
|
570
|
-
Rails.application.config.spree.promotions = value
|
|
571
|
-
end
|
|
572
|
-
|
|
573
|
-
def self.line_item_comparison_hooks
|
|
574
|
-
Rails.application.config.spree.line_item_comparison_hooks
|
|
575
|
-
end
|
|
576
|
-
|
|
577
|
-
def self.line_item_comparison_hooks=(value)
|
|
578
|
-
Rails.application.config.spree.line_item_comparison_hooks = value
|
|
579
|
-
end
|
|
580
|
-
|
|
581
|
-
def self.data_feed_types
|
|
582
|
-
Rails.application.config.spree.data_feed_types
|
|
583
|
-
end
|
|
584
|
-
|
|
585
|
-
def self.data_feed_types=(value)
|
|
586
|
-
Rails.application.config.spree.data_feed_types = value
|
|
587
|
-
end
|
|
588
|
-
|
|
589
|
-
def self.export_types
|
|
590
|
-
Rails.application.config.spree.export_types
|
|
591
|
-
end
|
|
592
|
-
|
|
593
|
-
def self.export_types=(value)
|
|
594
|
-
Rails.application.config.spree.export_types = value
|
|
595
|
-
end
|
|
596
|
-
|
|
597
|
-
def self.import_types
|
|
598
|
-
Rails.application.config.spree.import_types
|
|
599
|
-
end
|
|
600
|
-
|
|
601
|
-
def self.import_types=(value)
|
|
602
|
-
Rails.application.config.spree.import_types = value
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
def self.taxon_rules
|
|
606
|
-
Rails.application.config.spree.taxon_rules
|
|
607
|
-
end
|
|
608
|
-
|
|
609
|
-
def self.taxon_rules=(value)
|
|
610
|
-
Rails.application.config.spree.taxon_rules = value
|
|
611
|
-
end
|
|
416
|
+
singleton_class.delegate :delivery_profile_types, :delivery_profile_types=, to: :spree_config
|
|
612
417
|
|
|
613
418
|
# Class-name strings (`'Spree::Product'`, `'Spree::Order'`,
|
|
614
419
|
# `Spree.customer_class.to_s`, plus any registered by apps) for resources that
|
|
@@ -617,13 +422,7 @@ module Spree
|
|
|
617
422
|
# the list in an initializer:
|
|
618
423
|
#
|
|
619
424
|
# Spree.taggable_types << 'MyApp::Seller'
|
|
620
|
-
|
|
621
|
-
Rails.application.config.spree.taggable_types
|
|
622
|
-
end
|
|
623
|
-
|
|
624
|
-
def self.taggable_types=(value)
|
|
625
|
-
Rails.application.config.spree.taggable_types = value
|
|
626
|
-
end
|
|
425
|
+
singleton_class.delegate :taggable_types, :taggable_types=, to: :spree_config
|
|
627
426
|
|
|
628
427
|
# Class-name strings for the models that may be recorded as having performed
|
|
629
428
|
# an action — what an `acted_by` association's `*_type` column is allowed to
|
|
@@ -636,13 +435,7 @@ module Spree
|
|
|
636
435
|
# See docs/plans/6.0-action-actors.md.
|
|
637
436
|
#
|
|
638
437
|
# @return [Array<String>]
|
|
639
|
-
|
|
640
|
-
Rails.application.config.spree.actor_classes
|
|
641
|
-
end
|
|
642
|
-
|
|
643
|
-
def self.actor_classes=(value)
|
|
644
|
-
Rails.application.config.spree.actor_classes = value
|
|
645
|
-
end
|
|
438
|
+
singleton_class.delegate :actor_classes, :actor_classes=, to: :spree_config
|
|
646
439
|
|
|
647
440
|
|
|
648
441
|
# Registry of the Getting Started onboarding tasks shown on the admin
|
|
@@ -653,31 +446,11 @@ module Spree
|
|
|
653
446
|
@store_setup_tasks ||= Spree::SetupTasks.new
|
|
654
447
|
end
|
|
655
448
|
|
|
656
|
-
def self.translatable_resources
|
|
657
|
-
Rails.application.config.spree.translatable_resources
|
|
658
|
-
end
|
|
659
|
-
|
|
660
|
-
def self.translatable_resources=(value)
|
|
661
|
-
Rails.application.config.spree.translatable_resources = value
|
|
662
|
-
end
|
|
663
|
-
|
|
664
|
-
def self.custom_fields
|
|
665
|
-
Rails.application.config.spree.custom_fields
|
|
666
|
-
end
|
|
667
|
-
|
|
668
449
|
def self.metafields
|
|
669
450
|
Spree::Deprecation.warn('Spree.metafields is deprecated and will be removed in Spree 6.1. Use Spree.custom_fields instead.') if defined?(Spree::Deprecation)
|
|
670
451
|
custom_fields
|
|
671
452
|
end
|
|
672
453
|
|
|
673
|
-
def self.integrations
|
|
674
|
-
Rails.application.config.spree.integrations
|
|
675
|
-
end
|
|
676
|
-
|
|
677
|
-
def self.integrations=(value)
|
|
678
|
-
Rails.application.config.spree.integrations = value
|
|
679
|
-
end
|
|
680
|
-
|
|
681
454
|
# Registry mapping a numbered resource to the generator that produces its
|
|
682
455
|
# document numbers. With no entry, the store's `document_number_format`
|
|
683
456
|
# preference picks between the sequential and random strategies.
|
|
@@ -685,8 +458,13 @@ module Spree
|
|
|
685
458
|
# @return [Spree::NumberGenerators::Registry]
|
|
686
459
|
# @example Custom order numbers
|
|
687
460
|
# Spree.number_generators[:order] = 'MyApp::BranchOrderNumbers'
|
|
688
|
-
|
|
689
|
-
|
|
461
|
+
singleton_class.delegate :number_generators, to: :spree_config
|
|
462
|
+
|
|
463
|
+
# The email templates merchants may edit in the dashboard.
|
|
464
|
+
#
|
|
465
|
+
# @return [Spree::Emails::EditableTemplates]
|
|
466
|
+
def self.editable_email_templates
|
|
467
|
+
@editable_email_templates ||= Spree::Emails::EditableTemplates.new
|
|
690
468
|
end
|
|
691
469
|
|
|
692
470
|
# Event subscribers that handle lifecycle and custom events
|
|
@@ -694,21 +472,7 @@ module Spree
|
|
|
694
472
|
# Spree.subscribers << MyApp::OrderNotificationSubscriber
|
|
695
473
|
# @example Removing a built-in subscriber
|
|
696
474
|
# Spree.subscribers.delete(Spree::ExportSubscriber)
|
|
697
|
-
|
|
698
|
-
Rails.application.config.spree.subscribers
|
|
699
|
-
end
|
|
700
|
-
|
|
701
|
-
def self.subscribers=(value)
|
|
702
|
-
Rails.application.config.spree.subscribers = value
|
|
703
|
-
end
|
|
704
|
-
|
|
705
|
-
def self.pricing
|
|
706
|
-
Rails.application.config.spree.pricing
|
|
707
|
-
end
|
|
708
|
-
|
|
709
|
-
def self.pricing=(value)
|
|
710
|
-
Rails.application.config.spree.pricing = value
|
|
711
|
-
end
|
|
475
|
+
singleton_class.delegate :subscribers, :subscribers=, to: :spree_config
|
|
712
476
|
|
|
713
477
|
# Registry of authentication strategy classes for the Store API.
|
|
714
478
|
# @return [Spree::Authentication::StrategyRegistry]
|
|
@@ -716,29 +480,17 @@ module Spree
|
|
|
716
480
|
# Spree.store_authentication_strategies.add(:auth0, MyApp::Auth::Auth0Strategy)
|
|
717
481
|
# @example Removing a strategy
|
|
718
482
|
# Spree.store_authentication_strategies.remove(:email)
|
|
719
|
-
def self.store_authentication_strategies
|
|
720
|
-
Rails.application.config.spree.store_authentication_strategies
|
|
721
|
-
end
|
|
722
|
-
|
|
723
483
|
# @param value [Spree::Authentication::StrategyRegistry] the registry to use for Store API authentication dispatch
|
|
724
484
|
# @return [Spree::Authentication::StrategyRegistry] the assigned registry
|
|
725
|
-
|
|
726
|
-
Rails.application.config.spree.store_authentication_strategies = value
|
|
727
|
-
end
|
|
485
|
+
singleton_class.delegate :store_authentication_strategies, :store_authentication_strategies=, to: :spree_config
|
|
728
486
|
|
|
729
487
|
# Registry of authentication strategy classes for the Admin API.
|
|
730
488
|
# @return [Spree::Authentication::StrategyRegistry]
|
|
731
489
|
# @example Registering an SSO strategy for admin users
|
|
732
490
|
# Spree.admin_authentication_strategies.add(:okta, MyApp::Auth::OktaStrategy)
|
|
733
|
-
def self.admin_authentication_strategies
|
|
734
|
-
Rails.application.config.spree.admin_authentication_strategies
|
|
735
|
-
end
|
|
736
|
-
|
|
737
491
|
# @param value [Spree::Authentication::StrategyRegistry] the registry to use for Admin API authentication dispatch
|
|
738
492
|
# @return [Spree::Authentication::StrategyRegistry] the assigned registry
|
|
739
|
-
|
|
740
|
-
Rails.application.config.spree.admin_authentication_strategies = value
|
|
741
|
-
end
|
|
493
|
+
singleton_class.delegate :admin_authentication_strategies, :admin_authentication_strategies=, to: :spree_config
|
|
742
494
|
|
|
743
495
|
# Registry of authentication strategy classes for the Seller API.
|
|
744
496
|
#
|
|
@@ -750,50 +502,14 @@ module Spree
|
|
|
750
502
|
# @return [Spree::Authentication::StrategyRegistry]
|
|
751
503
|
# @example Registering an SSO strategy for seller users
|
|
752
504
|
# Spree.seller_authentication_strategies.add(:okta, MyApp::Auth::OktaStrategy)
|
|
753
|
-
def self.seller_authentication_strategies
|
|
754
|
-
Rails.application.config.spree.seller_authentication_strategies
|
|
755
|
-
end
|
|
756
|
-
|
|
757
505
|
# @param value [Spree::Authentication::StrategyRegistry] the registry to use for Seller API authentication dispatch
|
|
758
506
|
# @return [Spree::Authentication::StrategyRegistry] the assigned registry
|
|
759
|
-
|
|
760
|
-
Rails.application.config.spree.seller_authentication_strategies = value
|
|
761
|
-
end
|
|
507
|
+
singleton_class.delegate :seller_authentication_strategies, :seller_authentication_strategies=, to: :spree_config
|
|
762
508
|
|
|
763
509
|
# Semantic reporting registry — the queryable metric/dimension vocabulary.
|
|
764
|
-
# Not to be confused with +Spree.analytics+ (storefront event tracking).
|
|
765
510
|
#
|
|
766
511
|
# @return [Spree::Reporting::Registry]
|
|
767
|
-
|
|
768
|
-
Rails.application.config.spree.reporting
|
|
769
|
-
end
|
|
770
|
-
|
|
771
|
-
def self.reporting=(value)
|
|
772
|
-
Rails.application.config.spree.reporting = value
|
|
773
|
-
end
|
|
774
|
-
|
|
775
|
-
def self.analytics
|
|
776
|
-
@analytics ||= AnalyticsConfig.new
|
|
777
|
-
end
|
|
778
|
-
|
|
779
|
-
# Group analytics configuration options together, but still make it backwards compatible.
|
|
780
|
-
class AnalyticsConfig
|
|
781
|
-
def events
|
|
782
|
-
Rails.application.config.spree.analytics_events
|
|
783
|
-
end
|
|
784
|
-
|
|
785
|
-
def events=(value)
|
|
786
|
-
Rails.application.config.spree.analytics_events = value
|
|
787
|
-
end
|
|
788
|
-
|
|
789
|
-
def handlers
|
|
790
|
-
Rails.application.config.spree.analytics_event_handlers
|
|
791
|
-
end
|
|
792
|
-
|
|
793
|
-
def handlers=(value)
|
|
794
|
-
Rails.application.config.spree.analytics_event_handlers = value
|
|
795
|
-
end
|
|
796
|
-
end
|
|
512
|
+
singleton_class.delegate :reporting, :reporting=, to: :spree_config
|
|
797
513
|
|
|
798
514
|
# The permission catalog — the grant vocabulary shared by staff roles and
|
|
799
515
|
# secret API key scopes. Roles themselves are data (Spree::Role#permissions);
|
|
@@ -905,7 +621,6 @@ require 'spree/core/version'
|
|
|
905
621
|
require 'spree/core/number_generator'
|
|
906
622
|
require 'spree/number_generators/registry'
|
|
907
623
|
require 'spree/migrations'
|
|
908
|
-
require 'spree/translation_migrations'
|
|
909
624
|
require 'spree/validators'
|
|
910
625
|
require 'spree/core/engine'
|
|
911
626
|
|
|
@@ -917,7 +632,6 @@ require 'spree/translations'
|
|
|
917
632
|
require 'spree/money'
|
|
918
633
|
require 'spree/service_module'
|
|
919
634
|
require 'spree/workflow'
|
|
920
|
-
require 'spree/analytics'
|
|
921
635
|
require 'spree/reporting'
|
|
922
636
|
require 'spree/events'
|
|
923
637
|
require 'spree/store_scope_guard'
|
|
@@ -927,18 +641,19 @@ require 'spree/store_scope_guard'
|
|
|
927
641
|
require 'spree/checkout/step'
|
|
928
642
|
require 'spree/checkout/requirement'
|
|
929
643
|
require 'spree/checkout/registry'
|
|
644
|
+
require 'spree/emails/editable_templates'
|
|
930
645
|
require 'spree/checkout/default_requirements'
|
|
931
646
|
require 'spree/checkout/requirements'
|
|
932
647
|
|
|
933
648
|
require 'spree/core/controller_helpers/store'
|
|
934
649
|
|
|
935
|
-
require 'spree/core/preferences/store'
|
|
936
|
-
require 'spree/core/preferences/scoped_store'
|
|
937
650
|
require 'spree/core/preferences/runtime_configuration'
|
|
938
651
|
require 'spree/core/preferences/masking'
|
|
652
|
+
require 'spree/core/preferences/json_conversion'
|
|
939
653
|
|
|
940
654
|
require 'spree/core/permission_configuration'
|
|
941
655
|
require 'spree/core/ransack_configuration'
|
|
942
656
|
require 'spree/core/pricing/context'
|
|
943
657
|
require 'spree/core/pricing/price_resolution'
|
|
944
658
|
require 'spree/core/pricing/resolver'
|
|
659
|
+
require 'spree/core/tax/provider_error'
|