Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 46 | All time: 10,782 This week: 43 |
Version | License | PHP version | Categories | |||
ade-woocart 1.0.1 | The PHP License | 5 | PHP 5, E-Commerce, Content management, W... |
This plugin helps you to create a cart for your WooCommerce store through API.
Add a cart
- Endpoint: `http://yourdomain.com/wp-json/ade-woocart/v1/cart`
- Method: `POST`
- Body:
{
"product_id": 248,
"quantity": 3
}
- Response:
[
{
"key": "b53b3a3d6ab90ce0268229151c9bde11",
"product_id": 55,
"product_name": "test",
"product_price": "500",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/09/dartcourse-150x150.png",
"quantity": 3
},
{
"key": "3cec07e9ba5f5bb252d13f5f431e4bbb",
"product_id": 247,
"product_name": "Product 2",
"product_price": "4000",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/10/306309967_205687448454197_8999579521544198312_n-150x150.jpg",
"quantity": 1
},
{
"key": "621bf66ddb7c962aa0d22ac97d69b793",
"product_id": 248,
"product_name": "Product 3",
"product_price": "3000",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/11/20221015_075005-150x150.jpg",
"quantity": 3
}
]
Get cart
- Endpoint: `http://yourdomain.com/wp-json/ade-woocart/v1/cart` - Method: `GET` - Response:
[
{
"key": "b53b3a3d6ab90ce0268229151c9bde11",
"product_id": 55,
"product_name": "test",
"product_price": "500",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/09/dartcourse-150x150.png",
"quantity": 3
},
{
"key": "3cec07e9ba5f5bb252d13f5f431e4bbb",
"product_id": 247,
"product_name": "Product 2",
"product_price": "4000",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/10/306309967_205687448454197_8999579521544198312_n-150x150.jpg",
"quantity": 1
}
]
Delete a cart
- Endpoint: `http://yourdomain.com/wp-json/ade-woocart/v1/cart/{cart_key}`
- Method: `DELETE`
- Response:
{
"message": "Item removed from cart",
"cart": [
{
"key": "621bf66ddb7c962aa0d22ac97d69b793",
"product_id": 248,
"product_name": "Product 3",
"product_price": "3000",
"product_image": "http://localhost:8888/wordpress2/wp-content/uploads/2022/11/20221015_075005-150x150.jpg",
"quantity": 3
}
]
}
Files (3) |
File | Role | Description | ||
---|---|---|---|---|
includes (1 file) | ||||
ade-woocart.php | Aux. | Auxiliary script | ||
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.