Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
[SD-1106] Fixes categories in samples and links
Robert Nowakowski143687eca575
diff --git a/core/config/locales/en.yml b/core/config/locales/en.ymlindex 0c2d4e7424..b8128bbbc4 100644--- a/core/config/locales/en.yml+++ b/core/config/locales/en.yml@@ -663,7 +663,6 @@ en:jackets_and_coats: JACKET & COASTSnew_collection: NEW COLLECTIONspecial_offers: SPECIAL OFFERS- summer_2019: SUMMER 2019channel: Channelcharged: Chargedcheckout: Checkout@@ -938,7 +937,7 @@ en:shop_now: SHOP NOWsportswear: SPORTSWEARstreetstyle: STREETSTYLE- summer_2020: Summer 2020+ summer_year: "Summer %{year}"summer_collection: Summer Collectionsummer_sale: SUMMER SALEtrending: TRENDINGdiff --git a/core/lib/generators/spree/install/templates/config/spree_storefront.yml b/core/lib/generators/spree/install/templates/config/spree_storefront.ymlindex dfa4e0b202..5b769beebc 100644--- a/core/lib/generators/spree/install/templates/config/spree_storefront.yml+++ b/core/lib/generators/spree/install/templates/config/spree_storefront.yml@@ -18,12 +18,12 @@ default::url: /t/women/jackets-and-coatspromo_banners:- subtitle: New collection- title: Summer 2019- url: /t/new-collection/summer-2019+ title: Summer 2021+ url: /t/new-collection/summer-2021image: 'meganav/promo_banner_left-first-category.jpg'- subtitle: Special Offerstitle: Get up to 30% off- url: /t/special-offers/30-off+ url: /t/special-offers/30-percent-offimage: 'meganav/promo_banner_right-first-category.jpg'- title: Mensubtitle: Categories@@ -39,12 +39,12 @@ default::url: /t/men/jackets-and-coatspromo_banners:- subtitle: New collection- title: Summer 2019- url: /t/new-collection/summer-2019+ title: Summer 2021+ url: /t/new-collection/summer-2021image: 'meganav/promo_banner_left-second-category.jpg'- subtitle: Special Offerstitle: Get up to 30% off- url: /t/special-offers/30-off+ url: /t/special-offers/30-percent-offimage: 'meganav/promo_banner_right-second-category.jpg'- title: Sportswearsubtitle: Categories@@ -58,10 +58,10 @@ default::url: /t/sportswear/pantspromo_banners:- subtitle: New collection- title: Summer 2019- url: /t/new-collection/summer-2019+ title: Summer 2021+ url: /t/new-collection/summer-2021image: 'meganav/promo_banner_left-third-category.jpg'- subtitle: Special Offerstitle: Get up to 30% off- url: /t/special-offers/30-off+ url: /t/special-offers/30-percent-offimage: 'meganav/promo_banner_right-third-category.jpg'diff --git a/frontend/app/views/spree/home/index.html.erb b/frontend/app/views/spree/home/index.html.erbindex 5c08f16183..75ed4bf74c 100644--- a/frontend/app/views/spree/home/index.html.erb+++ b/frontend/app/views/spree/home/index.html.erb@@ -65,7 +65,7 @@<div class="homepage-fashion-trends-box mb-3"><div class="text-center">- <div class="homepage-fashion-trends-box-summer-text mb-1"><%= Spree.t('homepage.summer_2020') %></div>+ <div class="homepage-fashion-trends-box-summer-text mb-1"><%= Spree.t('homepage.summer_year', year: Date.current.year) %></div><div class="homepage-fashion-trends-box-fashion-trends-text mb-2"><%= Spree.t('homepage.fashion_trends') %></div><div class="homepage-fashion-trends-box-description-text text-center mb-3"><%= Spree.t('homepage.fashion_trends_note') %>diff --git a/sample/db/samples/taxons.rb b/sample/db/samples/taxons.rbindex ed2b1e5c4b..e445c4fc95 100644--- a/sample/db/samples/taxons.rb+++ b/sample/db/samples/taxons.rb@@ -2,6 +2,10 @@ require 'csv'Spree::Sample.load_sample('taxonomies')+ADDITIONAL_TAXONS = ['Bestsellers', 'Trending', 'Streetstyle', 'Summer Sale'].freeze++SPECIAL_TAXONS = { 'New Collection': 'Summer 2021', 'Special Offers': '30% Off' }.freeze+CHILDREN_TAXON_NAMES = CSV.read(File.join(__dir__, 'variants.csv')).map do |(parent_name, taxon_name, _product_name, _color_name)|[parent_name, taxon_name]end.uniq@@ -31,9 +35,21 @@ taxon.permalink = taxon.permalink.gsub('categories/', '')taxon.taxonomy = categoriestaxon.save!-['Bestsellers', 'Trending', 'Streetstyle', 'Summer Sale'].each do |taxon_name|+ADDITIONAL_TAXONS.each do |taxon_name|taxon = categories_taxon.children.where(name: taxon_name).first_or_create!taxon.permalink = taxon.permalink.gsub('categories/', '')taxon.taxonomy = categoriestaxon.save!end++SPECIAL_TAXONS.each do |parent_name, taxon_name|+ parent = categories_taxon.children.where(name: parent_name).first_or_create!+ parent.permalink = parent.permalink.gsub('categories/', '')+ parent.taxonomy = categories+ parent.save!++ taxon = parent.children.where(name: taxon_name).first_or_create!+ taxon.permalink = taxon.permalink.gsub('categories/', '')+ taxon.taxonomy = categories+ taxon.save!+end