Profile: comichael

Statistics
Avatar
  • 27

Thx for feedback.

OK, so we’re trying the simple solution first: Update using POST to our store API http://[OUR_DOMAIN]/odata/product , with similar JSON as received from GET.

However, the POST gives a 400 Bad Request result. We have not implemented SSL yet so just using http.

I have looked at the API source code and understand that the product’s Id should be specified in the JSON, and not be part of the url, and that it needs to be POST and not PUT.

Authorization is OK using Bearer, and have checked that JSON syntax is valid. I have tried to “wrap” the JSON in different ways with curly braces and labels, but have not been able to get this to work.

I’m pasting the raw request and response from Fiddler below. Any suggestions that can help us solve this are appreciated.

Note: I have not included the contents of the Categories / Manufacturers arrays (etc) in the bottom in the request.



[code]

===========================================
REQUEST (RAW)
===========================================
POST http://[----SNIP---].no/odata/product HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6I[----SNIP----]gFN-i7WaIrY6sxLieM
Content-Type: application/json; charset=utf-8
Content-Length: 3977
Host: [----SNIP---].no

{
  "ProductType": "SimpleProduct",
  "ParentGroupedProductId": null,
  "VisibleIndividually": true,
  "Name": "CONTINENTALLLLL PREMIUMCONTACT 5",
  "SeName": "fahrenheit-451-by-ray-bradbury",
  "ShortDescription": "TESTVINNER!",
  "FullDescription": "<h4>CONTINENTAL CONTIPREMIUMCONTACT5 </h4>\r\n<ul>\r\n<li>2. plass i ADAC sommerdekktest 2018</li>\r\n<li>Testvinner GTÜ sommerdekktest 2017</li>\r\n<li>Andreplass Aftonbladets sommerdekktest 2017</li>\r\n<li>Testvinner ADAC sommerdekktest 2016</li>\r\n<li>Tredjeplass på sommerdekktestet til NAF 2016</li>\r\n</ul>",
  "AdminComment": null,
  "ProductTemplateId": "5c6697123945712d04312bdf",
  "VendorId": null,
  "ShowOnHomePage": false,
  "MetaKeywords": null,
  "MetaDescription": null,
  "MetaTitle": null,
  "AllowCustomerReviews": true,
  "ApprovedRatingSum": 4,
  "NotApprovedRatingSum": 0,
  "ApprovedTotalReviews": 1,
  "NotApprovedTotalReviews": 0,
  "ExternalId": null,
  "Sku": "TTPAH45-0S11S",
  "ManufacturerPartNumber": null,
  "Gtin": null,
  "IsGiftCard": false,
  "GiftCardType": "Virtual",
  "OverriddenGiftCardAmount": null,
  "RequireOtherProducts": false,
  "RequiredProductIds": null,
  "AutomaticallyAddRequiredProducts": false,
  "IsDownload": false,
  "DownloadId": null,
  "UnlimitedDownloads": false,
  "DownloadActivationType": "WhenOrderIsPaid",
  "MaxNumberOfDownloads": 0,
  "DownloadExpirationDays": null,
  "HasSampleDownload": false,
  "SampleDownloadId": null,
  "HasUserAgreement": false,
  "UserAgreementText": null,
  "IsRecurring": false,
  "RecurringCycleLength": 0,
  "RecurringTotalCycles": 0,
  "RecurringCyclePeriod": "Days",
  "IncBothDate": false,
  "Interval": 0,
  "IntervalUnitType": "Minute",
  "IsShipEnabled": true,
  "IsFreeShipping": true,
  "ShipSeparately": false,
  "AdditionalShippingCharge": 0,
  "DeliveryDateId": null,
  "IsTaxExempt": false,
  "TaxCategoryId": "5c66970e3945712d0430e81e",
  "IsTelecommunicationsOrBroadcastingOrElectronicServices": false,
  "UseMultipleWarehouses": false,
  "WarehouseId": null,
  "StockQuantity": 9996,
  "ManageInventoryMethod": "ManageStock",
  "DisplayStockAvailability": true,
  "DisplayStockQuantity": false,
  "MinStockQuantity": 0,
  "LowStock": false,
  "LowStockActivity": "DisableBuyButton",
  "NotifyAdminForQuantityBelow": 1,
  "BackorderMode": "NoBackorders",
  "AllowBackInStockSubscriptions": false,
  "OrderMinimumQuantity": 1,
  "OrderMaximumQuantity": 10000,
  "AllowedQuantities": null,
  "AllowAddingOnlyExistingAttributeCombinations": false,
  "NotReturnable": false,
  "DisableBuyButton": false,
  "DisableWishlistButton": false,
  "AvailableForPreOrder": false,
  "PreOrd

Thursday, March 21, 2019 5:02 PM

What is the minimal JSON neccessary for updating a product via the API?

The documentation states:

you must enter all fields that exist and enter the ID of product which you want update

Is the solution to load the existing product object from the API and use that for modifications?

Tuesday, March 19, 2019 6:57 PM

If so, what are these differences, and which modifications would be needed in code?

Example: Payment plugin is used in nopCommerce, must be able to use in GrandNode implementation.

Tuesday, March 5, 2019 1:04 AM

Thanks a lot! Been stuck with this for days, changing this setting was the solution.

Thursday, February 21, 2019 11:07 AM

Thx for your replies. This works fine out of the box - your first answer made me realize that this is just a "dev problem". I just need to log in as different users when running from Visual Studio, so that the front-end user language won't affect the current backend language.

(Sidenote: A lot of translations in the Norwegian lang file are obviously machine-translated. We have imporoved some 100s of incorrect translations, and will probably continue to do so. When our translations are done, we'll be happy to share this as a continous open source file.)

Thursday, February 21, 2019 11:00 AM

Hi.

In category page or search result page, filter for specification attributes does not appear.

Done so far:

-Multiple spec attributes are defined
-Spec attributes added to multiple products (in Spec Attributes tab on Prroduct Edit page)
-Products are linked to same category (in Mappings tab on Product Edit page)
-"Allow Filtering" is checked for all attributes
-Tested both checked and unchecked "Show on product page"
-In mappings, "Is featured product" is not checked.

In CatalogPagingFilteringModel.PrepareSpecsFilters(..) , allFilters is null (e.g, not found in cache). We have not had time to do any further debugging.

Any suggestions?



Tuesday, February 19, 2019 11:06 PM

Basically I miss the opportunity keep english in admin even if the store lang is changed.

There are many scenarios where this is useful, but I'll keep it short.

Is there any option for this? If not, how could it most easlily be fixed in code?

Friday, February 15, 2019 9:56 PM