Skip to content

Commit

Permalink
Merge pull request #13026 from woocommerce/issue/13025-product-global…
Browse files Browse the repository at this point in the history
…-unique-id-product-details

[Product Global Unique Id] Show values in product/variation details
  • Loading branch information
toupper authored Dec 2, 2024
2 parents 509b9c9 + dfbbf55 commit 4a8ef34
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ class ProductDetailCardBuilder(
inventory[resources.getString(string.product_sku)] = this.sku
}

if (this.globalUniqueId.isNotEmpty()) {
inventory[resources.getString(string.product_global_unique_id)] = this.globalUniqueId
}

if (productType == SIMPLE || productType == VARIABLE) {
if (this.isStockManaged) {
inventory[resources.getString(string.product_stock_quantity)] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,13 @@ class VariationDetailCardBuilder(
StringUtils.formatCountDecimal(this.stockQuantity)

),
Pair(resources.getString(R.string.product_sku), this.sku)
Pair(resources.getString(R.string.product_sku), this.sku),
Pair(resources.getString(R.string.product_global_unique_id), this.globalUniqueId)
)

this.sku.isNotEmpty() -> mapOf(
Pair(resources.getString(R.string.product_sku), this.sku),
Pair(resources.getString(R.string.product_global_unique_id), this.globalUniqueId),
Pair(
resources.getString(R.string.product_stock_status),
ProductStockStatus.stockStatusToDisplayString(resources, this.stockStatus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
android:layout_marginStart="@dimen/major_100"
android:layout_marginTop="@dimen/major_75"
android:layout_marginEnd="@dimen/major_100"
android:hint="@string/product_global_unique_id_hint"
android:hint="@string/product_global_unique_id"
android:inputType="text"
android:paddingBottom="@dimen/major_75"
app:helperText="@string/product_global_unique_id_summary"
Expand Down
2 changes: 1 addition & 1 deletion WooCommerce/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@
<string name="product_tax_status_taxable">Taxable</string>
<string name="product_tax_status_shipping">Shipping</string>
<string name="product_sku">SKU</string>
<string name="product_global_unique_id_hint">GTIN, UPC, EAN, ISBN</string>
<string name="product_global_unique_id">GTIN, UPC, EAN, ISBN</string>
<string name="product_sku_summary">Helps to easily identify this product</string>
<string name="product_global_unique_id_summary">Enter a barcode or any other identifier unique to this product. It can help you list this product on other channels or marketplaces.</string>
<string name="product_stock_status">Stock status</string>
Expand Down

0 comments on commit 4a8ef34

Please sign in to comment.