spree_core 4.0.9 → 4.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree.js +0 -1
  3. data/app/finders/spree/products/find.rb +19 -6
  4. data/app/finders/spree/variants/option_types_finder.rb +21 -0
  5. data/app/finders/spree/variants/visible_finder.rb +22 -0
  6. data/app/helpers/spree/base_helper.rb +48 -18
  7. data/app/helpers/spree/products_helper.rb +76 -8
  8. data/app/models/concerns/spree/user_methods.rb +2 -2
  9. data/app/models/spree/app_dependencies.rb +1 -7
  10. data/app/models/spree/credit_card.rb +4 -5
  11. data/app/models/spree/image/configuration/active_storage.rb +9 -1
  12. data/app/models/spree/image.rb +52 -3
  13. data/app/models/spree/line_item.rb +1 -2
  14. data/app/models/spree/option_type.rb +4 -0
  15. data/app/models/spree/order/address_book.rb +20 -7
  16. data/app/models/spree/order/store_credit.rb +0 -8
  17. data/app/models/spree/order.rb +12 -12
  18. data/app/models/spree/payment_method.rb +8 -0
  19. data/app/models/spree/preferences/preferable.rb +1 -1
  20. data/app/models/spree/product.rb +7 -6
  21. data/app/models/spree/promotion/actions/create_item_adjustments.rb +1 -1
  22. data/app/models/spree/promotion_handler/coupon.rb +2 -1
  23. data/app/models/spree/return_item/eligibility_validator/base_validator.rb +1 -1
  24. data/app/models/spree/store.rb +2 -1
  25. data/app/models/spree/taxon.rb +2 -6
  26. data/app/models/spree/variant.rb +2 -14
  27. data/app/models/spree/zone.rb +6 -3
  28. data/app/presenters/spree/product_summary_presenter.rb +26 -0
  29. data/app/presenters/spree/variant_presenter.rb +69 -0
  30. data/app/presenters/spree/variants/option_types_presenter.rb +74 -0
  31. data/app/presenters/spree/variants/options_presenter.rb +49 -0
  32. data/app/services/spree/checkout/get_shipping_rates.rb +10 -7
  33. data/app/services/spree/checkout/update.rb +2 -13
  34. data/config/locales/en.yml +156 -14
  35. data/db/default/spree/stores.rb +8 -3
  36. data/db/migrate/20140309033438_create_store_from_preferences.rb +8 -4
  37. data/db/migrate/20191005121504_add_store_id_to_payment_methods.rb +7 -0
  38. data/db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb +5 -0
  39. data/db/migrate/20200102141311_add_social_to_spree_stores.rb +7 -0
  40. data/lib/generators/spree/dummy/dummy_generator.rb +3 -1
  41. data/lib/generators/spree/dummy/templates/initializers/bullet.rb +5 -0
  42. data/lib/generators/spree/install/install_generator.rb +13 -5
  43. data/lib/generators/spree/install/templates/config/initializers/spree.rb +0 -1
  44. data/lib/generators/spree/install/templates/config/initializers/spree_storefront.rb +1 -0
  45. data/lib/generators/spree/install/templates/config/spree_storefront.yml +67 -0
  46. data/lib/spree/core/controller_helpers/order.rb +12 -6
  47. data/lib/spree/core/controller_helpers/store.rb +2 -2
  48. data/lib/spree/core/search/base.rb +59 -22
  49. data/lib/spree/core/version.rb +1 -3
  50. data/lib/spree/core.rb +0 -1
  51. data/lib/spree/money.rb +8 -1
  52. data/lib/spree/permitted_attributes.rb +3 -2
  53. data/lib/spree/testing_support/capybara_ext.rb +0 -52
  54. data/lib/spree/testing_support/common_rake.rb +1 -1
  55. data/lib/spree/testing_support/factories/store_factory.rb +3 -0
  56. data/lib/spree/testing_support/order_walkthrough.rb +7 -3
  57. data/spree_core.gemspec +9 -15
  58. metadata +49 -35
  59. data/app/finders/spree/addresses/find.rb +0 -17
  60. data/app/models/spree/order_contents.rb +0 -31
  61. data/app/services/spree/account/addresses/base.rb +0 -39
  62. data/app/services/spree/account/addresses/create.rb +0 -18
  63. data/app/services/spree/account/addresses/update.rb +0 -18
  64. data/lib/spree/database_type_utilities.rb +0 -12
