2
幾個小時後,我一直在嘗試通過SOAP V2 API創建一個具有其他屬性的產品。只要我致電catalogProductCreate,我就會添加該產品,但我通過請求發送的附加屬性設置爲空。每當我不添加額外的屬性這兩個屬性都設置爲其默認值,所以我認爲屬性正在發送和接收但沒有正確處理?我試過了所有的東西,我已經谷歌搜索,但空了。Magento SOAP V2 API - 其他屬性集爲空
這是我的代碼(C#)
catalogProductCreateEntity cpce = new catalogProductCreateEntity();
associativeEntity[] attributes = new associativeEntity[2];
attributes[0] = new associativeEntity();
attributes[0].key = "product_state1";
attributes[0].value = _stateofbox;
attributes[1] = new associativeEntity();
attributes[1].key = "product_state2";
attributes[1].value = _stateofproduct;
catalogProductAdditionalAttributesEntity additionalAttributes = new catalogProductAdditionalAttributesEntity();
additionalAttributes.single_data = attributes;
cpce.additional_attributes = additionalAttributes;
感謝您的幫助。