🫢Sử dụng Nextjs kết nối store woocomerce, category product, graphql Example 1 (ok)

Khai báo ... on SimpleProduct, ... on VariableProduct, ... on ExternalProduct, ... on VariableProduct xem ở đây nhé!

Khai báo mutation addToCart

Source wpclidemo-dev-graphql-woocomerce

Documentarrow-up-right

Step 1.1: Create Layout && ApolloClient

next.config.ts

.env

src\utils\gql\GQL_QUERIES.ts

src\utils\apollo\ApolloClient.js

src\pages\index.tsx

src\components\Layout\Layout.component.tsx

src\components\Layout\PageTitle.component.tsx

src\components\Header\Header.component.tsx

src\components\Header\Navbar.component.tsx

Step 1.2 hoàn thiện giao diện Home Page

src\components\Header\Navbar.component.tsx

src\components\Header\Header.component.tsx

src\components\Layout\Layout.component.tsx

src\components\Layout\PageTitle.component.tsx

src\components\Product\DisplayProducts.component.tsx

src\pages\index.tsx

src\utils\functions\functions.tsx

src\utils\apollo\ApolloClient.js

src\utils\gql\GQL_QUERIES.ts

file-archive
49KB

Step 1.3 Single Product

src\components\Product\SingleProduct.component.tsx

src\pages\product\[slug].tsx

src\utils\gql\GQL_QUERIES.ts

Step 1.4 Single Product and Get Cart and Button Cart

src\utils\gql\GQL_QUERIES.ts

src\utils\gql\GQL_MUTATIONS.ts

src\utils\functions\functions.tsx

src\stores\CartProvider.tsx

src\pages\_app.tsx

src\pages\product\[slug].tsx

src\components\Header\Cart.component.tsx

src\components\Header\Header.component.tsx

src\components\Header\Navbar.component.tsx

file-archive
60KB

Step 2.1 Categories

src\pages\categories.tsx

Step 2.2 Category Deatail

src\utils\gql\GQL_QUERIES.ts

src\pages\category[slug].tsx

Step 3.1 Shop

src\pages\shop.tsx

src\pages\shop.tsx

src\hooks\useProductFilters.ts

src\components\Product\ProductCard.component.tsx

src\components\Product\ProductFilters.component.tsx

src\components\Product\ProductList.component.tsx

src\components\UI\Checkbox.component.tsx

src\components\UI\RangeSlider.component.tsx

src\hooks\useProductFilters.ts

src\styles\globals.css

src\types\product.ts

src\utils\functions\productUtils.ts

src\utils\gql\GQL_MUTATIONS.ts

src\utils\gql\GQL_QUERIES.ts

.env

next.config.ts

package.json

file-archive
70KB

Last updated

Was this helpful?