@@ -16,6 +16,7 @@ en:
16
16
  address1: Address
17
17
  address2: Address (contd.)
18
18
  city: City
19
+ company: Company
19
20
  country: Country
20
21
  firstname: First Name
21
22
  lastname: Last Name
@@ -55,7 +56,7 @@ en:
55
56
  completed_at: Completed At
56
57
  coupon_code: Coupon Code
57
58
  created_at: Order Date
58
- email: Customer E-Mail
59
+ email: Email
59
60
  ip_address: IP Address
60
61
  item_total: Item Total
61
62
  number: Number
@@ -97,6 +98,7 @@ en:
97
98
  on_hand: On Hand
98
99
  shipping_category: Shipping Category
99
100
  tax_category: Tax Category
101
+ less_than: Less than
100
102
  spree/promotion:
101
103
  advertise: Advertise
102
104
  code: Code
@@ -142,7 +144,7 @@ en:
142
144
  name: Site Name
143
145
  mail_from_address: Mail From Address
144
146
  spree/store_credit:
145
- amount_used: "Amount used"
147
+ amount_used: Amount used
146
148
  spree/store_credit_category:
147
149
  name: Name
148
150
  spree/tax_category:
@@ -381,6 +383,9 @@ en:
381
383
  attributes:
382
384
  attachment:
383
385
  not_allowed_content_type: has not allowed content type
386
+ address_book:
387
+ save: Save
388
+ successfully_created: New address has been successfully created
384
389
  devise:
385
390
  confirmations:
386
391
  confirmed: Your account was successfully confirmed. You are now signed in.
@@ -434,6 +439,13 @@ en:
434
439
  format:
435
440
  precision: 1
436
441
 
442
+ pagination:
443
+ first: "«"
444
+ last: "»"
445
+ previous: "‹"
446
+ next: "›"
447
+ truncate: "…"
448
+
437
449
  spree:
438
450
  abbreviation: Abbreviation
439
451
  accept: Accept
@@ -458,9 +470,11 @@ en:
458
470
  activate: Activate
459
471
  active: Active
460
472
  add: Add
473
+ add_new_credit_card: Add a new card
461
474
  add_action_of_type: Add action of type
462
475
  add_country: Add Country
463
476
  add_coupon_code: Add Coupon Code
477
+ add_new_address: Add new address
464
478
  add_new_header: Add New Header
465
479
  add_new_style: Add New Style
466
480
  add_one: Add One
@@ -472,12 +486,18 @@ en:
472
486
  add_stock: Add Stock
473
487
  add_to_cart: Add To Cart
474
488
  add_variant: Add Variant
489
+ add_store: New Store
475
490
  add_store_credit: Add Store Credit
491
+ added_to_cart: Added to bag successfully!
476
492
  additional_item: Additional Item
477
493
  address: Address
478
494
  address1: Address
479
495
  address2: Address (contd.)
480
496
  addresses: Addresses
497
+ address_action_popup:
498
+ delete_button: yes, delete
499
+ delete_text: Do you really want <br /> to delete this address?
500
+ delete_title: Are you sure?
481
501
  address_book:
482
502
  other_address: "Other address"
483
503
  add_new_shipping_address: "Add new address"
@@ -526,6 +546,10 @@ en:
526
546
  cancel: cancel
527
547
  resume: resume
528
548
  resend: Resend
549
+ orders:
550
+ cart: Cart
551
+ return_authorization:
552
+ product: Product
529
553
  user:
530
554
  account: Account
531
555
  addresses: Addresses
@@ -548,6 +572,8 @@ en:
548
572
  all_adjustments_opened: All adjustments successfully opened!
549
573
  all_departments: All departments
550
574
  all_items_have_been_returned: All items have been returned
575
+ all_rights_reserved: All rights reserved
576
+ already_have_account: Already have an account?
551
577
  alt_text: Alternative Text
