0

I have a product created in M2 and I create a new product attributes, and when we make an update with c# app using REST Call. In this case the new added attributes are empty in edit product page with "Store View" configured on "All Store Views". But when I switch to "Default Stotre View" we get values in those fields. The problem is when I delete this product and I recreate it with REST Call, I haven't those empty attributes.(that's work correctly)

I don't know if that's normal or not in Magento or how to fix that?

this is some snapshot to explain my issue:

In catalog product page those fields have values enter image description here

when I edit this product on all Store Views mode, the new attributes are empty enter image description here

now I switch to Default Store View enter image description here

And now in Default Store View, we have our values enter image description here

0

it would be important to know, to which endpoint exactly you are sending the request.

But if I understand you correctly, we might have had a similar issue.

The Product overview in the backend shows the values of the defined default store view (under Stores -> All Stores) which can be confusing, because the product edit page initially shows the values of the default scope (which is not equal to the default store view).

Magento has a fallback mechanism for these values from default scope -> website scope -> store group scope -> store view scope

If you send something to /rest/V1/products it will be saved in the default store view (tbh., not 100% sure on this one). This is also shown in the overview, but it's not the default (global) scope, which is shown initially in the product edit page.

If you want to save something in the default (global) scope for a product, send it to /rest/all/V1/products. This will save the value(s) in the default (global) scope.

If you want to edit / save a value for a specific store view (mostly used for translations), you send it to /rest/<store_view_code>/V1/products

So in conclusion, sending something to the rest api without the "all" keyword or a store code is mostly just confusing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.