Outlet WP: differenze tra le versioni
Da Webmobili Wiki.
| Riga 24: | Riga 24: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Bisognerà poi andare a configurare tutti i campi mancanti dalla BO di Dokan come:</br> | |||
'''Store Name''' e altre info del negozio. | |||
=== Products === | === Products === | ||
Versione delle 11:21, 28 ott 2022
DOKAN Multi-Vendor
Pagina ufficiale https://wedevs.com/
REST API DOKAN
Link alla documentazione per le REST API https://wedevsofficial.github.io/dokan/
Vendors
Di default un nuovo Vendor non può pubblicare direttamente i suoi prodotti, ma deve attendere una revisione.
Possiamo cambiare questo comportamento nel menu di gestione Utenti alla voce Publishing -> Publish product directly.
Per creare un utente Vendor.
POST -> /wp-json/wp/v2/users
{
"username": "slm001",
"email": "salumi@gnam.prova",
"password": "650",
"roles": "seller"
}
Bisognerà poi andare a configurare tutti i campi mancanti dalla BO di Dokan come:
Store Name e altre info del negozio.
Products
Per aggiungere un prodotto ad un Vendor, dobbiamo chiamare la seguente API autenticati con i dati del vendor.
POST -> /wp-json/dokan/v1/products/
{
"name": "Sedia chiappona",
"type": "simple",
"regular_price": "299",
"description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
"categories": [
{
"id": 67
}
],
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg",
"position": 0
}
]
}