552
578
  alternative_phone: Alternative Phone
553
579
  amount: Amount
@@ -562,6 +588,7 @@ en:
562
588
  authorization_failure: Authorization Failure
563
589
  authorized: Authorized
564
590
  auto_capture: Auto Capture
591
+ availability: availability
565
592
  available_on: Available On
566
593
  available: Available
567
594
  average_order_value: Average Order Value
@@ -605,14 +632,33 @@ en:
605
632
  card_type: Brand
606
633
  card_type_is: Card type is
607
634
  cart: Cart
635
+ cart_page:
636
+ add_promo_code: ADD PROMO CODE
637
+ checkout: checkout
638
+ empty_info: 'Your cart is empty.<br />There are no items in your cart.'
639
+ header: Your shopping bag
640
+ product: product
641
+ quantity: quantity
642
+ title: Shopping Cart
608
643
  cart_subtotal:
609
644
  one: 'Subtotal (1 item)'
610
645
  other: 'Subtotal (%{count} items)'
611
646
  categories: Categories
612
647
  category: Category
648
+ category_nav_bar:
649
+ get_up_to_30_percent_off: GET UP TO 30% OFF
650
+ jackets_and_coats: JACKET & COASTS
651
+ new_collection: NEW COLLECTION
652
+ special_offers: SPECIAL OFFERS
653
+ summer_2019: SUMMER 2019
613
654
  channel: Channel
614
655
  charged: Charged
615
656
  checkout: Checkout
657
+ checkout_page:
658
+ back_to_cart: back to the cart
659
+ delivery_method: delivery method
660
+ header: Checkout
661
+ product: Product
616
662
  choose_a_customer: Choose a customer
617
663
  choose_a_taxon_to_sort_products_for: "Choose a taxon to sort products for"
618
664
  choose_currency: Choose Currency
@@ -634,7 +680,9 @@ en:
634
680
  confirm: Confirm
635
681
  confirm_delete: Confirm Deletion
636
682
  confirm_password: Password Confirmation
683
+ contact_us: Contact us
637
684
  continue: Continue
685
+ continue_as_guest: Continue as a guest
638
686
  continue_shopping: Continue shopping
639
687
  cost_currency: Cost Currency
640
688
  cost_price: Cost Price
@@ -662,6 +710,7 @@ en:
662
710
  coupon_code_max_usage: Coupon code usage limit exceeded
663
711
  coupon_code_not_eligible: This coupon code is not eligible for this order
664
712
  coupon_code_not_found: The coupon code you entered doesn't exist. Please try again.
713
+ coupon_code_removed: The coupon code was successfully removed from your order.
665
714
  coupon_code_unknown_error: This coupon code could not be applied to the cart at this time.
666
715
  create: Create
667
716
  create_a_new_account: Create a new account
@@ -686,6 +735,7 @@ en:
686
735
  customer_returns: Customer Returns
687
736
  customer_search: Customer Search
688
737
  cut: Cut
738
+ cvv: CVV
689
739
  cvv_response: CVV Response
690
740
  date: Date
691
741
  date_completed: Date Completed
@@ -705,6 +755,7 @@ en:
705
755
  delete_from_taxon: Delete From Taxon
706
756
  discontinued_variants_present: Some line items in this order have products that are no longer available.
707
757
  delivery: Delivery
758
+ delivery_information: Delivery Information
708
759
  depth: Depth
709
760
  details: Details
710
761
  description: Description
@@ -716,10 +767,11 @@ en:
716
767
  dismiss_banner: No. Thanks! I'm not interested, do not display this message again
717
768
  display: Display
718
769
  doesnt_track_inventory: It doesn't track inventory
770
+ dont_have_account: Don't have an account yet?
719
771
  edit: Edit
720
772
  editing_resource: 'Editing %{resource}'
721
773
  editing_rma_reason: Editing RMA Reason
722
- editing_user: Editing User
774
+ editing_user: Edit Your account
723
775
  eligibility_errors:
724
776
  messages:
725
777
  has_excluded_product: Your cart contains a product that prevents this coupon code from being applied.
