Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andreapossidente/prestashop-nextjs13


https://github.com/andreapossidente/prestashop-nextjs13

contributions-welcome ecommerce next next-auth nextjs prestashop typescript

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Prestashop Next.js 13 Headless integration through Webservice API

The project is still in development, functionalities are missing and will be added soon

#### If you'd like to collaborate with the project contact me at [email protected]

Here is a preview of the project at current status
#### View Demo

## Getting Started

1. Add the needed Environment Variables into **.env.local** file:
```
PS_URI=http://www.example.it
PS_API_KEY=THEPRESTASHOPWEBSERVICEKEY
```

2. Install dependencies and start your server:
```
npm install
npm run dev
```

## Models and API Calls

You can do api calls using models, here is an example:
```
import { Product } from "./Prestashop/models";

export default async function ExampleComponent() {

// get the first 5 products from the webservice api
const products = await Product.find({}, { limit: 5 });

return (


{products.map((product) => (

{product.name}

{product.price_normal}

{product.price_reduced}


))}
);

}
```
you can find a list of all models in prestashop 8 documentation:
https://devdocs.prestashop-project.org/8/webservice/resources/