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
storefront
Kaj Zukowski729a7089fc29
diff --git a/guides/src/content/developer/customization/storefront.md b/guides/src/content/developer/customization/storefront.mdindex 2355acfdf6..ea78650277 100644--- a/guides/src/content/developer/customization/storefront.md+++ b/guides/src/content/developer/customization/storefront.md@@ -6,7 +6,7 @@ order: 0## Overview-The new Spree UX is here for the taking. Feel free to customize it according to your needs: overall styling, header, footer, placeholder images and text, SEO settings.+The new Spree UX is here. Feel free to customize it to your needs, including: the overall styling, header, footer, placeholder images and text, and SEO settings.@@ -16,7 +16,7 @@ The new Spree UX is here for the taking. Feel free to customize it according toSpree 4.x uses [Bootstrap 4 with built-in Sass variables](https://www.example.com) for global style preferences for easy theming and component changes.-All the Sass variables needed for customizing the new Spree UX are in the variables.scss file. Color variables listed there could be assigned any CSS color value:+All the Sass variables needed for customizing the new Spree UX are in the variables.scss file. Color variables listed there can be assigned any CSS color value:- HEX - example: #007bff- RGB-A - example: 0 123 255 1@@ -29,7 +29,7 @@ in your project directory with your values and then commit those changes to your### Header-__*$header-background*__ - header background color variable with 2 examples: white and blue one. By default set with __*$primary-background*__ value but feel to replace it with any other value in the variables.scss file.+__*$header-background*__ - header background color variable with 2 examples: white and blue one. By default, this is set with a __*$primary-background*__ value but feel to replace it with any other value in the variables.scss file.White@@ -41,7 +41,7 @@ Blue__*$header-font-color*__- Header font color. By default set with __*$font-color*__ value but feel to replace it with any other value in the variables.scss file.-Dark Grey+Dark grey@@ -55,13 +55,13 @@ White### Footer-__*$footer-background*__ - variable that overrides \$primary-background and allows you to change footer color. See a white and a blue example below.+__*$footer-background*__ - a variable that overrides \$primary-background and allows you to change the footer color. See a white and a blue example below.-__*$footer-font-color*__ - variable that overrides __*$font-color*__ and allows you to change footer font color. See black and blue font examples below.+__*$footer-font-color*__ - a variable that overrides __*$font-color*__ and allows you to change the footer font color. See black and blue font examples below.@@ -69,13 +69,13 @@ __*$footer-font-color*__ - variable that overrides __*$font-color*__ and allows### Meganav menu-__*$meganav-background*__ - variable that allows you to change the mega nav menu background color. By default meganav menu is set to __*$primary-background*__ value but feel to replace it with any other value in the variables.scss file.+__*$meganav-background*__ - a variable that allows you to change the mega nav menu background color. By default the meganav menu is set to a __*$primary-background*__ value but feel to replace it with any other value in the variables.scss file.-__*$meganav-font-color*__ - font color variable in the mega nav menu. By default mega nav font color is set to \$font-color value but feel to replace it with any other value in the variables.scss file.+__*$meganav-font-color*__ - a font color variable in the mega nav menu. By default the mega nav font color is set to a \$font-color value but feel to replace it with any other value in the variables.scss file.@@ -83,13 +83,13 @@ __*$meganav-font-color*__ - font color variable in the mega nav menu. By default### Background-__*$primary-background*__ - main background color across the whole site. Two examples below - a white one and a black one. Please note that you can also use an image as a background.+__*$primary-background*__ - the main background color across the whole site. There are two examples below, of the white and the black backgrounds. Please note that you can also use an image as a background.-__*$secondary-background*__ - second background color present across the whole site with examples attached below.+__*$secondary-background*__ - the second background color present across the whole site with examples attached below.@@ -99,13 +99,13 @@ __*$secondary-background*__ - second background color present across the whole s-__*$font-color*__ - this variable affects all fonts on \$primary-background. Please see two examples below.+__*$font-color*__ - this variable affects all fonts on the \$primary-background. Please see two examples below.-__*$secondary-font-color*__ - affects all fonts on $secondary-background. By default set with $font-color value but feel to replace it with any other value in the variables.scss file.+__*$secondary-font-color*__ - this affects all fonts on $secondary-background. By default, it is set with a $font-color value but feel to replace it with any other value in the variables.scss file.@@ -113,7 +113,7 @@ __*$secondary-font-color*__ - affects all fonts on $secondary-background. By def### Border color-__*$global-border-style*__ - affects border and separator color throughout the whole site+__*$global-border-style*__ - this affects the border and separator color throughout the whole site@@ -137,11 +137,11 @@ __*$global-border-style*__ - affects border and separator color throughout the w### Fonts-__*$font-family*__ - sets the font family used across your site. By default it is Sans Serif but feel to replace it with any other value in the variables.scss file. Check out [these font families](https://websitesetup.org/web-safe-fonts-html-css/) you could use.+__*$font-family*__ - this sets the font family used across your site. By default, it is in Sans Serif but feel to replace it with any other value in the variables.scss file. Check out [these font families](https://websitesetup.org/web-safe-fonts-html-css/) you might use.### Input fields-__*$input-background*__ - allows you to set a color for all input field backgrounds across the site. See two examples below - a white one and a yellow one.+__*$input-background*__ - this allows you to set a color for all input field backgrounds across the site. See two examples of a white and a yellow backround below.@@ -155,7 +155,7 @@ __*$input-background*__ - allows you to set a color for all input field backgrou-__*$second-global-border*__ - allows you to set a color for all input field borders across the whole site. See an example below with red input field borders.+__*$second-global-border*__ - this allows you to set a color for all input field borders across the whole site. See an example below with red input field borders.@@ -165,27 +165,27 @@ __*$second-global-border*__ - allows you to set a color for all input field bord### Primary color-#### Home Page+#### Home page__*$primary-color*__ variable changes-- The color of **SHOP NOW** button on the main hero image+- The color of the **SHOP NOW** button on the main hero image-- The color of **Summer 2019** and **READ MORE** button+- The color of the **Summer 2019** text and **READ MORE** button-- The color of **NEW COLLECTION & SUMMER SALE** headers inside the categories section+- The color of the **NEW COLLECTION** and **SUMMER SALE** headers inside the categories section-#### Search Results+#### Search results__*$primary-color*__ variable changes-- The color of **No Results** icon+- The color of the **No results** icon@@ -193,7 +193,7 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **NEW COLLECTION & SUMMER SALE** headers inside the banners+- The color of **NEW COLLECTION** and **SUMMER SALE** headers inside the banners@@ -201,11 +201,11 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **IN STOCK** text+- The color of the **IN STOCK** text-- The color of **ADD TO CART** button+- The color of the **ADD TO CART** button@@ -213,11 +213,11 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **Trash** delete icon+- The color of the **Trash** delete icon for removing items from the cart-- The color of **CHECKOUT** button+- The color of the **CHECKOUT** button@@ -225,7 +225,7 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **CHECKOUT** and **VIEW CART** buttons+- The color of the **CHECKOUT** and **VIEW CART** buttons@@ -233,11 +233,11 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **CONTINUE SHOPPING** button+- The color of the **CONTINUE SHOPPING** button-- The color of **Empty Cart** icon+- The color of the **Empty cart** icon@@ -245,7 +245,7 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **LOG IN, SIGN UP** and **CONTINUE AS A GUEST** buttons+- The color of the **LOG IN, SIGN UP** and **CONTINUE AS A GUEST** buttons@@ -253,15 +253,15 @@ __*$primary-color*__ variable changes-#### Checkout - Address Step+#### Checkout - Address step__*$primary-color*__ variable changes-- The color of **SAVE AND CONTINUE** button (this element remains the same across the whole checkout process)+- The color of the **SAVE AND CONTINUE** button (this element remains the same across the whole checkout process)-- The color of **EDIT** icon+- The color of the **Edit** icon@@ -269,51 +269,51 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **APPLY** button+- The color of the **APPLY** button-#### Checkout - Confirm Step+#### Checkout - Confirm step__*$primary-color*__ variable changes-- The color of **PLACE ORDER** buttons+- The color of the **PLACE ORDER** button-#### Sign In Page+#### Sign-in page__*$primary-color*__ variable changes-The color of **LOG IN** and **SIGN UP** buttons+The color of the **LOG IN** and **SIGN UP** buttons-#### Sign Up Page+#### Sign up page__*$primary-color*__ variable changes-- The color of **SIGN UP** and **LOG IN** buttons+- The color of the **SIGN UP** and **LOG IN** buttons-#### My Account Page+#### My account page__*$primary-color*__ variable changes-- The color of **Edit** and **Trash** icons+- The color of the **Edit** and **Trash** icons-#### Edit Account Page+#### Edit account page__*$primary-color*__ variable changes-- The color of **UPDATE** button+- The color of the **UPDATE** button@@ -321,7 +321,7 @@ __*$primary-color*__ variable changes__*$primary-color*__ variable changes-- The color of **CANCEL** and **OK** buttons+- The color of the **CANCEL** and **OK** buttons@@ -331,19 +331,19 @@ __*$primary-color*__ variable changes__*$secondary-color*__ variable changes-- The color of chosen **color** border variant+- The color of the chosen **color** border variant-- The color of chosen **size** border variant+- The color of the chosen **size** border variant-- The color of chosen **length** border variant+- The color of the chosen **length** border variant-- The color of chosen **price** border variant+- The color of the chosen **price** border variant@@ -351,19 +351,19 @@ __*$secondary-color*__ variable changes__*$secondary-color*__ variable changes-- The color of chosen **color** border variant+- The color of the chosen **color** border variant-- The color of chosen **size** border variant+- The color of the chosen **size** border variant-- The color of chosen **length** border variant+- The color of the chosen **length** border variant-- The color of chosen **image** border+- The color of the chosen **image** border@@ -371,7 +371,7 @@ __*$secondary-color*__ variable changes__*$secondary-color*__ variable changes-- The color of Add to bag successfully icon+- The color of the **Add to bag successfully** icon@@ -379,11 +379,11 @@ Log-in and Sign-in page__*$secondary-color*__ variable changes-- The color of **Remember me** checkbox+- The color of the **Remember me** checkbox-- The color of **input: focus**+- The color of the **input: focus**@@ -391,19 +391,19 @@ __*$secondary-color*__ variable changes__*$secondary-color*__ variable changes-- The color of **individual steps** (box, name step and guide line) - this element remain the same across whole checkout process+- The color of **individual steps** (box, name step, and guideline) - this element remains the same across the whole checkout process-#### Checkout - Address Step+#### Checkout - Address step__*$secondary-color*__ variable changes-- The color of Use shipping address checkbox+- The color of the **Use shipping address** checkbox-#### Checkout - Delivery Step+#### Checkout - Delivery step__*$secondary-color*__ variable changes@@ -411,7 +411,7 @@ __*$secondary-color*__ variable changes-#### Checkout - Payment Step+#### Checkout - Payment step__*$secondary-color*__ variable changes@@ -427,13 +427,13 @@ __*$secondary-color*__ variable changes__*$secondary-color*__ variable changes-- The color of **successful checkmark** icon+- The color of the **successful checkmark** icon### Grid breakpoints-[Grid breakpoint variable](https://github.com/spree/spree/blob/master/frontend/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss) allow you to slightly change element sizes on various devices - mostly images and their scale ratio. Feel free to learn more from the [Bootstrap manual](https://getbootstrap.com/docs/4.0/layout/grid/). We don’t recommend changing these values unless you really need to.+[Grid breakpoint variable](https://github.com/spree/spree/blob/master/frontend/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss) allows you to slightly change element sizes on various devices. These changes are mostly to images and their scale ratio. Feel free to learn more from the [Bootstrap manual](https://getbootstrap.com/docs/4.0/layout/grid/), though we don’t recommend changing these values unless you really need to.### Rounding for components@@ -467,7 +467,7 @@ Feel free to customize header and footer elements as outlined below.### Logo replacement-In order to replace the default Spree logo with yours [please follow these steps](https://guides.spreecommerce.org/developer/customization/view.html#switch-storefront-logo) in the Spree guides. We do recommend using 127x52 dimensions for your logo in the SVG, PNG or JPEG formats, however, if you would like to use a higher resolution it will scale down automatically.+In order to replace the default Spree logo with your own [please follow these steps](https://guides.spreecommerce.org/developer/customization/view.html#switch-storefront-logo) in the Spree guides. We do recommend using 127x52 dimensions for your logo in the SVG, PNG or JPEG formats; however, if you use a higher resolution, it will scale down automatically.### Mega menu categories@@ -477,7 +477,7 @@ Make sure that these categories are also defined in the Admin panel on your site### Social media icons in the footer-Replace social media URLs with yours in the Spree admin panel by going to Configuration > Stores and editing (pencil icon) your store settings in the Social section.+Replace social media URLs with your own in the Spree admin panel by going to Configuration > Stores and editing (pencil icon) your store settings in the Social section.Make sure to place the part of the URL trailing after .com/, for example:@@ -485,7 +485,7 @@ Make sure to place the part of the URL trailing after .com/, for example:You don’t have to use any slashes.-If you leave any of the Social fields empty the corresponding social media icon will disappear.+If you leave any of the **Social** fields empty the corresponding social media icon will disappear.After setting the values you want just click the "Update" button at the bottom of the page. Then go toConfiguration > General Settings and click the "Clear cache" button to see your updates on the frontend.@@ -498,69 +498,66 @@ The footer contains a “Contact us” section with your store contact informati### Product categories in the footer-The footer by default contains a list of product categories in your store. Feel free to change the contents of this section in the **config/spree_storefront.yml**. The file is automatically copied to your application after running Spree installer.+The footer by default contains a list of product categories in your store. Feel free to change the contents of this section in the **config/spree_storefront.yml**. The file is automatically copied to your application after running the Spree installer.## Replacing placeholders with your images and copy-You will need to replace promo banner placeholder images as well as some text (buttons, promo banners) with your own:+You will need to replace various promo banner placeholder images, text, and buttons with your own. These changes are necessary on the homepage and on the following promo banners (each in four sizes listed on the following pages for various devices):-- on the homepage- - multiple promo banners described below (each in 4 sizes listed on the following pages for various devices)- - text on the main promo banner (“Summer Collection” and “SHOP NOW” button), descriptions on all three category banners, slider title- (“BESTSELLERS”, “TRENDING”), mid-page promo block (“FASHION TRENDS”), bottom promo banners (“STREETSTYLE”, “UP TO 60%”)-- product listing page - one category promo banner-- meganav menu - two promo banners for each main category+- The main promo banner ("Summer Collection" and "SHOP NOW" button), as well as descriptions on all three category banners. These are the slider title ("BESTSELLERS", "TRENDING"), the mid-page promo block ("FASHION TRENDS"), and the bottom promo banners ("STREETSTYLE", "UP TO 60%")+- One category promo banner on the product listing page+- Two promo banners for each main category on the meganav menu### Homepage placeholder slots-In the screenshot below you’ll find homepage promo banner slots with the default image placeholders indicating desktop placeholder sizes in pixels. Please note that each of these placeholders requires 4 images for various devices listed below. This is just a desktop example.+In the screenshot below you’ll find homepage promo banner slots with the default image placeholders indicating desktop placeholder sizes in pixels. Please note that each of these placeholders requires four images for the various devices listed below. This is just the example for desktops.Homepage text values may be replaced in your project repository in the /app/views/spree/home/index.html.erb. Please note that this file will be automatically copied to your project directory after running Spree installer.-You’ll need to upload 4 sizes for each of these promo banners:+You’ll need to upload four sizes for each of these promo banners:#### Main banner-- Main banner **1440 x 600** (this is a desktop file)-- Main banner mobile **575 x 240** (this is a mobile file)-- Main banner tablet landscape **992 x 413** (this is a tablet landscape file)-- Main banner tablet portrait **768 x 320** (this is a tablet portrait file)+- Main banner **1440 x 600** (desktop file)+- Main banner mobile **575 x 240** (mobile file)+- Main banner tablet landscape **992 x 413** (tablet landscape file)+- Main banner tablet portrait **768 x 320** (tablet portrait file)#### Big category banner-- Big category banner **540 x 800** (this is a desktop file)-- Big category banner mobile **262 x 388** (this is a mobile file)-- Big category banner tablet landscape **470 x 696** (this is a tablet landscape file)-- Big category banner tablet portrait **358 x 530** (this is a tablet portrait file)+- Big category banner **540 x 800** (desktop file)+- Big category banner mobile **262 x 388** (mobile file)+- Big category banner tablet landscape **470 x 696** (tablet landscape file)+- Big category banner tablet portrait **358 x 530** (tablet portrait file)#### Upper and lower category banner-- Category banner **540 x 388** (this is a desktop file)-- Category banner mobile **262 x 188** (this is a mobile file)-- Category banner tablet landscape **470 x 338** (this is a tablet landscape file)-- Category banner tablet portrait **358 x 257** (this is a tablet portrait file)+- Category banner **540 x 388** (desktop file)+- Category banner mobile **262 x 188** (mobile file)+- Category banner tablet landscape **470 x 338** (tablet landscape file)+- Category banner tablet portrait **358 x 257** (tablet portrait file)#### Left and right promotion banners-- Promo banner **540 x 350** (this is a desktop file)-- Promo banner mobile **542 x 351** (this is a mobile file)-- Promo banner tablet landscape **470 x 305** (this is a tablet landscape file)-- Promo banner tablet portrait **734 x 476** (this is a tablet portrait file)+- Promo banner **540 x 350** (desktop file)+- Promo banner mobile **542 x 351** (mobile file)+- Promo banner tablet landscape **470 x 305** (tablet landscape file)+- Promo banner tablet portrait **734 x 476** (tablet portrait file)Please find all the [placeholder images and their size variations in this Google Drive folder](https://drive.google.com/drive/folders/1lbUMNFB2jcwpx4Jpr9uVLd_lUGw9GpVJ) for your reference.In order to replace those placeholder images you will probably want to perform two operations:- change the file names in the `app/views/spree/home/index.html.erb` in your project repository-- upload those images to your Spree project code repo into `app/assets/images/homepage` folder. The files are automatically copied to your application folder after running Spree installer, preserving the file name structure and just changing `big_category_banner` to your file name:+- upload those images to your Spree project code repo into the `app/assets/images/homepage` folder. The files are automatically copied to your application folder after running the Spree installer, preserving the file name structure and just changing `big_category_banner` to your file name:- `big_category_banner.jpg`- `big_category_banner_mobile.jpg`- `big_category_banner_tablet_landscape.jpg`- `big_category_banner_tablet_portrait.jpg`-Those file names will be used in the srcset attribute which specifies the URL of the image to use for various screen sizes and orientations.+Such file names will be used in the srcset attribute which specifies the URL of the image to use for various screen sizes and orientations.-If you’d like to change the file names in the `app/views/spree/home/index.html.erb` please find below line number where to place new image files names.+If you’d like to change the file names in the `app/views/spree/home/index.html.erb`, please find below the line number where new image file names can be placed.**Main banner code lines**@@ -644,53 +641,53 @@ data-srcset="<%= image_source_set('homepage/promo_banner_right') %>"### Category banner on PLP-Category product listing page (PLP) banner is displayed on the top of each product category. You need to upload just one such promo banner sized 1110 x 300 px through the admin panel. To do that in the Spree admin panel go to Products > Taxonomies and edit the category for which you’d like to replace an image.+The category product listing page (PLP) banner is displayed on the top of each product category. You need to upload just one such promo banner, sized 1110 x 300 px, through the admin panel. To do that in the Spree admin panel, go to Products > Taxonomies and edit the category for which you’d like to replace an image.### Product images-Add a product image for each product in just one resolution (650 x 870) using the admin panel. Here’s a full explanation of how [to edit your products](/user/products/creating_products.html#images) in the Spree guides.+Add a product image for each product in just one resolution (650 x 870) using the admin panel. See a full explanation of how [to edit your products](/user/products/creating_products.html#images) in the Spree guides.-That single product image will be automatically resized into multiple files and its variations appropriate for the user’s device will be used in the homepage carousels, on the product listing page (PLP), product detail page (PDP), cart pop-up, in the cart and order confirmation page.+The single product image will be automatically resized into multiple files and variations appropriate for different user devices will be utilized in the homepage carousels, on the product listing page (PLP), product detail page (PDP), cart pop-up, in the cart and order confirmation page.### Mega menu-In order to modify category promo banners in the Mega nav menu (by default New Collection and Special Offers) you have to modify **spree_storefront.yml**. The file is automatically copied to your application after running Spree installer.+In order to modify category promo banners in the Mega nav menu (by default New Collection and Special Offers) you have to modify **spree_storefront.yml**. The file is automatically copied to your application after running the Spree installer.## SEO recommendations### Sitemap-We highly recommend adding a sitemap to your site. It might affect how Google bot crawls your store pages. There is + an official extension [Spree Sitemap](https://github.com/spree-contrib/spree_sitemap) for that exact purpose.+We highly recommend adding a sitemap to your site. It might affect how Google bot crawls your store pages. There is an official extension called [Spree Sitemap](https://github.com/spree-contrib/spree_sitemap) for that exact purpose.-1. per region, language or currency-2. click the Edit button (indicated with a pencil icon) for the right store,-3. enter title, keywords and description values for that store homepage-4. click the Update button at the bottom of the page+1. Per region, language or currency+2. Click the **Edit** button (indicated with a pencil icon) for the right store+3. Enter a title, keywords, and description values for the store homepage+4. Click the **Update** button at the bottom of the page-To set title, meta keywords and description for each store **category page (PLP)**, in the admin panel:+To set the title, meta keywords, and description for each store **category page (PLP)**, in the admin panel:-1. go to **Products > Taxonomies**-2. go into a Categories list by pressing the Edit button (pencil icon)-3. pick the category you’d like to edit by right-clicking (control + click on a Mac) a child in the tree to access the menu for adding, deleting or sorting a child.+1. Go to **Products > Taxonomies**+2. Go into the Categories list by pressing the **Edit** button (pencil icon)+3. Pick the category you’d like to edit by right-clicking (control + click on a Mac) a child in the tree to access the menu for adding, deleting or sorting a child.-4. click the Edit link for that category-5. replace the default values for title, meta keywords and description with your own-6. click the Update button at the bottom of the page+4. Click the **Edit** link for that category+5. Replace the default values for title, meta keywords, and description with your own+6. Click the **Update** button at the bottom of the pageYou’ll have to edit every category and subcategory to your liking in a similar fashion.-To set title, meta keywords and description for each **product page (PDP)**, in the admin panel:+To set the title, meta keywords and description for each **product page (PDP)**, in the admin panel:-7. go to **Products > Products**-8. in the product list pick the right one by pressing the Edit button (pencil icon)-9. while in the Details tab, scroll down and place your values for title, meta keywords and description-10. click the Update button at the bottom of the page+7. Go to **Products > Products**+8. In the product list pick the right one by pressing the **Edit** button (pencil icon)+9. While in the Details tab, scroll down and input your values for the title, meta keywords, and description+10. Click the **Update** button at the bottom of the page@@ -698,7 +695,7 @@ To set title, meta keywords and description for each **product page (PDP)**, inThe new Spree UX has the following social sharing features implemented:-- Facebook sharing with [Open Graph tags](https://ogp.me/) to enable a nice page preview+- Facebook sharing with [Open Graph tags](https://ogp.me/) to enable an attractive page preview- Google visibility with structured data using [Schema.org](http://schema.org/) with [JSON-DL](https://json-ld.org/)Feel free to [test the Open Graph tags implementation](https://developers.facebook.com/tools/debug/) and the also [test the Schema.org implementation](https://search.google.com/structured-data/testing-tool/u/0/) for your store.