@@ -775,6 +827,7 @@ en:
775
827
  expedited_exchanges_warning: "Any specified exchanges will ship to the customer immediately upon saving. The customer will be charged the full amount of the item if they do not return the original item within %{days_window} days."
776
828
  excl: excl.
777
829
  expiration: Expiration
830
+ expiration_date: Expiration Date
778
831
  extension: Extension
779
832
  extensions_directory: Extensions Directory
780
833
  existing_shipments: Existing shipments
@@ -792,7 +845,8 @@ en:
792
845
  flat_percent: Flat Percent
793
846
  flat_rate_per_order: Flat Rate
794
847
  flexible_rate: Flexible Rate
795
- forgot_password: Forgot Password?
848
+ follow_us: Follow us
849
+ forgot_password: Forgot password?
796
850
  free_shipping: Free Shipping
797
851
  free_shipping_amount: "-"
798
852
  front_end: Front End
@@ -801,11 +855,34 @@ en:
801
855
  general: General
802
856
  general_settings: General Settings
803
857
  generate_code: Generate coupon code
858
+ go_to_category: Go to category
859
+ go_to_facebook: Go to facebook
860
+ go_to_homepage: Go to Home Page
861
+ go_to_instagram: Go to instagram
862
+ go_to_twitter: Go to twitter
804
863
  guest_checkout: Guest Checkout
805
864
  guest_user_account: Checkout as a Guest
806
865
  has_no_shipped_units: has no shipped units
807
866
  height: Height
808
867
  home: Home
868
+ homepage:
869
+ bestsellers: BESTSELLERS
870
+ fashion_trends: FASHION TRENDS
871
+ fashion_trends_note: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
872
+ men: MEN
873
+ new: NEW
874
+ new_collection: NEW COLLECTION
875
+ read_more: READ MORE
876
+ shoes: SHOES
877
+ shop_now: SHOP NOW
878
+ sportswear: SPORTSWEAR
879
+ streetstyle: STREETSTYLE
880
+ summer_2019: Summer 2019
881
+ summer_collection: Summer Collection
882
+ summer_sale: SUMMER SALE
883
+ trending: TRENDING
884
+ up_to_60: UP TO 60%
885
+ women: WOMEN
809
886
  help_center: Help Center
810
887
  i18n:
811
888
  available_locales: Available Locales
@@ -824,6 +901,7 @@ en:
824
901
  images: Images
825
902
  implement_eligible_for_return: "Must implement #eligible_for_return? for your EligibilityValidator."
826
903
  implement_requires_manual_intervention: "Must implement #requires_manual_intervention? for your EligibilityValidator."
904
+ in_stock: In Stock
827
905
  inactive: Inactive
828
906
  incl: incl.
829
907
  included_in_price: Included in Price
@@ -878,6 +956,8 @@ en:
878
956
  location: Location
879
957
  lock: Lock
880
958
  log_entries: "Log Entries"
959
+ log_in: Log in
960
+ log_in_to_continue: Log in to continue
881
961
  logs: "Logs"
882
962
  logged_in_as: Logged in as
883
963
  logged_in_succesfully: Logged in successfully
@@ -886,10 +966,12 @@ en:
886
966
  login_as_existing: Login as Existing Customer
887
967
  login_failed: Login authentication failed.
888
968
  login_name: Login
969
+ logo_alt: Brand logo
889
970
  logout: Logout
890
971
  look_for_similar_items: Look for similar items
891
972
  make_refund: Make refund
892
973
  make_sure_the_above_reimbursement_amount_is_correct: Make sure the above reimbursement amount is correct
974
+ mail_from_address: Mail from address
893
975
  manage_promotion_categories: Manage Promotion Categories
894
976
  manual_intervention_required: Manual intervention required
895
977
  manage_variants: Manage Variants
@@ -916,9 +998,20 @@ en:
916
998
  name: Name
917
999
  name_on_card: Name on card
918
1000
  name_or_sku: Name or SKU (enter at least first 3 characters of product name)
