Skip to content

Fetch the store's product settings #807

@bummytime

Description

@bummytime

As part of the product detail screen (ref: #764 for WCiOS), @nbradbury astutely pointed out that the dimensions we are receiving from the products API doesn't have units attached to measurements. On the web, the WC settings UI contains these values:

Screen Shot 2019-03-21 at 11 06 14 AM

So much like we did for general site settings in #369, #377, and #410 we should grab the product settings via

GET https://public-api.wordpress.com/rest/v1.1/jetpack-blogs/$siteID/rest-api/?path=%2Fwc%2Fv3%2Fsettings%2Fproducts

and stash these values into Storage for use elsewhere in the app. The good news is that we all we need to do is:

  • Add a new func to SiteSettingsRemote to fetch the product settings (from that API call above) and return [SiteSetting]
  • Update SettingStore.retrieveSiteSettings() to also include the new func call in SiteSettingsRemote ☝️
  • Use the newly-captured product settings on the product detail screen

SiteSettingsMapper can be reused in the new SiteSettingsRemote func and the settings' models + Storage logic should not have to be updated since they are designed to handle generic setting objects.

Metadata

Metadata

Assignees

Labels

feature: app settingsRelated to settings accessed via the gear icon in the My Store section.feature: product detailsRelated to adding or editing products, including Product Settings.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions