Skip to content

Commit e4f90a2

Browse files
authored
fix(templates): ecommerce wrong links in readme and docs and issue with missing graphql dependency (#14045)
Fixes some links in readme and docs and missing graphql dependency for npm users.
1 parent bffb9ef commit e4f90a2

File tree

4 files changed

+29
-53
lines changed

4 files changed

+29
-53
lines changed

docs/ecommerce/frontend.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ The `EcommerceProvider` component is used to wrap your application and provide t
3939
Example usage:
4040

4141
```tsx
42-
import { EcommerceProvider } from '@payloadcms/plugin-ecommerce/react'
42+
import { EcommerceProvider } from '@payloadcms/plugin-ecommerce/client/react'
4343
// Import any payment adapters you want to use on the client side
4444
import { stripeAdapterClient } from '@payloadcms/plugin-ecommerce/payments/stripe'
45-
import { USD, EUR } from '@payloadcms/plugin-ecommerce/currencies'
45+
import { USD, EUR } from '@payloadcms/plugin-ecommerce'
4646

4747
export const Providers = () => (
4848
<EcommerceProvider
@@ -117,7 +117,7 @@ The `useCart` hook is used to manage the cart state and actions. It provides met
117117
Example usage:
118118

119119
```tsx
120-
import { useCart } from '@payloadcms/plugin-ecommerce/react'
120+
import { useCart } from '@payloadcms/plugin-ecommerce/client/react'
121121

122122
const CartComponent = () => {
123123
const { addItem, cart, clearCart, decrementItem, incrementItem, removeItem } =
@@ -140,7 +140,7 @@ The `useAddresses` hook is used to fetch and manage addresses. It provides metho
140140
Example usage:
141141

142142
```tsx
143-
import { useAddresses } from '@payloadcms/plugin-ecommerce/react'
143+
import { useAddresses } from '@payloadcms/plugin-ecommerce/client/react'
144144

145145
const AddressesComponent = () => {
146146
const { addresses, createAddress, updateAddress } = useAddresses()
@@ -163,7 +163,7 @@ The `usePayments` hook is used to manage the checkout process. It provides metho
163163
Example usage:
164164

165165
```tsx
166-
import { usePayments } from '@payloadcms/plugin-ecommerce/react'
166+
import { usePayments } from '@payloadcms/plugin-ecommerce/client/react'
167167

168168
const CheckoutComponent = () => {
169169
const {
@@ -244,7 +244,7 @@ The `useCurrency` hook is used to format prices based on the selected currency.
244244
`formatPrice` in particular is very helpful as all prices are stored as integers to avoid any potential issues with decimal calculations, therefore on the frontend you can use this utility to format your price accounting for the currency and decimals. Example usage:
245245

246246
```tsx
247-
import { useCurrency } from '@payloadcms/plugin-ecommerce/react'
247+
import { useCurrency } from '@payloadcms/plugin-ecommerce/client/react'
248248

249249
const PriceComponent = ({ amount }) => {
250250
const { currenciesConfig, currency, setCurrency } = useCurrency()
@@ -260,7 +260,7 @@ The `useEcommerce` hook encompasses all of the above hooks in one. It provides a
260260
Example usage:
261261

262262
```tsx
263-
import { useEcommerce } from '@payloadcms/plugin-ecommerce/react'
263+
import { useEcommerce } from '@payloadcms/plugin-ecommerce/client/react'
264264

265265
const EcommerceComponent = () => {
266266
const { cart, addresses, selectedPaymentMethod } = useEcommerce()

pnpm-lock.yaml

Lines changed: 15 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/ecommerce/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,23 @@ See the [Collections](https://payloadcms.com/docs/configuration/collections) doc
8989

9090
- ### Carts
9191

92-
Used to track user and guest carts within Payload. Added by the [ecommerce plugin](https://payloadcms.com/docs/plugins/ecommerce#carts).
92+
Used to track user and guest carts within Payload. Added by the [ecommerce plugin](https://payloadcms.com/docs/ecommerce/plugin#carts).
9393

9494
- ### Addresses
9595

96-
Saves user's addresses for easier checkout. Added by the [ecommerce plugin](https://payloadcms.com/docs/plugins/ecommerce#addresses).
96+
Saves user's addresses for easier checkout. Added by the [ecommerce plugin](https://payloadcms.com/docs/ecommerce/plugin#addresses).
9797

9898
- ### Orders
9999

100-
Tracks orders once a transaction successfully completes. Added by the [ecommerce plugin](https://payloadcms.com/docs/plugins/ecommerce#orders).
100+
Tracks orders once a transaction successfully completes. Added by the [ecommerce plugin](https://payloadcms.com/docs/ecommerce/plugin#orders).
101101

102102
- ### Transactions
103103

104-
Tracks transactions from initiation to completion, once completed they will have a related Order item. Added by the [ecommerce plugin](https://payloadcms.com/docs/plugins/ecommerce#transactions).
104+
Tracks transactions from initiation to completion, once completed they will have a related Order item. Added by the [ecommerce plugin](https://payloadcms.com/docs/ecommerce/plugin#transactions).
105105

106106
- ### Products and Variants
107107

108-
Primary collections for product details such as pricing per currency and optionally supports variants per product. Added by the [ecommerce plugin](https://payloadcms.com/docs/plugins/ecommerce#products).
108+
Primary collections for product details such as pricing per currency and optionally supports variants per product. Added by the [ecommerce plugin](https://payloadcms.com/docs/ecommerce/plugin#products).
109109

110110
### Globals
111111

@@ -187,7 +187,7 @@ An order is created only once a transaction is successfully completed. This is a
187187

188188
## Currencies
189189

190-
By default the template ships with support only for USD however you can change the supported currencies via the [plugin configuration](https://payloadcms.com/docs/plugins/ecommerce#currencies). You will need to ensure that the supported currencies in Payload are also configured in your Payment platforms.
190+
By default the template ships with support only for USD however you can change the supported currencies via the [plugin configuration](https://payloadcms.com/docs/ecommerce/plugin#currencies). You will need to ensure that the supported currencies in Payload are also configured in your Payment platforms.
191191

192192
## Stripe
193193

@@ -360,8 +360,6 @@ export default buildConfig({
360360
// ...
361361
```
362362
363-
There is also a simplified [one click deploy](https://github.com/payloadcms/payload/tree/templates/with-vercel-postgres) to Vercel should you need it.
364-
365363
### Self-hosting
366364
367365
Before deploying your app, you need to:

templates/ecommerce/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"embla-carousel-auto-scroll": "^8.1.5",
5050
"embla-carousel-react": "^8.5.2",
5151
"geist": "^1.3.0",
52+
"graphql": "^16.8.2",
5253
"jsonwebtoken": "9.0.1",
5354
"lucide-react": "^0.477.0",
5455
"next": "^15.5.4",

0 commit comments

Comments
 (0)