1001
+ nav_bar:
1002
+ close_menu: Close menu
1003
+ go_to_previous_menu: Go to previous menu
1004
+ log_in: LOG IN
1005
+ log_out: LOG OUT
1006
+ my_account: MY ACCOUNT
1007
+ my_orders: MY ORDERS
1008
+ show_menu: Show menu
1009
+ show_search: Show search
1010
+ show_user_menu: Show user menu
1011
+ sign_up: SIGN UP
919
1012
  new: New
920
1013
  new_adjustment: New Adjustment
921
- new_customer: New Customer
1014
+ new_customer: Create new account
922
1015
  new_customer_return: New Customer Return
923
1016
  new_country: New Country
924
1017
  new_image: New Image
@@ -957,9 +1050,13 @@ en:
957
1050
  new_zone: New Zone
958
1051
  next: Next
959
1052
  no_actions_added: No actions added
1053
+ no_address_given: No address given
960
1054
  no_available_date_set: No available date set
961
1055
  no_payment_found: No payment found
962
1056
  no_pending_payments: No pending payments
1057
+ no_product_available:
1058
+ for_this_quantity: Sorry, it looks like some products are not available in selected quantity.
1059
+ opps: Oops!
963
1060
  no_products_found: No products found
964
1061
  no_results: No results
965
1062
  no_rules_added: No rules added
@@ -986,6 +1083,7 @@ en:
986
1083
  variant_not_deleted: "Variant could not be deleted. Reason: %{error}"
987
1084
  num_orders: "# Orders"
988
1085
  number: Number
1086
+ ok: OK
989
1087
  on_hand: On Hand
990
1088
  open: Open
991
1089
  open_all_adjustments: Open All Adjustments
@@ -1037,13 +1135,15 @@ en:
1037
1135
  payment: payment
1038
1136
  resumed: resumed
1039
1137
  returned: returned
1138
+ order_success: Order placed successfully
1139
+ order_success_explain: Your order information will be sent to your email
1040
1140
  order_summary: Order Summary
1041
1141
  order_sure_want_to: Are you sure you want to %{event} this order?
1042
1142
  order_total: Order Total
1043
1143
  order_updated: Order Updated
1044
1144
  orders: Orders
1045
1145
  out_of_stock: Out of Stock
1046
- backordered_info: Selected item is backordered so expect delays
1146
+ backordered_info: Backordered
1047
1147
  backordered_confirm_info: Selected item is backordered so expect delays. Are you sure you want to order it?
1048
1148
  overview: Overview
1049
1149
  package_from: package from
@@ -1057,6 +1157,7 @@ en:
1057
1157
  pay: pay
1058
1158
  payment: Payment
1059
1159
  payment_could_not_be_created: Payment could not be created.
1160
+ payment_identifier: Payment Identifier
1060
1161
  payment_information: Payment Information
1061
1162
  payment_method: Payment Method
1062
1163
  payment_methods: Payment Methods
@@ -1065,7 +1166,6 @@ en:
1065
1166
  payment_processor_choose_banner_text: If you need help choosing a payment processor, please visit
1066
1167
  payment_processor_choose_link: our payments page
1067
1168
  payment_state: Payment State
1068
- payment_identifier: Payment Identifier
1069
1169
  payment_states:
1070
1170
  balance_due: balance due
1071
1171
  checkout: checkout
@@ -1076,8 +1176,17 @@ en:
1076
1176
  pending: pending
1077
1177
  processing: processing
1078
1178
  void: void
1179
+ payment_type: Payment type
1079
1180
  payment_updated: Payment Updated
1080
1181
  payments: Payments
1182
+ pdp:
1183
+ checkout: Checkout
1184
+ description: Description
1185
+ details: Details
1186
+ products_included_in_promotion: Products included in the promotion
1187
+ quantity: Quantity
1188
+ view_cart: View cart
1189
+ you_may_also_like: You may also like
1081
1190
  percent: Percent
1082
1191
  percent_per_item: Percent Per Item
1083
1192
  permalink: Permalink
@@ -1087,6 +1196,31 @@ en:
1087
1196
  place_order: Place Order
1088
1197
  please_define_payment_methods: Please define some payment methods first.
1089
1198
  please_enter_reasonable_quantity: Please enter a reasonable quantity.
