solidus_core 2.9.6 → 2.11.0
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/app/assets/javascripts/spree.js.erb +31 -2
- data/app/controllers/spree/base_controller.rb +1 -0
- data/app/helpers/spree/base_helper.rb +4 -4
- data/app/helpers/spree/products_helper.rb +2 -1
- data/app/jobs/spree/promotion_code_batch_job.rb +2 -2
- data/app/mailers/spree/base_mailer.rb +4 -0
- data/app/mailers/spree/order_mailer.rb +1 -1
- data/app/models/concerns/spree/active_storage_adapter.rb +116 -0
- data/app/models/concerns/spree/active_storage_adapter/attachment.rb +69 -0
- data/app/models/concerns/spree/active_storage_adapter/normalization.rb +39 -0
- data/app/models/concerns/spree/default_price.rb +1 -1
- data/app/models/concerns/spree/soft_deletable.rb +18 -0
- data/app/models/concerns/spree/user_address_book.rb +87 -33
- data/app/models/concerns/spree/user_methods.rb +5 -4
- data/app/models/spree/ability.rb +34 -10
- data/app/models/spree/address.rb +103 -30
- data/app/models/spree/address/name.rb +49 -0
- data/app/models/spree/address/state_validator.rb +71 -0
- data/app/models/spree/adjustment.rb +21 -10
- data/app/models/spree/asset.rb +1 -1
- data/app/models/spree/base.rb +1 -2
- data/app/models/spree/calculator.rb +1 -1
- data/app/models/spree/calculator/default_tax.rb +1 -1
- data/app/models/spree/calculator/percent_per_item.rb +4 -4
- data/app/models/spree/calculator/price_sack.rb +1 -1
- data/app/models/spree/calculator/shipping/flexi_rate.rb +2 -2
- data/app/models/spree/calculator/tiered_flat_rate.rb +5 -5
- data/app/models/spree/calculator/tiered_percent.rb +6 -6
- data/app/models/spree/carton.rb +3 -3
- data/app/models/spree/classification.rb +2 -2
- data/app/models/spree/credit_card.rb +6 -6
- data/app/models/spree/customer_return.rb +5 -3
- data/app/models/spree/exchange.rb +1 -1
- data/app/models/spree/image/active_storage_attachment.rb +21 -0
- data/app/models/spree/image/paperclip_attachment.rb +1 -1
- data/app/models/spree/inventory_unit.rb +5 -23
- data/app/models/spree/line_item.rb +16 -7
- data/app/models/spree/line_item_action.rb +2 -2
- data/app/models/spree/log_entry.rb +1 -1
- data/app/models/spree/option_type.rb +1 -1
- data/app/models/spree/option_value.rb +3 -3
- data/app/models/spree/option_values_variant.rb +2 -2
- data/app/models/spree/order.rb +85 -30
- data/app/models/spree/order/checkout.rb +2 -1
- data/app/models/spree/order/payments.rb +2 -2
- data/app/models/spree/order_cancellations.rb +1 -1
- data/app/models/spree/order_capturing.rb +2 -2
- data/app/models/spree/order_contents.rb +2 -2
- data/app/models/spree/order_inventory.rb +16 -4
- data/app/models/spree/order_merger.rb +6 -4
- data/app/models/spree/order_mutex.rb +1 -1
- data/app/models/spree/order_promotion.rb +4 -4
- data/app/models/spree/order_shipping.rb +1 -1
- data/app/models/spree/order_taxation.rb +3 -3
- data/app/models/spree/order_updater.rb +11 -10
- data/app/models/spree/payment.rb +10 -47
- data/app/models/spree/payment/cancellation.rb +3 -3
- data/app/models/spree/payment/processing.rb +57 -33
- data/app/models/spree/payment_capture_event.rb +1 -1
- data/app/models/spree/payment_method.rb +13 -11
- data/app/models/spree/payment_method/bogus_credit_card.rb +1 -1
- data/app/models/spree/payment_source.rb +1 -1
- data/app/models/spree/preference.rb +1 -1
- data/app/models/spree/price.rb +3 -9
- data/app/models/spree/product.rb +24 -19
- data/app/models/spree/product/scopes.rb +223 -210
- data/app/models/spree/product_option_type.rb +2 -2
- data/app/models/spree/product_promotion_rule.rb +2 -2
- data/app/models/spree/product_property.rb +2 -2
- data/app/models/spree/promotion.rb +46 -20
- data/app/models/spree/promotion/actions/create_quantity_adjustments.rb +1 -1
- data/app/models/spree/promotion/actions/free_shipping.rb +6 -5
- data/app/models/spree/promotion/rules/option_value.rb +2 -2
- data/app/models/spree/promotion/rules/product.rb +3 -3
- data/app/models/spree/promotion_action.rb +3 -9
- data/app/models/spree/promotion_chooser.rb +2 -2
- data/app/models/spree/promotion_code.rb +17 -11
- data/app/models/spree/promotion_code/batch_builder.rb +3 -3
- data/app/models/spree/promotion_code_batch.rb +2 -2
- data/app/models/spree/promotion_handler/coupon.rb +2 -2
- data/app/models/spree/promotion_rule.rb +3 -3
- data/app/models/spree/promotion_rule_role.rb +3 -3
- data/app/models/spree/promotion_rule_store.rb +2 -2
- data/app/models/spree/promotion_rule_taxon.rb +2 -2
- data/app/models/spree/promotion_rule_user.rb +2 -2
- data/app/models/spree/refund.rb +59 -17
- data/app/models/spree/reimbursement.rb +32 -13
- data/app/models/spree/reimbursement/credit.rb +2 -2
- data/app/models/spree/reimbursement/reimbursement_type_engine.rb +1 -1
- data/app/models/spree/reimbursement_tax_calculator.rb +1 -1
- data/app/models/spree/reimbursement_type/reimbursement_helpers.rb +12 -5
- data/app/models/spree/return_authorization.rb +5 -11
- data/app/models/spree/return_item.rb +33 -61
- data/app/models/spree/return_item/eligibility_validator/default.rb +1 -1
- data/app/models/spree/return_item/exchange_variant_eligibility/same_option_value.rb +1 -1
- data/app/models/spree/role.rb +1 -1
- data/app/models/spree/role_user.rb +2 -2
- data/app/models/spree/shipment.rb +9 -43
- data/app/models/spree/shipping_calculator.rb +1 -5
- data/app/models/spree/shipping_manifest.rb +5 -5
- data/app/models/spree/shipping_method.rb +3 -10
- data/app/models/spree/shipping_method_category.rb +2 -2
- data/app/models/spree/shipping_method_stock_location.rb +2 -2
- data/app/models/spree/shipping_method_zone.rb +2 -2
- data/app/models/spree/shipping_rate.rb +2 -2
- data/app/models/spree/shipping_rate_tax.rb +3 -3
- data/app/models/spree/state.rb +2 -2
- data/app/models/spree/state_change.rb +2 -2
- data/app/models/spree/stock/differentiator.rb +1 -1
- data/app/models/spree/stock/inventory_unit_builder.rb +18 -7
- data/app/models/spree/stock/inventory_units_finalizer.rb +3 -5
- data/app/models/spree/stock/package.rb +2 -2
- data/app/models/spree/stock/simple_coordinator.rb +1 -3
- data/app/models/spree/stock_item.rb +4 -10
- data/app/models/spree/stock_location.rb +2 -2
- data/app/models/spree/stock_movement.rb +4 -2
- data/app/models/spree/stock_quantities.rb +13 -12
- data/app/models/spree/store.rb +1 -1
- data/app/models/spree/store_credit.rb +9 -15
- data/app/models/spree/store_credit_category.rb +30 -3
- data/app/models/spree/store_credit_event.rb +4 -10
- data/app/models/spree/store_credit_reason.rb +0 -4
- data/app/models/spree/store_payment_method.rb +2 -2
- data/app/models/spree/store_shipping_method.rb +2 -2
- data/app/models/spree/tax/tax_helpers.rb +1 -1
- data/app/models/spree/tax_calculator/default.rb +0 -4
- data/app/models/spree/tax_calculator/shipping_rate.rb +0 -3
- data/app/models/spree/tax_category.rb +2 -8
- data/app/models/spree/tax_rate.rb +12 -8
- data/app/models/spree/tax_rate_tax_category.rb +2 -2
- data/app/models/spree/taxon.rb +1 -1
- data/app/models/spree/taxon/active_storage_attachment.rb +19 -0
- data/app/models/spree/taxon/paperclip_attachment.rb +13 -0
- data/app/models/spree/unit_cancel.rb +5 -2
- data/app/models/spree/user_address.rb +10 -4
- data/app/models/spree/user_last_url_storer.rb +46 -0
- data/app/models/spree/user_last_url_storer/rules/authentication_rule.rb +36 -0
- data/app/models/spree/user_stock_location.rb +2 -2
- data/app/models/spree/variant.rb +17 -23
- data/app/models/spree/variant/scopes.rb +37 -29
- data/app/models/spree/variant_property_rule.rb +6 -2
- data/app/models/spree/variant_property_rule_condition.rb +2 -2
- data/app/models/spree/variant_property_rule_value.rb +2 -2
- data/app/models/spree/wallet/add_payment_sources_to_wallet.rb +9 -4
- data/app/models/spree/wallet_payment_source.rb +2 -2
- data/app/models/spree/zone.rb +2 -2
- data/app/models/spree/zone_member.rb +2 -2
- data/config/initializers/inflections.rb +5 -0
- data/config/initializers/money.rb +2 -0
- data/config/locales/en.yml +78 -8
- data/db/default/spree/countries.rb +1 -1
- data/db/default/spree/states.rb +12 -4
- data/db/default/spree/store_credit.rb +2 -2
- data/db/migrate/20180416083007_add_apply_to_all_to_variant_property_rule.rb +12 -0
- data/db/migrate/20200320144521_add_default_billng_flag_to_user_addresses.rb +6 -0
- data/db/migrate/20200530111458_add_bcc_email_to_spree_stores.rb +7 -0
- data/db/migrate/20201008213609_add_discontinue_on_to_spree_products.rb +7 -0
- data/lib/generators/solidus/install/install_generator.rb +253 -0
- data/lib/generators/{spree → solidus}/install/templates/config/initializers/spree.rb.tt +42 -3
- data/lib/generators/{spree → solidus}/install/templates/vendor/assets/javascripts/spree/backend/all.js +0 -0
- data/lib/generators/{spree → solidus}/install/templates/vendor/assets/javascripts/spree/frontend/all.js +0 -0
- data/lib/generators/{spree → solidus}/install/templates/vendor/assets/stylesheets/spree/backend/all.css +0 -0
- data/lib/generators/{spree → solidus}/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +0 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +2 -0
- data/lib/generators/spree/install/install_generator.rb +7 -189
- data/lib/solidus/migrations/promotions_with_code_handlers.rb +1 -1
- data/lib/spree/app_configuration.rb +135 -54
- data/lib/spree/awesome_nested_set_override.rb +44 -0
- data/lib/spree/core.rb +6 -0
- data/lib/spree/core/controller_helpers/auth.rb +18 -17
- data/lib/spree/core/controller_helpers/current_host.rb +17 -0
- data/lib/spree/core/controller_helpers/order.rb +8 -7
- data/lib/spree/core/engine.rb +41 -4
- data/lib/spree/core/importer/order.rb +47 -33
- data/lib/spree/core/importer/product.rb +2 -2
- data/lib/spree/core/permalinks.rb +1 -3
- data/lib/spree/core/product_filters.rb +16 -15
- data/lib/spree/core/role_configuration.rb +2 -2
- data/lib/spree/core/search/variant.rb +1 -1
- data/lib/spree/core/state_machines.rb +97 -0
- data/lib/spree/core/state_machines/inventory_unit.rb +42 -0
- data/lib/spree/core/state_machines/order.rb +249 -0
- data/lib/spree/core/state_machines/payment.rb +61 -0
- data/lib/spree/core/state_machines/reimbursement.rb +33 -0
- data/lib/spree/core/state_machines/return_authorization.rb +32 -0
- data/lib/spree/core/state_machines/return_item/acceptance_status.rb +51 -0
- data/lib/spree/core/state_machines/return_item/reception_status.rb +42 -0
- data/lib/spree/core/state_machines/shipment.rb +58 -0
- data/lib/spree/core/stock_configuration.rb +1 -0
- data/lib/spree/core/validators/email.rb +1 -8
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/encryptor.rb +25 -0
- data/lib/spree/event.rb +40 -7
- data/lib/spree/event/adapters/active_support_notifications.rb +32 -0
- data/lib/spree/event/configuration.rb +11 -6
- data/lib/spree/event/subscriber.rb +38 -18
- data/lib/spree/event/subscriber_registry.rb +92 -0
- data/lib/spree/i18n.rb +1 -1
- data/lib/spree/mailer_previews/carton_preview.rb +2 -1
- data/lib/spree/money.rb +2 -2
- data/lib/spree/paranoia_deprecations.rb +32 -12
- data/lib/spree/permission_sets/configuration_display.rb +14 -14
- data/lib/spree/permission_sets/default_customer.rb +16 -16
- data/lib/spree/permission_sets/order_display.rb +11 -11
- data/lib/spree/permission_sets/order_management.rb +1 -1
- data/lib/spree/permission_sets/product_display.rb +9 -9
- data/lib/spree/permission_sets/promotion_display.rb +5 -5
- data/lib/spree/permission_sets/restricted_stock_display.rb +2 -2
- data/lib/spree/permission_sets/restricted_stock_management.rb +1 -1
- data/lib/spree/permission_sets/stock_display.rb +2 -2
- data/lib/spree/permission_sets/stock_management.rb +1 -1
- data/lib/spree/permission_sets/user_display.rb +3 -3
- data/lib/spree/permission_sets/user_management.rb +7 -3
- data/lib/spree/permitted_attributes.rb +7 -6
- data/lib/spree/preferences/preferable.rb +4 -3
- data/lib/spree/preferences/preferable_class_methods.rb +22 -3
- data/lib/spree/preferences/static_model_preferences.rb +2 -2
- data/lib/spree/testing_support/ability_helpers.rb +9 -9
- data/lib/spree/testing_support/authorization_helpers.rb +1 -0
- data/lib/spree/testing_support/blacklist_urls.rb +23 -0
- data/lib/spree/testing_support/capybara_ext.rb +3 -0
- data/lib/spree/testing_support/common_rake.rb +3 -3
- data/lib/spree/testing_support/dummy_app.rb +45 -21
- data/lib/spree/testing_support/dummy_app/migrations.rb +5 -6
- data/lib/spree/testing_support/dummy_app/rake_tasks.rb +6 -4
- data/lib/spree/testing_support/factories/address_factory.rb +1 -2
- data/lib/spree/testing_support/factories/image_factory.rb +1 -1
- data/lib/spree/testing_support/factories/inventory_unit_factory.rb +8 -1
- data/lib/spree/testing_support/factories/promotion_factory.rb +13 -0
- data/lib/spree/testing_support/factories/refund_factory.rb +1 -0
- data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
- data/lib/spree/testing_support/factories/return_item_factory.rb +0 -1
- data/lib/spree/testing_support/factories/stock_package_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_category_factory.rb +8 -0
- data/lib/spree/testing_support/factories/store_credit_event_factory.rb +1 -0
- data/lib/spree/testing_support/factories/store_credit_reason_factory.rb +3 -1
- data/lib/spree/testing_support/factories/taxon_factory.rb +4 -0
- data/lib/spree/testing_support/factories/user_factory.rb +4 -1
- data/lib/spree/testing_support/factories/zone_factory.rb +1 -1
- data/lib/spree/testing_support/job_helpers.rb +24 -0
- data/lib/spree/testing_support/precompiled_assets.rb +15 -0
- data/lib/spree/testing_support/preferences.rb +3 -1
- data/lib/spree/testing_support/shared_examples/gallery.rb +1 -1
- data/lib/spree/testing_support/translations.rb +25 -0
- data/solidus_core.gemspec +12 -9
- metadata +120 -393
- data/script/rails +0 -10
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/helpers/base_helper_spec.rb +0 -168
- data/spec/helpers/products_helper_spec.rb +0 -202
- data/spec/helpers/taxons_helper_spec.rb +0 -43
- data/spec/jobs/promotion_code_batch_job_spec.rb +0 -96
- data/spec/lib/calculated_adjustments_spec.rb +0 -133
- data/spec/lib/i18n_spec.rb +0 -97
- data/spec/lib/search/base_spec.rb +0 -87
- data/spec/lib/search/variant_spec.rb +0 -115
- data/spec/lib/spree/app_configuration_spec.rb +0 -140
- data/spec/lib/spree/core/class_constantizer_spec.rb +0 -91
- data/spec/lib/spree/core/controller_helpers/auth_spec.rb +0 -73
- data/spec/lib/spree/core/controller_helpers/order_spec.rb +0 -126
- data/spec/lib/spree/core/controller_helpers/payment_parameters_spec.rb +0 -195
- data/spec/lib/spree/core/controller_helpers/pricing_spec.rb +0 -94
- data/spec/lib/spree/core/controller_helpers/search_spec.rb +0 -21
- data/spec/lib/spree/core/controller_helpers/store_spec.rb +0 -18
- data/spec/lib/spree/core/controller_helpers/strong_parameters_spec.rb +0 -48
- data/spec/lib/spree/core/current_store_spec.rb +0 -33
- data/spec/lib/spree/core/environment_extension_spec.rb +0 -46
- data/spec/lib/spree/core/importer/order_spec.rb +0 -484
- data/spec/lib/spree/core/role_configuration_spec.rb +0 -155
- data/spec/lib/spree/core/stock_configuration_spec.rb +0 -59
- data/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb +0 -61
- data/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb +0 -44
- data/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb +0 -39
- data/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb +0 -376
- data/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb +0 -40
- data/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb +0 -32
- data/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb +0 -32
- data/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb +0 -32
- data/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb +0 -44
- data/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb +0 -59
- data/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb +0 -35
- data/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb +0 -28
- data/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb +0 -43
- data/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/store_credit_reason_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb +0 -24
- data/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb +0 -56
- data/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb +0 -14
- data/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb +0 -20
- data/spec/lib/spree/core/testing_support/preferences_spec.rb +0 -61
- data/spec/lib/spree/core/validators/email_spec.rb +0 -53
- data/spec/lib/spree/core/version_spec.rb +0 -19
- data/spec/lib/spree/event/subscriber_spec.rb +0 -85
- data/spec/lib/spree/event_spec.rb +0 -118
- data/spec/lib/spree/localized_number_spec.rb +0 -45
- data/spec/lib/spree/migrations_spec.rb +0 -32
- data/spec/lib/spree/money_spec.rb +0 -298
- data/spec/lib/spree/permission_sets/default_customer_spec.rb +0 -22
- data/spec/lib/spree/permitted_attributes_spec.rb +0 -41
- data/spec/lib/spree/promo/environment_spec.rb +0 -53
- data/spec/lib/tasks/dummy_task.rake +0 -12
- data/spec/lib/tasks/dummy_task_spec.rb +0 -30
- data/spec/lib/tasks/migrations/migrate_shipping_rate_taxes_spec.rb +0 -21
- data/spec/mailers/carton_mailer_spec.rb +0 -44
- data/spec/mailers/order_mailer_spec.rb +0 -117
- data/spec/mailers/promotion_code_batch_mailer_spec.rb +0 -47
- data/spec/mailers/reimbursement_mailer_spec.rb +0 -36
- data/spec/mailers/test_mailer_spec.rb +0 -13
- data/spec/migrate/20190106184413_remove_code_from_spree_promotions_spec.rb +0 -148
- data/spec/models/spree/ability_spec.rb +0 -279
- data/spec/models/spree/address_spec.rb +0 -376
- data/spec/models/spree/adjustment_reason_spec.rb +0 -11
- data/spec/models/spree/adjustment_spec.rb +0 -339
- data/spec/models/spree/asset_spec.rb +0 -25
- data/spec/models/spree/calculator/default_tax_spec.rb +0 -260
- data/spec/models/spree/calculator/distributed_amount_spec.rb +0 -82
- data/spec/models/spree/calculator/flat_percent_item_total_spec.rb +0 -39
- data/spec/models/spree/calculator/flat_rate_spec.rb +0 -52
- data/spec/models/spree/calculator/flexi_rate_spec.rb +0 -158
- data/spec/models/spree/calculator/free_shipping_spec.rb +0 -8
- data/spec/models/spree/calculator/percent_on_line_item_spec.rb +0 -20
- data/spec/models/spree/calculator/percent_per_item_spec.rb +0 -12
- data/spec/models/spree/calculator/price_sack_spec.rb +0 -35
- data/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +0 -70
- data/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +0 -44
- data/spec/models/spree/calculator/shipping/flat_rate_spec.rb +0 -18
- data/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +0 -56
- data/spec/models/spree/calculator/shipping/per_item_spec.rb +0 -25
- data/spec/models/spree/calculator/shipping/price_sack_spec.rb +0 -35
- data/spec/models/spree/calculator/tiered_flat_rate_spec.rb +0 -99
- data/spec/models/spree/calculator/tiered_percent_spec.rb +0 -197
- data/spec/models/spree/calculator_spec.rb +0 -43
- data/spec/models/spree/carton_spec.rb +0 -137
- data/spec/models/spree/classification_spec.rb +0 -114
- data/spec/models/spree/concerns/display_money_spec.rb +0 -44
- data/spec/models/spree/concerns/ordered_property_value_list_spec.rb +0 -52
- data/spec/models/spree/concerns/user_address_book_spec.rb +0 -358
- data/spec/models/spree/concerns/user_methods_spec.rb +0 -121
- data/spec/models/spree/country_spec.rb +0 -154
- data/spec/models/spree/credit_card_spec.rb +0 -373
- data/spec/models/spree/customer_return_spec.rb +0 -294
- data/spec/models/spree/distributed_amounts_handler_spec.rb +0 -83
- data/spec/models/spree/exchange_spec.rb +0 -76
- data/spec/models/spree/fulfilment_changer_spec.rb +0 -340
- data/spec/models/spree/gallery/product_gallery_spec.rb +0 -21
- data/spec/models/spree/gallery/variant_gallery_spec.rb +0 -21
- data/spec/models/spree/gateway/bogus_simple.rb +0 -14
- data/spec/models/spree/gateway/bogus_spec.rb +0 -14
- data/spec/models/spree/gateway_spec.rb +0 -14
- data/spec/models/spree/image_spec.rb +0 -25
- data/spec/models/spree/inventory_unit_spec.rb +0 -309
- data/spec/models/spree/line_item_spec.rb +0 -240
- data/spec/models/spree/option_type_spec.rb +0 -16
- data/spec/models/spree/option_value_spec.rb +0 -52
- data/spec/models/spree/order/address_spec.rb +0 -52
- data/spec/models/spree/order/adjustments_spec.rb +0 -29
- data/spec/models/spree/order/callbacks_spec.rb +0 -44
- data/spec/models/spree/order/checkout_spec.rb +0 -740
- data/spec/models/spree/order/finalizing_spec.rb +0 -92
- data/spec/models/spree/order/number_generator_spec.rb +0 -47
- data/spec/models/spree/order/outstanding_balance_integration_spec.rb +0 -138
- data/spec/models/spree/order/payment_spec.rb +0 -280
- data/spec/models/spree/order/risk_assessment_spec.rb +0 -70
- data/spec/models/spree/order/state_machine_spec.rb +0 -122
- data/spec/models/spree/order/totals_spec.rb +0 -26
- data/spec/models/spree/order/updating_spec.rb +0 -18
- data/spec/models/spree/order/validations_spec.rb +0 -17
- data/spec/models/spree/order_cancellations_spec.rb +0 -233
- data/spec/models/spree/order_capturing_spec.rb +0 -16
- data/spec/models/spree/order_contents_spec.rb +0 -362
- data/spec/models/spree/order_inventory_spec.rb +0 -285
- data/spec/models/spree/order_merger_spec.rb +0 -162
- data/spec/models/spree/order_mutex_spec.rb +0 -89
- data/spec/models/spree/order_promotion_spec.rb +0 -33
- data/spec/models/spree/order_shipping_spec.rb +0 -247
- data/spec/models/spree/order_spec.rb +0 -1694
- data/spec/models/spree/order_taxation_spec.rb +0 -128
- data/spec/models/spree/order_update_attributes_spec.rb +0 -49
- data/spec/models/spree/order_updater_spec.rb +0 -555
- data/spec/models/spree/payment/cancellation_spec.rb +0 -84
- data/spec/models/spree/payment_create_spec.rb +0 -205
- data/spec/models/spree/payment_method/bogus_credit_card_spec.rb +0 -10
- data/spec/models/spree/payment_method/check_spec.rb +0 -80
- data/spec/models/spree/payment_method/credit_card_spec.rb +0 -68
- data/spec/models/spree/payment_method/simple_bogus_credit_card_spec.rb +0 -20
- data/spec/models/spree/payment_method/store_credit_spec.rb +0 -325
- data/spec/models/spree/payment_method_spec.rb +0 -408
- data/spec/models/spree/payment_spec.rb +0 -1270
- data/spec/models/spree/permission_sets/base_spec.rb +0 -14
- data/spec/models/spree/permission_sets/configuration_display.rb +0 -79
- data/spec/models/spree/permission_sets/configuration_management_spec.rb +0 -49
- data/spec/models/spree/permission_sets/dashboard_display_spec.rb +0 -23
- data/spec/models/spree/permission_sets/order_display_spec.rb +0 -56
- data/spec/models/spree/permission_sets/order_management_spec.rb +0 -43
- data/spec/models/spree/permission_sets/product_display_spec.rb +0 -57
- data/spec/models/spree/permission_sets/product_management_spec.rb +0 -39
- data/spec/models/spree/permission_sets/promotion_display_spec.rb +0 -41
- data/spec/models/spree/permission_sets/promotion_management_spec.rb +0 -29
- data/spec/models/spree/permission_sets/restricted_stock_display_spec.rb +0 -42
- data/spec/models/spree/permission_sets/restricted_stock_management_spec.rb +0 -42
- data/spec/models/spree/permission_sets/stock_display_spec.rb +0 -25
- data/spec/models/spree/permission_sets/stock_management_spec.rb +0 -23
- data/spec/models/spree/permission_sets/user_display_spec.rb +0 -39
- data/spec/models/spree/permission_sets/user_management_spec.rb +0 -56
- data/spec/models/spree/preference_spec.rb +0 -79
- data/spec/models/spree/preferences/configuration_spec.rb +0 -27
- data/spec/models/spree/preferences/preferable_spec.rb +0 -334
- data/spec/models/spree/preferences/scoped_store_spec.rb +0 -62
- data/spec/models/spree/preferences/static_model_preferences_spec.rb +0 -79
- data/spec/models/spree/preferences/statically_configurable_spec.rb +0 -67
- data/spec/models/spree/preferences/store_spec.rb +0 -40
- data/spec/models/spree/price_spec.rb +0 -150
- data/spec/models/spree/product/scopes_spec.rb +0 -164
- data/spec/models/spree/product_duplicator_spec.rb +0 -92
- data/spec/models/spree/product_filter_spec.rb +0 -28
- data/spec/models/spree/product_property_spec.rb +0 -20
- data/spec/models/spree/product_spec.rb +0 -584
- data/spec/models/spree/promotion/actions/create_adjustment_spec.rb +0 -126
- data/spec/models/spree/promotion/actions/create_item_adjustments_spec.rb +0 -198
- data/spec/models/spree/promotion/actions/create_quantity_adjustments_spec.rb +0 -298
- data/spec/models/spree/promotion/actions/free_shipping_spec.rb +0 -61
- data/spec/models/spree/promotion/rules/first_order_spec.rb +0 -87
- data/spec/models/spree/promotion/rules/first_repeat_purchase_since_spec.rb +0 -71
- data/spec/models/spree/promotion/rules/item_total_spec.rb +0 -128
- data/spec/models/spree/promotion/rules/nth_order_spec.rb +0 -72
- data/spec/models/spree/promotion/rules/one_use_per_user_spec.rb +0 -54
- data/spec/models/spree/promotion/rules/option_value_spec.rb +0 -96
- data/spec/models/spree/promotion/rules/product_spec.rb +0 -193
- data/spec/models/spree/promotion/rules/store_spec.rb +0 -35
- data/spec/models/spree/promotion/rules/taxon_spec.rb +0 -227
- data/spec/models/spree/promotion/rules/user_logged_in_spec.rb +0 -33
- data/spec/models/spree/promotion/rules/user_role_spec.rb +0 -88
- data/spec/models/spree/promotion/rules/user_spec.rb +0 -39
- data/spec/models/spree/promotion_action_spec.rb +0 -44
- data/spec/models/spree/promotion_category_spec.rb +0 -19
- data/spec/models/spree/promotion_code/batch_builder_spec.rb +0 -107
- data/spec/models/spree/promotion_code_batch_spec.rb +0 -54
- data/spec/models/spree/promotion_code_spec.rb +0 -206
- data/spec/models/spree/promotion_handler/cart_spec.rb +0 -132
- data/spec/models/spree/promotion_handler/coupon_spec.rb +0 -419
- data/spec/models/spree/promotion_handler/page_spec.rb +0 -45
- data/spec/models/spree/promotion_handler/shipping_spec.rb +0 -96
- data/spec/models/spree/promotion_rule_spec.rb +0 -34
- data/spec/models/spree/promotion_spec.rb +0 -928
- data/spec/models/spree/refund_spec.rb +0 -200
- data/spec/models/spree/reimbursement/credit_spec.rb +0 -38
- data/spec/models/spree/reimbursement/reimbursement_type_engine_spec.rb +0 -144
- data/spec/models/spree/reimbursement/reimbursement_type_validator_spec.rb +0 -85
- data/spec/models/spree/reimbursement_performer_spec.rb +0 -33
- data/spec/models/spree/reimbursement_spec.rb +0 -278
- data/spec/models/spree/reimbursement_tax_calculator_spec.rb +0 -52
- data/spec/models/spree/reimbursement_type/credit_spec.rb +0 -56
- data/spec/models/spree/reimbursement_type/exchange_spec.rb +0 -48
- data/spec/models/spree/reimbursement_type/original_payment_spec.rb +0 -110
- data/spec/models/spree/reimbursement_type/store_credit_spec.rb +0 -111
- data/spec/models/spree/return_authorization_spec.rb +0 -226
- data/spec/models/spree/return_item/eligibility_validator/default_spec.rb +0 -79
- data/spec/models/spree/return_item/eligibility_validator/inventory_shipped_spec.rb +0 -59
- data/spec/models/spree/return_item/eligibility_validator/no_reimbursements_spec.rb +0 -86
- data/spec/models/spree/return_item/eligibility_validator/order_completed_spec.rb +0 -35
- data/spec/models/spree/return_item/eligibility_validator/rma_required_spec.rb +0 -31
- data/spec/models/spree/return_item/eligibility_validator/time_since_purchase_spec.rb +0 -42
- data/spec/models/spree/return_item/exchange_variant_eligibility/same_option_value_spec.rb +0 -66
- data/spec/models/spree/return_item/exchange_variant_eligibility/same_product_spec.rb +0 -43
- data/spec/models/spree/return_item_spec.rb +0 -785
- data/spec/models/spree/returns_calculator_spec.rb +0 -16
- data/spec/models/spree/shipment_spec.rb +0 -914
- data/spec/models/spree/shipping_calculator_spec.rb +0 -57
- data/spec/models/spree/shipping_manifest_spec.rb +0 -110
- data/spec/models/spree/shipping_method_spec.rb +0 -260
- data/spec/models/spree/shipping_rate_spec.rb +0 -154
- data/spec/models/spree/shipping_rate_tax_spec.rb +0 -79
- data/spec/models/spree/state_spec.rb +0 -43
- data/spec/models/spree/stock/allocator/on_hand_first_spec.rb +0 -146
- data/spec/models/spree/stock/availability_spec.rb +0 -143
- data/spec/models/spree/stock/availability_validator_spec.rb +0 -140
- data/spec/models/spree/stock/content_item_spec.rb +0 -70
- data/spec/models/spree/stock/differentiator_spec.rb +0 -41
- data/spec/models/spree/stock/estimator_spec.rb +0 -241
- data/spec/models/spree/stock/inventory_unit_builder_spec.rb +0 -34
- data/spec/models/spree/stock/inventory_units_finalizer_spec.rb +0 -58
- data/spec/models/spree/stock/location_filter/active_spec.rb +0 -22
- data/spec/models/spree/stock/location_sorter/default_first_spec.rb +0 -22
- data/spec/models/spree/stock/location_sorter/unsorted_spec.rb +0 -21
- data/spec/models/spree/stock/package_spec.rb +0 -182
- data/spec/models/spree/stock/quantifier_spec.rb +0 -113
- data/spec/models/spree/stock/shipping_rate_selector_spec.rb +0 -18
- data/spec/models/spree/stock/shipping_rate_sorter_spec.rb +0 -18
- data/spec/models/spree/stock/simple_coordinator_spec.rb +0 -264
- data/spec/models/spree/stock/splitter/backordered_spec.rb +0 -31
- data/spec/models/spree/stock/splitter/base_spec.rb +0 -22
- data/spec/models/spree/stock/splitter/shipping_category_spec.rb +0 -48
- data/spec/models/spree/stock/splitter/weight_spec.rb +0 -31
- data/spec/models/spree/stock/splitter_chain_spec.rb +0 -66
- data/spec/models/spree/stock_item_spec.rb +0 -348
- data/spec/models/spree/stock_location_spec.rb +0 -288
- data/spec/models/spree/stock_movement_spec.rb +0 -58
- data/spec/models/spree/stock_quantities_spec.rb +0 -249
- data/spec/models/spree/store_credit_category_spec.rb +0 -19
- data/spec/models/spree/store_credit_event_spec.rb +0 -328
- data/spec/models/spree/store_credit_spec.rb +0 -900
- data/spec/models/spree/store_selector/by_server_name_spec.rb +0 -28
- data/spec/models/spree/store_selector/legacy_spec.rb +0 -46
- data/spec/models/spree/store_spec.rb +0 -156
- data/spec/models/spree/tax/order_adjuster_spec.rb +0 -35
- data/spec/models/spree/tax/shipping_rate_taxer_spec.rb +0 -59
- data/spec/models/spree/tax/tax_location_spec.rb +0 -79
- data/spec/models/spree/tax/taxation_integration_spec.rb +0 -815
- data/spec/models/spree/tax_calculator/default_spec.rb +0 -56
- data/spec/models/spree/tax_category_spec.rb +0 -50
- data/spec/models/spree/tax_rate_spec.rb +0 -316
- data/spec/models/spree/taxon_spec.rb +0 -197
- data/spec/models/spree/taxonomy_spec.rb +0 -15
- data/spec/models/spree/unit_cancel_spec.rb +0 -121
- data/spec/models/spree/user_spec.rb +0 -247
- data/spec/models/spree/validations/db_maximum_length_validator_spec.rb +0 -33
- data/spec/models/spree/variant/price_selector_spec.rb +0 -90
- data/spec/models/spree/variant/pricing_options_spec.rb +0 -204
- data/spec/models/spree/variant/scopes_spec.rb +0 -94
- data/spec/models/spree/variant/vat_price_generator_spec.rb +0 -77
- data/spec/models/spree/variant_property_rule_condition_spec.rb +0 -17
- data/spec/models/spree/variant_property_rule_spec.rb +0 -85
- data/spec/models/spree/variant_property_rule_value_spec.rb +0 -20
- data/spec/models/spree/variant_spec.rb +0 -862
- data/spec/models/spree/wallet_payment_source_spec.rb +0 -77
- data/spec/models/spree/wallet_spec.rb +0 -155
- data/spec/models/spree/zone_spec.rb +0 -248
- data/spec/rails_helper.rb +0 -46
- data/spec/shared_examples/calculator_shared_examples.rb +0 -10
- data/spec/spec_helper.rb +0 -36
- data/spec/support/big_decimal.rb +0 -7
- data/spec/support/concerns/default_price.rb +0 -44
- data/spec/support/concerns/payment_source.rb +0 -66
- data/spec/support/concerns/working_factories.rb +0 -15
- data/spec/support/dummy_ability.rb +0 -7
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Spree
|
|
4
|
+
# This service object is responsible for storing the current path into
|
|
5
|
+
# into `session[:spree_user_return_to]` for redirects after successful
|
|
6
|
+
# user/admin authentication.
|
|
7
|
+
class UserLastUrlStorer
|
|
8
|
+
# Lists all the rules that will be evaluated before storing the
|
|
9
|
+
# current path value into the session.
|
|
10
|
+
#
|
|
11
|
+
# @return [Spree::Core::ClassConstantizer::Set] a set of rules
|
|
12
|
+
# that, when matched, will prevent session[:spree_user_return_to]
|
|
13
|
+
# to be set
|
|
14
|
+
#
|
|
15
|
+
# @example This method can be used also to add more rules
|
|
16
|
+
# Spree::UserLastUrlStorer.rules << 'CustomRule'
|
|
17
|
+
#
|
|
18
|
+
# @example it can be used also for removing unwanted rules
|
|
19
|
+
# Spree::UserLastUrlStorer.rules.delete('CustomRule')
|
|
20
|
+
#
|
|
21
|
+
def self.rules
|
|
22
|
+
Spree::Config.user_last_url_storer_rules
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @param controller [ApplicationController] an instance of ApplicationController
|
|
26
|
+
# or its subclasses. The controller will be passed to each rule for matching.
|
|
27
|
+
def initialize(controller)
|
|
28
|
+
@controller = controller
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Stores into session[:spree_user_return_to] the request full path for
|
|
32
|
+
# future redirects (to be used after successful authentication). When
|
|
33
|
+
# there is a rule match then the request full path is not stored.
|
|
34
|
+
def store_location
|
|
35
|
+
return if self.class.rules.any? { |rule| rule.match? controller }
|
|
36
|
+
|
|
37
|
+
session[:spree_user_return_to] = request.fullpath.gsub('//', '/')
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
attr_reader :controller
|
|
43
|
+
|
|
44
|
+
delegate :session, :request, to: :controller
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Spree
|
|
4
|
+
class UserLastUrlStorer
|
|
5
|
+
module Rules
|
|
6
|
+
# This is the basic rule that ships with Solidus that avoids storing in
|
|
7
|
+
# session the current path for login/loout/signup routes, avoiding possibly
|
|
8
|
+
# infinte redirects.
|
|
9
|
+
module AuthenticationRule
|
|
10
|
+
AUTHENTICATION_ROUTES = %w[spree_signup_path spree_login_path spree_logout_path]
|
|
11
|
+
|
|
12
|
+
extend self
|
|
13
|
+
|
|
14
|
+
def match?(controller)
|
|
15
|
+
full_path = controller.request.fullpath
|
|
16
|
+
disallowed_urls(controller).include?(full_path)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def disallowed_urls(controller)
|
|
22
|
+
@disallowed_urls ||= {}
|
|
23
|
+
@disallowed_urls[controller.controller_name] ||= begin
|
|
24
|
+
[].tap do |disallowed_urls|
|
|
25
|
+
AUTHENTICATION_ROUTES.each do |route|
|
|
26
|
+
if controller.respond_to?(route)
|
|
27
|
+
disallowed_urls << controller.send(route)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end.map! { |url| url[/\/\w+$/] }
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Spree
|
|
4
4
|
class UserStockLocation < Spree::Base
|
|
5
|
-
belongs_to :user, class_name: Spree::UserClassHandle.new, inverse_of: :user_stock_locations
|
|
6
|
-
belongs_to :stock_location, class_name: "Spree::StockLocation", inverse_of: :user_stock_locations
|
|
5
|
+
belongs_to :user, class_name: Spree::UserClassHandle.new, inverse_of: :user_stock_locations, optional: true
|
|
6
|
+
belongs_to :stock_location, class_name: "Spree::StockLocation", inverse_of: :user_stock_locations, optional: true
|
|
7
7
|
end
|
|
8
8
|
end
|
data/app/models/spree/variant.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'discard'
|
|
4
|
-
|
|
5
3
|
module Spree
|
|
6
4
|
# == Master Variant
|
|
7
5
|
#
|
|
@@ -20,11 +18,7 @@ module Spree
|
|
|
20
18
|
class Variant < Spree::Base
|
|
21
19
|
acts_as_list scope: :product
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
include Spree::ParanoiaDeprecations
|
|
25
|
-
|
|
26
|
-
include Discard::Model
|
|
27
|
-
self.discard_column = :deleted_at
|
|
21
|
+
include Spree::SoftDeletable
|
|
28
22
|
|
|
29
23
|
after_discard do
|
|
30
24
|
stock_items.discard_all
|
|
@@ -36,11 +30,11 @@ module Spree
|
|
|
36
30
|
attr_writer :rebuild_vat_prices
|
|
37
31
|
include Spree::DefaultPrice
|
|
38
32
|
|
|
39
|
-
belongs_to :product, -> {
|
|
40
|
-
belongs_to :tax_category, class_name: 'Spree::TaxCategory'
|
|
33
|
+
belongs_to :product, -> { with_discarded }, touch: true, class_name: 'Spree::Product', inverse_of: :variants, optional: false
|
|
34
|
+
belongs_to :tax_category, class_name: 'Spree::TaxCategory', optional: true
|
|
41
35
|
|
|
42
|
-
delegate :name, :description, :slug, :available_on, :
|
|
43
|
-
:meta_description, :meta_keywords, :shipping_category,
|
|
36
|
+
delegate :name, :description, :slug, :available_on, :discontinue_on, :discontinued?,
|
|
37
|
+
:shipping_category_id, :meta_description, :meta_keywords, :shipping_category,
|
|
44
38
|
to: :product
|
|
45
39
|
delegate :tax_category, to: :product, prefix: true
|
|
46
40
|
delegate :tax_rates, to: :tax_category
|
|
@@ -80,7 +74,7 @@ module Spree
|
|
|
80
74
|
|
|
81
75
|
validates :cost_price, numericality: { greater_than_or_equal_to: 0, allow_nil: true }
|
|
82
76
|
validates :price, numericality: { greater_than_or_equal_to: 0, allow_nil: true }
|
|
83
|
-
validates_uniqueness_of :sku, allow_blank: true, if: :enforce_unique_sku?
|
|
77
|
+
validates_uniqueness_of :sku, allow_blank: true, case_sensitive: true, if: :enforce_unique_sku?
|
|
84
78
|
|
|
85
79
|
after_create :create_stock_items
|
|
86
80
|
after_create :set_position
|
|
@@ -250,12 +244,12 @@ module Spree
|
|
|
250
244
|
# no option values on master
|
|
251
245
|
return if is_master
|
|
252
246
|
|
|
253
|
-
option_type = Spree::OptionType.where(name: opt_name).first_or_initialize do |
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
option_type = Spree::OptionType.where(name: opt_name).first_or_initialize do |option|
|
|
248
|
+
option.presentation = opt_name
|
|
249
|
+
option.save!
|
|
256
250
|
end
|
|
257
251
|
|
|
258
|
-
current_value = option_values.detect { |
|
|
252
|
+
current_value = option_values.detect { |option| option.option_type.name == opt_name }
|
|
259
253
|
|
|
260
254
|
if current_value
|
|
261
255
|
return if current_value.name == opt_value
|
|
@@ -267,9 +261,9 @@ module Spree
|
|
|
267
261
|
end
|
|
268
262
|
end
|
|
269
263
|
|
|
270
|
-
option_value = Spree::OptionValue.where(option_type_id: option_type.id, name: opt_value).first_or_initialize do |
|
|
271
|
-
|
|
272
|
-
|
|
264
|
+
option_value = Spree::OptionValue.where(option_type_id: option_type.id, name: opt_value).first_or_initialize do |option|
|
|
265
|
+
option.presentation = opt_value
|
|
266
|
+
option.save!
|
|
273
267
|
end
|
|
274
268
|
|
|
275
269
|
option_values << option_value
|
|
@@ -281,7 +275,7 @@ module Spree
|
|
|
281
275
|
# @param opt_name [String] the name of the option whose value you want
|
|
282
276
|
# @return [String] the option value
|
|
283
277
|
def option_value(opt_name)
|
|
284
|
-
option_values.detect { |
|
|
278
|
+
option_values.detect { |option| option.option_type.name == opt_name }.try(:presentation)
|
|
285
279
|
end
|
|
286
280
|
|
|
287
281
|
# Returns an instance of the globally configured variant price selector class for this variant.
|
|
@@ -391,9 +385,9 @@ module Spree
|
|
|
391
385
|
#
|
|
392
386
|
# @return [Array<Spree::VariantPropertyRuleValue>] variant_properties
|
|
393
387
|
def variant_properties
|
|
394
|
-
product.variant_property_rules.
|
|
388
|
+
product.variant_property_rules.flat_map do |rule|
|
|
395
389
|
rule.values if rule.applies_to_variant?(self)
|
|
396
|
-
end.
|
|
390
|
+
end.compact
|
|
397
391
|
end
|
|
398
392
|
|
|
399
393
|
# The gallery for the variant, which represents all the images
|
|
@@ -439,7 +433,7 @@ module Spree
|
|
|
439
433
|
end
|
|
440
434
|
|
|
441
435
|
def build_vat_prices
|
|
442
|
-
|
|
436
|
+
Spree::Config.variant_vat_prices_generator_class.new(self).run
|
|
443
437
|
end
|
|
444
438
|
|
|
445
439
|
def set_position
|
|
@@ -2,41 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
module Spree
|
|
4
4
|
class Variant < Spree::Base
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
module Scopes
|
|
6
|
+
def self.prepended(base)
|
|
7
|
+
base.class_eval do
|
|
8
|
+
# FIXME: WARNING tested only under sqlite and postgresql
|
|
9
|
+
scope :descend_by_popularity, -> {
|
|
10
|
+
order(Arel.sql("COALESCE((SELECT COUNT(*) FROM #{Spree::LineItem.quoted_table_name} GROUP BY #{Spree::LineItem.quoted_table_name}.variant_id HAVING #{Spree::LineItem.quoted_table_name}.variant_id = #{Spree::Variant.quoted_table_name}.id), 0) DESC"))
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class << self
|
|
14
|
+
# Returns variants that match a given option value
|
|
15
|
+
#
|
|
16
|
+
# Example:
|
|
17
|
+
#
|
|
18
|
+
# product.variants_including_master.has_option(OptionType.find_by(name: 'shoe-size'), OptionValue.find_by(name: '8'))
|
|
19
|
+
def has_option(option_type, *option_values)
|
|
20
|
+
option_types = Spree::OptionType.table_name
|
|
21
|
+
|
|
22
|
+
option_type_conditions = case option_type
|
|
23
|
+
when OptionType then { "#{option_types}.name" => option_type.name }
|
|
24
|
+
when String then { "#{option_types}.name" => option_type }
|
|
25
|
+
else { "#{option_types}.id" => option_type }
|
|
26
|
+
end
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
relation = joins(option_values: :option_type).where(option_type_conditions)
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
option_values.each do |option_value|
|
|
31
|
+
option_value_conditions = case option_value
|
|
32
|
+
when OptionValue then { "#{Spree::OptionValue.table_name}.name" => option_value.name }
|
|
33
|
+
when String then { "#{Spree::OptionValue.table_name}.name" => option_value }
|
|
34
|
+
else { "#{Spree::OptionValue.table_name}.id" => option_value }
|
|
35
|
+
end
|
|
36
|
+
relation = relation.where(option_value_conditions)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
relation
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
alias_method :has_options, :has_option
|
|
32
43
|
end
|
|
33
|
-
relation = relation.where(option_value_conditions)
|
|
34
44
|
end
|
|
35
|
-
|
|
36
|
-
relation
|
|
37
45
|
end
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
::Spree::Variant.prepend self
|
|
40
48
|
end
|
|
41
49
|
end
|
|
42
50
|
end
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# targeted by the rule, the properties will automatically apply to the variant.
|
|
14
14
|
module Spree
|
|
15
15
|
class VariantPropertyRule < Spree::Base
|
|
16
|
-
belongs_to :product, touch: true
|
|
16
|
+
belongs_to :product, touch: true, optional: true
|
|
17
17
|
|
|
18
18
|
has_many :values, class_name: 'Spree::VariantPropertyRuleValue', dependent: :destroy
|
|
19
19
|
has_many :properties, through: :values
|
|
@@ -38,7 +38,11 @@ module Spree
|
|
|
38
38
|
# @param variant [Spree::Variant] variant to check
|
|
39
39
|
# @return [Boolean]
|
|
40
40
|
def applies_to_variant?(variant)
|
|
41
|
-
|
|
41
|
+
if apply_to_all
|
|
42
|
+
matches_option_value_ids?(variant.option_value_ids)
|
|
43
|
+
else
|
|
44
|
+
(option_value_ids & variant.option_value_ids).present?
|
|
45
|
+
end
|
|
42
46
|
end
|
|
43
47
|
end
|
|
44
48
|
end
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Spree
|
|
4
4
|
class VariantPropertyRuleCondition < Spree::Base
|
|
5
|
-
belongs_to :option_value
|
|
6
|
-
belongs_to :variant_property_rule, touch: true
|
|
5
|
+
belongs_to :option_value, optional: true
|
|
6
|
+
belongs_to :variant_property_rule, touch: true, optional: true
|
|
7
7
|
|
|
8
8
|
validates_uniqueness_of :option_value_id, scope: :variant_property_rule_id
|
|
9
9
|
end
|
|
@@ -19,21 +19,26 @@ class Spree::Wallet::AddPaymentSourcesToWallet
|
|
|
19
19
|
sources = payments.map(&:source).
|
|
20
20
|
uniq.
|
|
21
21
|
compact.
|
|
22
|
-
select { |
|
|
22
|
+
select { |payment| payment.try(:reusable?) }
|
|
23
23
|
|
|
24
24
|
# add valid sources to wallet and optionally set a default
|
|
25
25
|
if sources.any?
|
|
26
26
|
# arbitrarily sort by id for picking a default
|
|
27
|
-
|
|
27
|
+
sources.sort_by(&:id).each do |source|
|
|
28
28
|
order.user.wallet.add(source)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
wallet_payment_sources.last
|
|
31
|
+
make_default
|
|
33
32
|
end
|
|
34
33
|
end
|
|
35
34
|
end
|
|
36
35
|
|
|
36
|
+
protected
|
|
37
|
+
|
|
38
|
+
def make_default
|
|
39
|
+
order.user.wallet.default_wallet_payment_source = order.user.wallet_payment_sources.last
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
private
|
|
38
43
|
|
|
39
44
|
attr_reader :order
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Spree
|
|
4
4
|
class WalletPaymentSource < Spree::Base
|
|
5
|
-
belongs_to :user, class_name: Spree::UserClassHandle.new, foreign_key: 'user_id', inverse_of: :wallet_payment_sources
|
|
6
|
-
belongs_to :payment_source, polymorphic: true, inverse_of: :wallet_payment_sources
|
|
5
|
+
belongs_to :user, class_name: Spree::UserClassHandle.new, foreign_key: 'user_id', inverse_of: :wallet_payment_sources, optional: true
|
|
6
|
+
belongs_to :payment_source, polymorphic: true, inverse_of: :wallet_payment_sources, optional: true
|
|
7
7
|
|
|
8
8
|
validates_presence_of :user
|
|
9
9
|
validates_presence_of :payment_source
|
data/app/models/spree/zone.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Spree
|
|
|
13
13
|
has_many :shipping_method_zones, dependent: :destroy
|
|
14
14
|
has_many :shipping_methods, through: :shipping_method_zones
|
|
15
15
|
|
|
16
|
-
validates :name, presence: true, uniqueness: { allow_blank: true }
|
|
16
|
+
validates :name, presence: true, uniqueness: { allow_blank: true, case_sensitive: true }
|
|
17
17
|
after_save :remove_defunct_members
|
|
18
18
|
|
|
19
19
|
scope :with_member_ids, ->(state_ids, country_ids) do
|
|
@@ -40,7 +40,7 @@ module Spree
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
alias :members :zone_members
|
|
43
|
-
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |
|
|
43
|
+
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |member| member['zoneable_id'].blank? }
|
|
44
44
|
|
|
45
45
|
self.whitelisted_ransackable_attributes = %w[name description]
|
|
46
46
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Spree
|
|
4
4
|
class ZoneMember < Spree::Base
|
|
5
|
-
belongs_to :zone, class_name: 'Spree::Zone', counter_cache: true, inverse_of: :zone_members
|
|
6
|
-
belongs_to :zoneable, polymorphic: true
|
|
5
|
+
belongs_to :zone, class_name: 'Spree::Zone', counter_cache: true, inverse_of: :zone_members, optional: true
|
|
6
|
+
belongs_to :zoneable, polymorphic: true, optional: true
|
|
7
7
|
|
|
8
8
|
delegate :name, to: :zoneable, allow_nil: true
|
|
9
9
|
end
|
data/config/locales/en.yml
CHANGED
|
@@ -28,6 +28,7 @@ en:
|
|
|
28
28
|
company: Company
|
|
29
29
|
firstname: First Name
|
|
30
30
|
lastname: Last Name
|
|
31
|
+
name: Name
|
|
31
32
|
phone: Phone
|
|
32
33
|
zipcode: Zip Code
|
|
33
34
|
spree/adjustment:
|
|
@@ -115,7 +116,7 @@ en:
|
|
|
115
116
|
considered_risky: Risky
|
|
116
117
|
coupon_code: Coupon Code
|
|
117
118
|
created_at: Order Date
|
|
118
|
-
email: Customer
|
|
119
|
+
email: Customer Email
|
|
119
120
|
included_tax_total: Tax (incl.)
|
|
120
121
|
ip_address: IP Address
|
|
121
122
|
item_total: Item Total
|
|
@@ -131,6 +132,7 @@ en:
|
|
|
131
132
|
city: Billing address city
|
|
132
133
|
firstname: Billing address first name
|
|
133
134
|
lastname: Billing address last name
|
|
135
|
+
name: Billing address name
|
|
134
136
|
phone: Billing address phone
|
|
135
137
|
state: Billing address state
|
|
136
138
|
zipcode: Billing address zipcode
|
|
@@ -139,6 +141,7 @@ en:
|
|
|
139
141
|
city: Shipping address city
|
|
140
142
|
firstname: Shipping address first name
|
|
141
143
|
lastname: Shipping address last name
|
|
144
|
+
name: Shipping address name
|
|
142
145
|
phone: Shipping address phone
|
|
143
146
|
state: Shipping address state
|
|
144
147
|
zipcode: Shipping address zipcode
|
|
@@ -163,14 +166,18 @@ en:
|
|
|
163
166
|
type: Type
|
|
164
167
|
spree/price:
|
|
165
168
|
amount: Price
|
|
169
|
+
country: Country
|
|
166
170
|
currency: Currency
|
|
167
171
|
is_default: Currently Valid
|
|
172
|
+
price: Price
|
|
173
|
+
variant: Variant
|
|
168
174
|
spree/product:
|
|
169
175
|
available_on: Available On
|
|
170
176
|
cost_currency: Cost Currency
|
|
171
177
|
cost_price: Cost Price
|
|
172
178
|
depth: Depth
|
|
173
179
|
description: Description
|
|
180
|
+
discontinue_on: Discontinue on
|
|
174
181
|
height: Height
|
|
175
182
|
master_price: Master Price
|
|
176
183
|
meta_description: Meta Description
|
|
@@ -200,6 +207,7 @@ en:
|
|
|
200
207
|
starts_at: Start
|
|
201
208
|
status: Status
|
|
202
209
|
usage_limit: Usage Limit
|
|
210
|
+
uses: Uses
|
|
203
211
|
spree/promotion/actions/create_adjustment:
|
|
204
212
|
description: Creates a promotion credit adjustment on the order
|
|
205
213
|
spree/promotion/actions/create_item_adjustments:
|
|
@@ -238,7 +246,17 @@ en:
|
|
|
238
246
|
spree/promotion/rules/user_role:
|
|
239
247
|
description: Order includes User with specified Role(s)
|
|
240
248
|
spree/promotion_category:
|
|
249
|
+
code: Code
|
|
241
250
|
name: Name
|
|
251
|
+
spree/promotion_code:
|
|
252
|
+
value: Value
|
|
253
|
+
spree/promotion_code_batch:
|
|
254
|
+
base_code: Base code
|
|
255
|
+
email: Email
|
|
256
|
+
join_characters: Join characters
|
|
257
|
+
number_of_codes: Number of codes
|
|
258
|
+
status: Status
|
|
259
|
+
total_codes: Total codes
|
|
242
260
|
spree/property:
|
|
243
261
|
name: Name
|
|
244
262
|
presentation: Presentation
|
|
@@ -250,6 +268,7 @@ en:
|
|
|
250
268
|
active: Active
|
|
251
269
|
code: Code
|
|
252
270
|
name: Name
|
|
271
|
+
state: State
|
|
253
272
|
spree/reimbursement:
|
|
254
273
|
created_at: Date/Time
|
|
255
274
|
number: Number
|
|
@@ -294,12 +313,15 @@ en:
|
|
|
294
313
|
name: Name
|
|
295
314
|
spree/shipping_method:
|
|
296
315
|
admin_name: Internal Name
|
|
316
|
+
available_to_users: Available to users
|
|
297
317
|
carrier: Carrier
|
|
298
318
|
code: Code
|
|
299
319
|
display_on: Display
|
|
300
320
|
name: Name
|
|
301
321
|
service_level: Service Level
|
|
302
322
|
tracking_url: Tracking URL
|
|
323
|
+
stock_locations: Stock Locations
|
|
324
|
+
available_to_all: Available to all stock locations
|
|
303
325
|
spree/shipping_rate:
|
|
304
326
|
amount: Amount
|
|
305
327
|
label: Label
|
|
@@ -326,6 +348,7 @@ en:
|
|
|
326
348
|
phone: Phone
|
|
327
349
|
propagate_all_variants: Propagate All Variants
|
|
328
350
|
restock_inventory: Restock Inventory
|
|
351
|
+
state: State
|
|
329
352
|
state_id: State
|
|
330
353
|
zipcode: Zip
|
|
331
354
|
spree/stock_movement:
|
|
@@ -339,6 +362,7 @@ en:
|
|
|
339
362
|
default: Default
|
|
340
363
|
default_currency: Default Currency
|
|
341
364
|
mail_from_address: Mail From Address
|
|
365
|
+
bcc_email: BCC Email
|
|
342
366
|
meta_description: Meta Description
|
|
343
367
|
meta_keywords: Meta Keywords
|
|
344
368
|
name: Site Name
|
|
@@ -358,6 +382,9 @@ en:
|
|
|
358
382
|
action: Action
|
|
359
383
|
amount_remaining: Total Unused
|
|
360
384
|
user_total_amount: Total Amount
|
|
385
|
+
spree/store_credit_reason:
|
|
386
|
+
name: Name
|
|
387
|
+
state: State
|
|
361
388
|
spree/store_credit_update_reason:
|
|
362
389
|
name: Name
|
|
363
390
|
spree/tax_category:
|
|
@@ -372,6 +399,7 @@ en:
|
|
|
372
399
|
name: Name
|
|
373
400
|
show_rate_in_label: Show Rate in Label
|
|
374
401
|
starts_at: Start Date
|
|
402
|
+
tax_categories: Tax Categories
|
|
375
403
|
spree/taxon:
|
|
376
404
|
description: Description
|
|
377
405
|
icon: Icon
|
|
@@ -447,6 +475,7 @@ en:
|
|
|
447
475
|
attributes:
|
|
448
476
|
price:
|
|
449
477
|
not_a_number: is not valid
|
|
478
|
+
does_not_match_order_currency: Line item price currency must match order currency!
|
|
450
479
|
spree/price:
|
|
451
480
|
attributes:
|
|
452
481
|
currency:
|
|
@@ -454,8 +483,11 @@ en:
|
|
|
454
483
|
spree/promotion:
|
|
455
484
|
attributes:
|
|
456
485
|
apply_automatically:
|
|
457
|
-
disallowed_with_code: Disallowed for promotions with a code
|
|
458
486
|
disallowed_with_path: Disallowed for promotions with a path
|
|
487
|
+
spree/promotion_code:
|
|
488
|
+
attributes:
|
|
489
|
+
base:
|
|
490
|
+
disallowed_with_apply_automatically: Could not create promotion code on promotion that apply automatically
|
|
459
491
|
spree/refund:
|
|
460
492
|
attributes:
|
|
461
493
|
amount:
|
|
@@ -667,7 +699,7 @@ en:
|
|
|
667
699
|
one: RMA Reason
|
|
668
700
|
other: RMA Reasons
|
|
669
701
|
spree/role:
|
|
670
|
-
one:
|
|
702
|
+
one: Role
|
|
671
703
|
other: Roles
|
|
672
704
|
spree/shipment:
|
|
673
705
|
one: Shipment
|
|
@@ -762,6 +794,7 @@ en:
|
|
|
762
794
|
refund: Refund
|
|
763
795
|
remove: Remove
|
|
764
796
|
save: Save
|
|
797
|
+
send_email: Send Email
|
|
765
798
|
ship: Ship
|
|
766
799
|
split: Split
|
|
767
800
|
update: Update
|
|
@@ -778,6 +811,8 @@ en:
|
|
|
778
811
|
add_option_value: Add Option Value
|
|
779
812
|
add_product: Add Product
|
|
780
813
|
add_product_properties: Add Product Properties
|
|
814
|
+
add_variant_properties: Add Variant Properties
|
|
815
|
+
applies_to_all_variant_properties: Applies to all Variant Properties above
|
|
781
816
|
add_rule_of_type: Add rule of type
|
|
782
817
|
add_state: Add State
|
|
783
818
|
add_stock: Add Stock
|
|
@@ -819,6 +854,11 @@ en:
|
|
|
819
854
|
drag_and_drop: or drag and drop them here
|
|
820
855
|
image_process_failed: Server failed to process the image
|
|
821
856
|
upload_images: Upload Images
|
|
857
|
+
order:
|
|
858
|
+
events:
|
|
859
|
+
approve: Approve
|
|
860
|
+
cancel: Cancel
|
|
861
|
+
resume: Resume
|
|
822
862
|
payments:
|
|
823
863
|
source_forms:
|
|
824
864
|
storecredit:
|
|
@@ -855,6 +895,9 @@ en:
|
|
|
855
895
|
expired: Expired
|
|
856
896
|
inactive: Inactive
|
|
857
897
|
not_started: Not started
|
|
898
|
+
shipping_methods:
|
|
899
|
+
form:
|
|
900
|
+
stock_locations_placeholder: 'Choose stock locations'
|
|
858
901
|
stock_locations:
|
|
859
902
|
form:
|
|
860
903
|
address: Address
|
|
@@ -1065,6 +1108,7 @@ en:
|
|
|
1065
1108
|
cannot_create_payment_without_payment_methods_html: You cannot create a payment
|
|
1066
1109
|
for an order without any payment methods defined. %{link}
|
|
1067
1110
|
cannot_create_returns: Cannot create returns as this order has no shipped units.
|
|
1111
|
+
cannot_edit_orders: You may only edit your current shopping cart.
|
|
1068
1112
|
cannot_perform_operation: Cannot perform requested operation
|
|
1069
1113
|
cannot_rebuild_shipments_order_completed: Cannot rebuild shipments for a completed
|
|
1070
1114
|
order.
|
|
@@ -1350,6 +1394,14 @@ en:
|
|
|
1350
1394
|
hidden: hidden
|
|
1351
1395
|
hide_out_of_stock: Hide out of stock
|
|
1352
1396
|
hints:
|
|
1397
|
+
spree/calculator:
|
|
1398
|
+
tax_rates: This is used to calculate both sales tax (United States-style taxes)
|
|
1399
|
+
and value-added tax (VAT). Typically this calculator should be the only tax
|
|
1400
|
+
calculator required by your store.
|
|
1401
|
+
shipping_methods: This is used to calculate the shipping rates on a per order or
|
|
1402
|
+
per package rate.
|
|
1403
|
+
promotions: This is used to determine the promotional discount to be applied to an
|
|
1404
|
+
order, an item, or shipping charges.
|
|
1353
1405
|
spree/price:
|
|
1354
1406
|
country: 'This determines in what country the price is valid.<br/>Default:
|
|
1355
1407
|
Any Country'
|
|
@@ -1361,17 +1413,25 @@ en:
|
|
|
1361
1413
|
available_on: This sets the availability date for the product. If this value
|
|
1362
1414
|
is not set, or it is set to a date in the future, then the product is not
|
|
1363
1415
|
available on the storefront.
|
|
1416
|
+
discontinue_on: This sets the discontinue date for the product. If this value
|
|
1417
|
+
is set to a date, then the product is not available on the storefront from
|
|
1418
|
+
that day on anymore.
|
|
1364
1419
|
promotionable: 'This determines whether or not promotions can apply to this
|
|
1365
1420
|
product.<br/>Default: Checked'
|
|
1366
1421
|
shipping_category: 'This determines what kind of shipping this product requires.<br/>
|
|
1367
1422
|
Default: Default'
|
|
1368
1423
|
tax_category: 'This determines what kind of taxation is applied to this product.<br/>
|
|
1369
|
-
Default:
|
|
1424
|
+
Default: %{default_tax_category}'
|
|
1370
1425
|
spree/promotion:
|
|
1371
1426
|
expires_at: This determines when the promotion expires. <br/> If no value
|
|
1372
1427
|
is specified, the promotion will never expire.
|
|
1373
1428
|
starts_at: This determines when the promotion can be applied to orders. <br/>
|
|
1374
1429
|
If no value is specified, the promotion will be immediately available.
|
|
1430
|
+
promo_code_will_be_disabled: Selecting this option, promo codes will be disabled for this promotion
|
|
1431
|
+
because all its rules / actions will be applied automatically to all orders.
|
|
1432
|
+
spree/shipping_method:
|
|
1433
|
+
available_to_all: Uncheck to select specific stock locations this
|
|
1434
|
+
shipping method will be available in.
|
|
1375
1435
|
spree/stock_location:
|
|
1376
1436
|
active: 'This determines whether stock from this location can be used when
|
|
1377
1437
|
building packages.<br/> Default: Checked'
|
|
@@ -1393,6 +1453,8 @@ en:
|
|
|
1393
1453
|
(orders which don't yet have an address).<br/> Default: None."
|
|
1394
1454
|
code: 'An identifier for your store. Developers may need this value if you operate
|
|
1395
1455
|
multiple storefronts.'
|
|
1456
|
+
spree/tax_category:
|
|
1457
|
+
is_default: 'When checked, this tax category will be selected by default when creating new products or variants.'
|
|
1396
1458
|
spree/tax_rate:
|
|
1397
1459
|
validity_period: This determines the validity period within which the tax
|
|
1398
1460
|
rate is valid and will be applied to eligible items. <br /> If no start
|
|
@@ -1466,6 +1528,11 @@ en:
|
|
|
1466
1528
|
iso_name: Iso Name
|
|
1467
1529
|
item: Item
|
|
1468
1530
|
item_description: Item Description
|
|
1531
|
+
items_selected:
|
|
1532
|
+
all: All Items Selected
|
|
1533
|
+
none: No Item Selected
|
|
1534
|
+
one: One Item Selected
|
|
1535
|
+
custom: Items Selected
|
|
1469
1536
|
item_total: Item Total
|
|
1470
1537
|
item_total_rule:
|
|
1471
1538
|
operators:
|
|
@@ -1498,6 +1565,7 @@ en:
|
|
|
1498
1565
|
log_entries: Log Entries
|
|
1499
1566
|
logged_in_as: Logged in as
|
|
1500
1567
|
logged_in_succesfully: Logged in successfully
|
|
1568
|
+
logged_in_successfully: Logged in successfully
|
|
1501
1569
|
logged_out: You have been logged out.
|
|
1502
1570
|
login: Login
|
|
1503
1571
|
login_as_existing: Login as Existing Customer
|
|
@@ -1527,6 +1595,7 @@ en:
|
|
|
1527
1595
|
meta_title: Meta Title
|
|
1528
1596
|
metadata: Metadata
|
|
1529
1597
|
minimal_amount: Minimal Amount
|
|
1598
|
+
minimize_menu: Minimize Menu
|
|
1530
1599
|
modify_stock_count: Modify (+/-)
|
|
1531
1600
|
month: Month
|
|
1532
1601
|
more: More
|
|
@@ -1534,6 +1603,7 @@ en:
|
|
|
1534
1603
|
my_account: My Account
|
|
1535
1604
|
my_orders: My Orders
|
|
1536
1605
|
name: Name
|
|
1606
|
+
name_contains: Name Contains
|
|
1537
1607
|
name_on_card: Name on card
|
|
1538
1608
|
name_or_sku: Name or SKU (enter at least first 4 characters of product name)
|
|
1539
1609
|
negative_movement_absent_item: Cannot create negative movement for absent stock
|
|
@@ -1923,10 +1993,9 @@ en:
|
|
|
1923
1993
|
select: Select
|
|
1924
1994
|
select_a_reason: Select a reason
|
|
1925
1995
|
select_a_stock_location: Select a stock location
|
|
1926
|
-
select_stock: Select stock
|
|
1927
1996
|
selected_quantity_not_available: selected of %{item} is not available.
|
|
1928
1997
|
send_copy_of_all_mails_to: Send Copy of All Mails To
|
|
1929
|
-
send_mailer: Send
|
|
1998
|
+
send_mailer: Send Shipment Email
|
|
1930
1999
|
send_mails_as: Send Mails As
|
|
1931
2000
|
server: Server
|
|
1932
2001
|
server_error: The server returned an error
|
|
@@ -1934,6 +2003,7 @@ en:
|
|
|
1934
2003
|
ship: ship
|
|
1935
2004
|
ship_address: Ship Address
|
|
1936
2005
|
ship_address_required: Valid shipping address required
|
|
2006
|
+
bill_address_required: Valid billing address required
|
|
1937
2007
|
ship_total: Ship Total
|
|
1938
2008
|
shipment: Shipment
|
|
1939
2009
|
shipment_adjustments: Shipment adjustments
|
|
@@ -2083,6 +2153,7 @@ en:
|
|
|
2083
2153
|
(i.e. if the tax rate is 5% then enter 0.05)
|
|
2084
2154
|
tax_rates: Tax Rates
|
|
2085
2155
|
taxon: Taxon
|
|
2156
|
+
taxon_attachment_removal_error: There was an error removing the attachment
|
|
2086
2157
|
taxon_edit: Edit Taxon
|
|
2087
2158
|
taxon_placeholder: Add a Taxon
|
|
2088
2159
|
taxon_rule:
|
|
@@ -2202,8 +2273,7 @@ en:
|
|
|
2202
2273
|
you_cannot_undo_action: You will not be able to undo this action
|
|
2203
2274
|
you_have_no_orders_yet: You have no orders yet
|
|
2204
2275
|
your_cart_is_empty: Your cart is empty
|
|
2205
|
-
your_order_is_empty_add_product: Your order is empty
|
|
2206
|
-
a product above
|
|
2276
|
+
your_order_is_empty_add_product: Your order is empty. Please add products first.
|
|
2207
2277
|
zip: Zip
|
|
2208
2278
|
zipcode: Zip Code
|
|
2209
2279
|
zone: Zone
|