Skip to content

Commit

Permalink
Update product UPC when options are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
junedkazi committed Sep 27, 2017
1 parent 36cd7b3 commit df7229a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/js/theme/common/product-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default class ProductDetails {
$input: $('[data-product-stock]', $scope),
},
$sku: $('[data-product-sku]'),
$upc: $('[data-product-upc]'),
quantity: {
$text: $('.incrementTotal', $scope),
$input: $('[name=qty\\[\\]]', $scope),
Expand Down Expand Up @@ -370,6 +371,11 @@ export default class ProductDetails {
viewModel.$sku.text(data.sku);
}

// If UPC is available
if (data.upc) {
viewModel.$upc.text(data.upc);
}

// if stock view is on (CP settings)
if (viewModel.stock.$container.length && _.isNumber(data.stock)) {
// if the stock container is hidden, show
Expand Down

0 comments on commit df7229a

Please sign in to comment.