1199
+ plp:
1200
+ best_selling: BEST SELLING
1201
+ clear_all: CLEAR ALL
1202
+ collection: COLLECTION
1203
+ color: COLOR
1204
+ done: DONE
1205
+ default: DEFAULT
1206
+ filter_by: FILTER BY
1207
+ home: Home
1208
+ newest_first: NEWEST FIRST
1209
+ no_results: No results
1210
+ no_results_found: No results found
1211
+ not_found_filters1: We couldn’t find a match for these filters.
1212
+ not_found_filters2: Please try another choose.
1213
+ not_found_text1: We couldn’t find products for '%{keywords}'.
1214
+ not_found_text2: Please try another search.
1215
+ price: PRICE
1216
+ price_high_to_low: PRICE (HIGH - LOW)
1217
+ price_low_to_high: PRICE (LOW - HIGH)
1218
+ result: RESULT
1219
+ results_for: RESULTS FOR
1220
+ size: SIZE
1221
+ sort_by: SORT BY
1222
+ top_sellers: TOP SELLERS
1223
+ type: TYPE
1090
1224
  populate_get_error: Something went wrong. Please try adding the item again.
1091
1225
  powered_by: Powered by
1092
1226
  pre_tax_refund_amount: Pre-Tax Refund Amount
@@ -1216,6 +1350,7 @@ en:
1216
1350
  rename: Rename
1217
1351
  report: Report
1218
1352
  reports: Reports
1353
+ required_fields: required fields
1219
1354
  resellable: Resellable
1220
1355
  resend: Resend
1221
1356
  reset_password: Reset my password
@@ -1286,6 +1421,7 @@ en:
1286
1421
  selected_quantity_not_available: ! 'selected of %{item} is not available.'
1287
1422
  send_copy_of_all_mails_to: Send Copy of All Mails To
1288
1423
  send_mails_as: Send Mails As
1424
+ seo_title: SEO title
1289
1425
  server: Server
1290
1426
  server_error: The server returned an error
1291
1427
  settings: Settings
@@ -1342,6 +1478,7 @@ en:
1342
1478
  show_only_complete_orders: Only show complete orders
1343
1479
  show_only_considered_risky: Only show risky orders
1344
1480
  show_rate_in_label: Show rate in label
1481
+ sign_up: Sign Up
1345
1482
  sku: SKU
1346
1483
  skus: SKUs
1347
1484
  slug: Slug
@@ -1406,20 +1543,24 @@ en:
1406
1543
  stock_transfers: Stock Transfers
1407
1544
  stop: Stop
1408
1545
  store: Store
1546
+ store_errors:
1547
+ unable_to_create: Unable to create store.
1548
+ unable_to_update: Unable to update store.
1549
+ unable_to_delete: Unable to delete store.
1550
+ store_set_default_button: Set as default
1409
1551
  stores: Stores
1410
- add_store: New Store
1411
1552
  store_credit_name: Store Credit
1412
1553
  store_credit:
1413
1554
  credit: "Credit"
1414
1555
  authorized: "Authorized"
1415
1556
  captured: "Used"
1416
1557
  allocated: "Added"
1417
- apply: Apply Store Credit
1418
- remove: Remove Store Credit
1419
- applicable_amount: "%{amount} in store credit will be applied to this order."
1420
- available_amount: "You have %{amount} in Store Credit available!"
1421
- remaining_amount: "You have %{amount} remaining in your account's Store Credit."
1422
- additional_payment_needed: Select another payment method for the remaining %{amount}.
1558
+ apply: Apply
1559
+ remove: Remove
1560
+ applicable_amount: "<strong>%{amount}</strong> in store credit will be applied to this order."
1561
+ available_amount: "You have <strong>%{amount}</strong> in Store Credit available!"
1562
+ remaining_amount: "You have <strong>%{amount}</strong> remaining in your account's Store Credit."
1563
+ additional_payment_needed: Select another payment method for the remaining <strong>%{amount}</strong>.
1423
1564
  errors:
1424
1565
  cannot_change_used_store_credit: You cannot change a store credit that has already been used
1425
1566
  unable_to_create: Unable to create store credit
@@ -1465,6 +1606,7 @@ en:
1465
1606
  taxon_placeholder: Add a Taxon
