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.

Improve Admin helper methods documentation

Damian Legawiec40fcbe0f21a8
diff --git a/docs/developer/admin/helper-methods.mdx b/docs/developer/admin/helper-methods.mdx
index 389b74f8c6..adfb6341d4 100644
--- a/docs/developer/admin/helper-methods.mdx
+++ b/docs/developer/admin/helper-methods.mdx
@@ -3,6 +3,9 @@ title: Admin Dashboard Helper Methods
sidebarTitle: Helper Methods
---
+import SpreeStore from '/snippets/objects/spree_store.mdx'
+import SpreeVendor from '/snippets/objects/spree_vendor.mdx'
+
Here you can find a list of helper methods that are available in the Admin Dashboard that you can use in every template.
<Warning>
@@ -78,23 +81,21 @@ USD
## `current_store`
-Returns the current store [Spree::Store](https://github.com/spree/spree/blob/master/core/app/models/spree/store.rb) instance.
+<ResponseField name="current_store" type="Spree::Store" description="The current store object.">
+ <SpreeStore />
+</ResponseField>
-```erb
-<%= current_store.name %>
-```
+Returns the current store [Spree::Store](https://github.com/spree/spree/blob/master/core/app/models/spree/store.rb) instance.
## `current_vendor`
<Info>
- Only Spree Enterprise edition has this method.
+ Available only in [Spree Enterprise Edition](https://spreecommerce.com/pricing).
</Info>
-Returns the current vendor `Spree::Vendor` instance.
-
-```erb
-<%= current_vendor.name %>
-```
+<ResponseField name="current_vendor" type="Spree::Vendor" description="The current vendor object.">
+ <SpreeVendor />
+</ResponseField>
## `icon`
diff --git a/docs/snippets/objects/spree_vendor.mdx b/docs/snippets/objects/spree_vendor.mdx
new file mode 100644
index 0000000000..8d34b316e1
--- /dev/null
+++ b/docs/snippets/objects/spree_vendor.mdx
@@ -0,0 +1,16 @@
+<Expandable title="Properties">
+ <ResponseField name="id" type="integer">
+ Unique vendor identifier
+ Example: `1`
+ </ResponseField>
+
+ <ResponseField name="name" type="string">
+ Vendor name
+ Example: "My Vendor"
+ </ResponseField>
+
+ <ResponseField name="state" type="string">
+ Vendor state/status
+ Example: `active`
+ </ResponseField>
+</Expandable>