使用Magento2.1.0-rc1分支与样本数据
使用REST API catalogProductRepositoryV1 REF:http://devdocs.magento.com/swagger/index.html 从管理令牌API获取密钥并使用该密钥
POST/V1 /产品
&
PUT/V1/products/{sku}
with参数尝试逐个参数
{
"saveOptions": "true",
"product": {
"name": "Test11_11",
"sku": "TESTOPP_111",
"attributeSetId": "15",
"price": "10",
"weight": "10",
"status": "1",
"visibility": "3",
"customAttributes": [
{
"attributeCode": "manufacturer",
"value": "222"
},
{
"attributeCode": "tax_class_id",
"value": "0"
},
{
"attributeCode": "specialPrice",
"value": "10"
},
{
"attributeCode": "description",
"value": "44332211"
},
{
"attributeCode": "eco_collection",
"value": "1"
}
],
"typeId": "simple"
}
}Run Code Online (Sandbox Code Playgroud)
不支持store_id/storeId字段,但产品中的信息不保存以存储它保存到默认的Store ID
GET/V1/products有参数storeId和PUT&POST一样,但没有使用PUT&POST
更新至最新的Magento 2.2.5
索引:catalogsearch_fulltext永远不会完成.
目录尺寸: -
Store View: 10
Category: 33K
Products: 300K
Run Code Online (Sandbox Code Playgroud)
以下索引需要花费大量时间(2 + hr)才能完成:
catalog_product_category
catalog_product_attribute
Run Code Online (Sandbox Code Playgroud)
并且索引永远不会完成
catalogsearch_fulltext
Run Code Online (Sandbox Code Playgroud)
使用Mirasvit的弹性搜索.
Totak Mysql数据库大小= ~30 + GB
仍然没有索引的结果
当我尝试更新通过REST V1 API创建的产品时,只会为de default网站更新值.不幸的是,我找不到在te json中发送网站ID的任何可能性.以前有没有人经历过这个?
我发送更新到/ V1/products/123456的数据:
{"product":{"sku":"123456","name":"D4D0123299","price":21,"type_id":"simple","custom_attributes":[],"extension_attributes":{"stock_item":{"use_config_manage_stock":1}}}}"
Run Code Online (Sandbox Code Playgroud)
将产品链接到特定网站后,通过/ V1 /产品创建第二个请求到/ V1/products/123456 /网站(POST),使用此数据foreach网站:
"{"productWebsiteLink":{"sku":"D4D01232","websiteId":1}}"
"{"productWebsiteLink":{"sku":"D4D01232","websiteId":2}}"
Run Code Online (Sandbox Code Playgroud)
在Magento的2版本是2.1.0