1466
1607
  tags: Tags
1467
1608
  tags_placeholder: Add Tags
1609
+ taxon_missing_alt: Category banner description
1468
1610
  taxon_rule:
1469
1611
  choose_taxons: Choose taxons
1470
1612
  label: Order must contain x amount of these taxons
@@ -1,10 +1,15 @@
1
1
  # Possibly already created by a migration.
2
- unless Spree::Store.where(code: 'spree').exists?
2
+ unless Spree::Store.default.persisted?
3
3
  Spree::Store.new do |s|
4
- s.code = 'spree'
5
4
  s.name = 'Spree Demo Site'
6
- s.url = 'example.com'
5
+ s.code = 'spree'
6
+ s.url = Rails.application.routes.default_url_options[:host] || 'demo.spreecommerce.org'
7
7
  s.mail_from_address = 'spree@example.com'
8
8
  s.default_currency = 'USD'
9
+ s.seo_title = 'Spree Commerce Demo Shop'
10
+ s.meta_description = 'Spree Commerce is an open source Ecommerce framework decision makers want, developers enjoy.'
11
+ s.facebook = 'spreecommerce'
12
+ s.twitter = 'spreecommerce'
13
+ s.instagram = 'spreecommerce'
9
14
  end.save!
10
15
  end
@@ -6,7 +6,7 @@ class CreateStoreFromPreferences < ActiveRecord::Migration[4.2]
6
6
  false
7
7
  end
8
8
  end
9
-
9
+
10
10
  preference_store = Spree::Preferences::Store.instance
11
11
  if store = Spree::Store.where(default: true).first
12
12
  store.meta_description = preference_store.get('spree/app_configuration/default_meta_description') {}
@@ -26,10 +26,14 @@ class CreateStoreFromPreferences < ActiveRecord::Migration[4.2]
26
26
  'spree@example.com'
27
27
  end
28
28
 
29
- s.meta_description = preference_store.get('spree/app_configuration/default_meta_description') {}
29
+ s.meta_description = preference_store.get('spree/app_configuration/default_meta_description') do
30
+ 'Spree Commerce is an open source Ecommerce framework decision makers want, developers enjoy.'
31
+ end
30
32
  s.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {}
31
- s.seo_title = preference_store.get('spree/app_configuration/default_seo_title') {}
32
- s.default_currency = preference_store.get('spree/app_configuration/currency') {}
33
+ s.seo_title = preference_store.get('spree/app_configuration/default_seo_title') do
34
+ 'Spree Commerce Demo Shop'
35
+ end
36
+ s.default_currency = preference_store.get('spree/app_configuration/currency') { 'USD' }
33
37
  s.code = 'spree'
34
38
  end.save!
35
39
  end
@@ -0,0 +1,7 @@
1
+ class AddStoreIdToPaymentMethods < ActiveRecord::Migration[5.2]
2
+ def change
3
+ unless column_exists?(:spree_payment_methods, :store_id)
4
+ add_reference :spree_payment_methods, :store, references: :spree_stores, index: true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddDeafultValueForStoreDefaultCurrency < ActiveRecord::Migration[6.0]
2
+ def change
3
+ Spree::Store.where(default_currency: nil).update_all(default_currency: Spree::Config[:currency])
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class AddSocialToSpreeStores < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :spree_stores, :facebook, :string
4
+ add_column :spree_stores, :twitter, :string
5
+ add_column :spree_stores, :instagram, :string
6
+ end
7
+ end
@@ -32,6 +32,7 @@ module Spree
32
32
  opts[:skip_bundle] = true
33
33
  opts[:skip_gemfile] = true
34
34
  opts[:skip_git] = true
35
+ opts[:skip_keeps] = true
35
36
  opts[:skip_listen] = true
36
37
  opts[:skip_rc] = true
37
38
  opts[:skip_spring] = true
@@ -56,6 +57,7 @@ module Spree
56
57
  template 'rails/test.rb', "#{dummy_path}/config/environments/test.rb", force: true
57
58
  template 'rails/script/rails', "#{dummy_path}/spec/dummy/script/rails", force: true
