Skip to content

Commit

Permalink
Issue 9680: Use parent name for variations
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalBrouwers committed May 18, 2017
1 parent d7c7b6b commit c198a1f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ define([
var productSku = this.variationsComponent().getProductValue('sku'),
productPrice = this.variationsComponent().getProductPrice(),
productWeight = this.variationsComponent().getProductValue('weight'),
productName = this.variationsComponent().getProductValue('name'),
variationsKeys = [],
gridExisting = [],
gridNew = [],
gridDeleted = [];

this.variations = [];
_.each(variations, function (options) {
var product, images, sku, quantity, price, variation,
var product, images, sku, name, quantity, price, variation,
productId = this.variationsComponent().getProductIdByOptions(options);

if (productId) {
Expand All @@ -110,6 +111,9 @@ define([
sku = productSku + _.reduce(options, function (memo, option) {
return memo + '-' + option.label;
}, '');
name = productName + _.reduce(options, function (memo, option) {
return memo + '-' + option.label;
}, '');
quantity = getSectionValue('quantity', options);

if (!quantity && productId) {
Expand All @@ -128,7 +132,7 @@ define([
options: options,
images: images,
sku: sku,
name: sku,
name: name,
quantity: quantity,
price: price,
productId: productId,
Expand Down

0 comments on commit c198a1f

Please sign in to comment.