rsilva / product-filter-api
由 https://github.com/SilRodrigo 开发的产品过滤器API
1.0.2
2023-07-07 02:59 UTC
Requires
- php: >=7.4
- rsilva/base: >=1.0.0
This package is auto-updated.
Last update: 2024-09-07 05:49:07 UTC
README
概述
- 用于 Magento 2 的模块,通过API调用返回一个包含已注册产品、其分类和属性的JSON对象,这些信息基于请求参数中的过滤器。
返回示例
{
"collection": [
{
"entity_id": "1",
"sku": "teste",
"name": "teste",
"type_id": "simple",
"complete_image_url": "/media/catalog/product/p/u/image.png",
"complete_page_url": "https://rsilva.vitrine/test.html",
"price": "12.990000",
"special_price": null,
"formatted_price": "US$ 12,99",
"formatted_special_price": "US$ 0,00",
"description": ""
}
],
"total_count": 1,
"pageSize": 9,
"finalPage": 1,
"currentPage": 1,
"attributeList": [
{
"backend_type": "decimal",
"frontend_input": "Price",
"options": [
{
"identifier": "price12.990000",
"value": "12.990000",
"label": "12.990000"
}
],
"name": "price"
}
]
}
使用此模块
在您的JS类中传递服务调用
define([
'jquery',
'Rsilva_ProductFilterApi/js/service/product-api'
],function ($, productApiService) {}
按名称进行搜索的调用
* @param {string} name
* @param {Function} callback
productApiService.queryProductByName(name, callback)