58
59
  template 'initializers/devise.rb', "#{dummy_path}/config/initializers/devise.rb", force: true
60
+ template 'initializers/bullet.rb', "#{dummy_path}/config/initializers/bullet.rb", force: true
59
61
  end
60
62
 
61
63
  def test_dummy_inject_extension_requirements
@@ -136,7 +138,7 @@ end
136
138
  end
137
139
 
138
140
  def gemfile_path
139
- core_gems = ['spree/core', 'spree/api', 'spree/backend', 'spree/frontend', 'spree/sample']
141
+ core_gems = ['spree/core', 'spree/api', 'spree/backend', 'spree/frontend']
140
142
 
141
143
  if core_gems.include?(lib_name)
142
144
  '../../../../../Gemfile'
@@ -0,0 +1,5 @@
1
+ if Rails.env.development? && defined?(Bullet)
2
+ Bullet.enable = true
3
+ Bullet.rails_logger = true
4
+ Bullet.stacktrace_includes = [ 'spree_core', 'spree_frontend', 'spree_api', 'spree_backend' ]
5
+ end
@@ -10,7 +10,7 @@ module Spree
10
10
  class_option :migrate, type: :boolean, default: true, banner: 'Run Spree migrations'
11
11
  class_option :seed, type: :boolean, default: true, banner: 'load seed data (migrations must be run)'
12
12
  class_option :sample, type: :boolean, default: true, banner: 'load sample data (migrations must be run)'
13
- class_option :copy_views, type: :boolean, default: true, banner: 'copy frontend views from spree to your application for easy customization'
13
+ class_option :copy_storefront, type: :boolean, default: true, banner: 'copy storefront from spree frontend to your application for easy customization'
14
14
  class_option :auto_accept, type: :boolean
15
15
  class_option :user_class, type: :string
16
16
  class_option :admin_email, type: :string
@@ -30,7 +30,7 @@ module Spree
30
30
  @run_migrations = options[:migrate]
31
31
  @load_seed_data = options[:seed]
32
32
  @load_sample_data = options[:sample]
33
- @copy_views = options[:copy_views]
33
+ @copy_storefront = options[:copy_storefront]
34
34
 
35
35
  unless @run_migrations
36
36
  @load_seed_data = false
@@ -40,6 +40,11 @@ module Spree
40
40
 
41
41
  def add_files
42
42
  template 'config/initializers/spree.rb', 'config/initializers/spree.rb'
43
+
44
+ if Spree::Core::Engine.frontend_available? || Rails.env.test?
45
+ template 'config/initializers/spree_storefront.rb', 'config/initializers/spree_storefront.rb'
46
+ template 'config/spree_storefront.yml', 'config/spree_storefront.yml'
47
+ end
43
48
  end
44
49
 
45
50
  def additional_tweaks
@@ -54,6 +59,9 @@ module Spree
54
59
  Disallow: /account
55
60
  Disallow: /api
56
61
  Disallow: /password
62
+ Disallow: /api_tokens
63
+ Disallow: /cart_link
64
+ Disallow: /account_link
57
65
  ROBOTS
58
66
  end
59
67
 
@@ -83,9 +91,9 @@ module Spree
83
91
  empty_directory 'app/overrides'
84
92
  end
85
93
 
86
- def copy_views
87
- if @copy_views && Spree::Core::Engine.frontend_available?
88
- generate 'spree:frontend:copy_views'
94
+ def copy_storefront
95
+ if @copy_storefront && Spree::Core::Engine.frontend_available?
96
+ generate 'spree:frontend:copy_storefront'
89
97
  end
90
98
  end
91
99
 
@@ -26,6 +26,5 @@ Spree.dependencies do |dependencies|
26
26
  # dependencies.cart_add_item_service = 'MyNewAwesomeService'
27
27
  end
28
28
 
29
- # Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer'
30
29
 
31
30
  Spree.user_class = <%= (options[:user_class].blank? ? 'Spree::LegacyUser' : options[:user_class]).inspect %>
@@ -0,0 +1 @@
1
+ SpreeStorefrontConfig = YAML.load_file(Rails.root.join('config', 'spree_storefront.yml')).with_indifferent_access