prestashop nextjs13
1.0.0
該項目仍在開發中,缺少功能,很快就會添加
這是當前狀態下項目的預覽
PS_URI=http://www.example.it
PS_API_KEY=THEPRESTASHOPWEBSERVICEKEY
npm install
npm run dev
您可以使用模型進行API調用,這是一個示例:
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 (<div>
{products.map((product) => (
<div key={product.id}>
<div>{product.name}</div>
<div>{product.price_normal}</div>
<div>{product.price_reduced}</div>
</div>
))}
</div>);
}
您可以在Prestashop 8文檔中找到所有型號的列表:https://devdocs.prestashop-project.org/8/webservice/webservice/Resources/