Skip to content

armgit / spree

Public Imported from GitHub
0

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.

Fix: address review findings in the customization docs

Damian Legawiec71a7bf93ecf4
diff --git a/docs/developer/core-concepts/architecture.mdx b/docs/developer/core-concepts/architecture.mdx
index 2beafd221c..74bace0ddd 100644
--- a/docs/developer/core-concepts/architecture.mdx
+++ b/docs/developer/core-concepts/architecture.mdx
@@ -5,7 +5,7 @@ description: How Spree fits together — the catalog, the cart, the order, and f
## Overview
-Spree is a commerce engine you drive through a REST API. It holds the catalog, works out what a customer owes, takes the money, and tracks what was delivered. You build the storefront, the mobile app, Point of Sale or a internal tool on top of it.
+Spree is a commerce engine you drive through a REST API. It holds the catalog, works out what a customer owes, takes the money, and tracks what was delivered. You build the storefront, the mobile app, Point of Sale or an internal tool on top of it.
There is no built-in storefront you have to accept, however we do provide a [reference one built in Next.js](/developer/storefront/nextjs/quickstart).
Everything a customer-facing app needs is on the Store API, and everything a back office needs is on the Admin API. Both ship as fully typed TypeScript clients.
@@ -156,4 +156,4 @@ Two ways in, depending on how you prefer to learn.
</Card>
</CardGroup>
-Building a storefront rather than extending the backend? Go straight to the the [Spree Next.js Storefront](/developer/storefront/nextjs/quickstart).
+Building a storefront rather than extending the backend? Go straight to the [Spree Next.js Storefront](/developer/storefront/nextjs/quickstart).
diff --git a/docs/developer/core-concepts/metafields.mdx b/docs/developer/core-concepts/metafields.mdx
index 7b1cf4bcdb..99225e31e0 100644
--- a/docs/developer/core-concepts/metafields.mdx
+++ b/docs/developer/core-concepts/metafields.mdx
@@ -9,10 +9,6 @@ Sooner or later you need to store something Spree doesn't have a field for. A fa
Custom fields are how you do that without changing the database. You declare a field once — its name, its type, who can see it — and from then on it can be set on any record of that kind, edited in the dashboard, returned by the API, and searched or filtered like any built-in field.
-<Note>
-Custom fields are also known as **custom fields** in the dashboard. The API and SDK call them custom fields throughout.
-</Note>
-
## Definitions and values
There are two halves, and it helps to keep them straight:
diff --git a/docs/developer/customization/checkout.mdx b/docs/developer/customization/checkout.mdx
index 825b3d1cf6..72b1ef7597 100644
--- a/docs/developer/customization/checkout.mdx
+++ b/docs/developer/customization/checkout.mdx
@@ -79,8 +79,9 @@ Rails.application.config.to_prepare do
end
```
-The step now appears in the cart's `checkout_steps`, its requirements show up while
-unsatisfied, and completion refuses the cart until they are met.
+The step now shows up in the cart's `current_step` and `completed_steps`, its
+requirements appear in `requirements` while unsatisfied, and completion refuses the
+cart until they are met.
Each lambda receives the cart. Placement is controlled by two keywords:
diff --git a/docs/developer/customization/configuration.mdx b/docs/developer/customization/configuration.mdx
index 1c3a2d9422..f9a6e5646d 100644
--- a/docs/developer/customization/configuration.mdx
+++ b/docs/developer/customization/configuration.mdx
@@ -3,8 +3,9 @@ title: Configuration
description: Every Spree setting, the environment variable that sets it, and what it changes.
---
-All business configuration can be performaed fromm the Admin Dashboard.What is left is a small set of settings describing the *installation*: limits,
-expiries, and where things are hosted. **Every one of them is set with an environment
+All business configuration is done in the Admin Dashboard. What is left here is a
+small set of settings describing the *installation*: limits, expiries, and where
+things are hosted. **Every one of them is set with an environment
variable**, so changing one is a config change rather than a code change.
```bash
diff --git a/docs/developer/customization/decorators.mdx b/docs/developer/customization/decorators.mdx
index a236b35a1b..472cc36ed8 100644
--- a/docs/developer/customization/decorators.mdx
+++ b/docs/developer/customization/decorators.mdx
@@ -310,9 +310,11 @@ module Spree::Api::V3::Admin
# `super` is already scoped to the current store. Chain onto it — never
# replace it, or the endpoint stops being scoped and starts returning
- # another store's records.
+ # another store's records. `current_user` is nil for a secret-key
+ # request, hence `&.` — a caller that is not a staff member gets the
+ # narrowed scope.
def scope
- return super if current_user.spree_admin?
+ return super if current_user&.spree_admin?
super.where(discontinue_on: nil)
end