magento / catalog-storefront

Open Software License 3.0
7 stars 18 forks source link

Configurable product is missing its variants data #51

Open nrkapoor opened 4 years ago

nrkapoor commented 4 years ago

Looking at Capezio and CatBirds production catalog data that are received by our Catalog service, it was discovered that many of the configurable products are missing its Variants data. 

Without Variants data in the configurable product, our Search POC project is unable to properly find information about variants. 

Acceptance Criteria

 For example:

This simple product has 829W as its parent (configurable product).

{{ "id": "T0RJNVZ5MURRVWt4TVUwX2RYTV9OakZoTkRneU1UWXROalE0TkMwMFlUTm1MV0kwTXpBdFlUQXlPVEZoTm1aak1EWTI", "mageId": "MAG002247678", "instanceId": "cf1f41bf-eea8-45b0-bffa-500209f8e804", "websiteCode": "us_website", "storeCode": "us_store", "storeViewCode": "us", "sku": "829W-CAI11M", "type": "simple", "lastModifiedTs": "2020-03-16T13:32:01Z", "lastExportTs": "2020-03-16T13:32:03.062Z", "lastPublishedTs": "2020-03-16T13:32:03.062Z", "lastUpdatedTs": "2020-03-01T23:54:48Z", "priceHash": "622507ed", "oosHash": "8a3bb795", "contentHash": "4ea0aea1", "productHash": "d9fb82ce", "name": "2.5\" Charlotte Character Shoe", "description": "<h2><strong>Italian Handcrafted Y-Strap Charlotte Character Shoe </strong></h2><br /><p>Fan kick like a pro in the Charlotte Character Shoe. Features a non-slip heel with leather top lift that creates extra stability and a larger strike zone. Special designed Y-Strap provides a wide range of motion. Slim buckle closure eliminates the worry of the character shoe slipping off during an intense performance.</p><br /><h3><strong>Product Features:</strong></h3><br /><ul><br /><li>Full grain Nappa leather upper</li><br /><li>Suede sole</li><br /><li>Cushioned lining molds to foot</li><br /><li>Leather buckle</li><br /><li>Rounded toe box</li><br /><li>Modern Y strap</li><br /><li>Contoured Broadway style 2.5\" heel with leather top lift</li><br /><li>Begin with street shoe size</li><br /></ul>", "shortDescription": null, "urlKey": "", "url": "https://www.capezio.com/charlotte-25-charlotte-chai-11m-1", "metaDescription": null, "metaKeyword": null, "metaTitle": null, "linksExist": false, "linksTitle": null, "linksPurchasedSeparately": false, "taxClassId": "Taxable Goods", "weight": 1.4, "weightType": null, "image": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/f71c5f67374cf93bf50f823a37fc2a3f/c/a/capezio_25_charlotte_character_shoe_chai_829w.jpg", "label": null }, "smallImage": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/2a5aa275c6c2e762ebaebdada76a24e9/c/a/capezio_25_charlotte_character_shoe_chai_829w.jpg", "label": null }, "thumbnailImage": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/eafa19e0e91a04c9629f7ad085f13b5a/c/a/capezio_25_charlotte_character_shoe_chai_829w.jpg", "label": null }, "swatchImage": null, "mediaGallery": [], "attributes": [ { "name": "amazon_3p", "values": [ "No" ] }, { "name": "asin1", "values": [ "B0764LR5XN" ] }, { "name": "attr_3p", "values": [ "Animal Hot Pink" ] }, { "name": "automation_category", "values": [ "Women Character Shoes" ] }, { "name": "color", "values": [ "Tan" ] }, { "name": "ebay_3p", "values": [ "Yes" ] }, { "name": "eu_shoe_size", "values": [ "42.5" ] }, { "name": "shoes_color", "values": [ "Chai" ] }, { "name": "shoes_size", "values": [ "11" ] }, { "name": "shoes_width", "values": [ "M" ] }, { "name": "uk_shoe_size", "values": [ "9" ] }, { "name": "upc", "values": [ "886275244581" ] }, { "name": "wallmart_3p", "values": [ "Yes" ] }, { "name": "walmart_product_status", "values": [ "Not-Uploaded" ] }, { "name": "walmart_product_validation", "values": [ "Not-Validated" ] }, { "name": "walmart_profile_id", "values": [ "Unassigned" ] }, { "name": "wholesale_price", "values": [ "97.250000" ] }, { "name": "x3_sku", "values": [ "829W-CAI11M" ] } ], "visibility": "Not Visible Individually", "displayable": false, "buyable": true, "inStock": true, "lowStock": false, "categories": [], "currency": "USD", "prices": null, "parents": [ { "id": "T0RJNVZ3X2RYTV9OakZoTkRneU1UWXROalE0TkMwMFlUTm1MV0kwTXpBdFlUQXlPVEZoTm1aak1EWTI", "sku": "829W", "type": "configurable" } ], "options": [], "variants": [], "inventoryHash": "8a3bb795", "deleted": false, "weightUnit": "lbs", "environmentId": "61a48216-6484-4a3f-b430-a0291a6fc066", "createdTs": "2018-05-29T18:22:54Z" }}

{code}

However, looking at 829W, the variant data is empty.   {{ "id": "T0RJNVZ3X2RYTV9OakZoTkRneU1UWXROalE0TkMwMFlUTm1MV0kwTXpBdFlUQXlPVEZoTm1aak1EWTI", "mageId": "MAG002247678", "instanceId": "cf1f41bf-eea8-45b0-bffa-500209f8e804", "websiteCode": "us_website", "storeCode": "us_store", "storeViewCode": "us", "sku": "829W", "type": "configurable", "lastModifiedTs": "2020-03-17T09:37:37Z", "lastExportTs": "2020-03-17T09:38:04.620Z", "lastPublishedTs": "2020-03-17T09:38:04.620Z", "lastUpdatedTs": "2020-03-05T19:15:52Z", "priceHash": "622507ed", "oosHash": "8a3bb795", "contentHash": "1a053541", "productHash": "da42323d", "name": "2.5\" Charlotte Character Shoe", "description": "<h2><strong>Italian Handcrafted Y-Strap Charlotte Character Shoe </strong></h2>\r\n<p>Fan kick like a pro in the Charlotte Character Shoe. Features a non-slip heel with leather top lift that creates extra stability and a larger strike zone. Special designed Y-Strap provides a wide range of motion. Slim buckle closure eliminates the worry of the character shoe slipping off during an intense performance.</p>\r\n<h3><strong>Product Features:</strong></h3>\r\n<ul>\r\n<li>Full grain Nappa leather upper</li>\r\n<li>Suede sole</li>\r\n<li>Cushioned lining molds to foot</li>\r\n<li>Leather buckle</li>\r\n<li>Rounded toe box</li>\r\n<li>Modern Y strap</li>\r\n<li>Contoured, Broadway style 2.5\" heel with leather top lift</li>\r\n<li>Begin with street shoe size</li>\r\n</ul>", "shortDescription": null, "urlKey": "charlotte-25-charlotte", "url": "https://www.capezio.com/charlotte-25-charlotte", "metaDescription": "Capezio® Charlotte Character Shoe | Style #: 829W | Special designed Y-Strap pump provides a wide range of motion. Features a non-slip heel with leather top lift that creates extra stability and a larger strike zone. ", "metaKeyword": null, "metaTitle": "Italian Handcrafted Y-Strap Charlotte Character Shoe | Capezio®\r\n\r\n", "linksExist": false, "linksTitle": null, "linksPurchasedSeparately": false, "taxClassId": "PC040144", "weight": null, "weightType": null, "image": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/f71c5f67374cf93bf50f823a37fc2a3f/c/a/capezio_25_charlotte_character_shoe_black_829w.jpg", "label": null }, "smallImage": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/2a5aa275c6c2e762ebaebdada76a24e9/c/a/capezio_25_charlotte_character_shoe_black_829w.jpg", "label": null }, "thumbnailImage": { "url": "https://www.capezio.com/pub/media/catalog/product/cache/eafa19e0e91a04c9629f7ad085f13b5a/c/a/capezio_25_charlotte_character_shoe_black_829w.jpg", "label": null }, "swatchImage": null, "mediaGallery": [], "attributes": [ { "name": "age_group", "values": [ "Adult" ] }, { "name": "avalara_tax_id", "values": [ "PC040144" ] }, { "name": "condition", "values": [ "New" ] }, { "name": "gender", "values": [ "Female" ] }, { "name": "google_category", "values": [ "Apparel & Accessories > Shoes > Athletic Shoes & Sneakers > Athletic Shoes > Ballet & Dance Shoes" ] }, { "name": "replenishable", "values": [ "yes" ] }, { "name": "shoes_heel_height", "values": [ "2.5\"" ] }, { "name": "shoes_levels", "values": [ "Intermediate-Advanced" ] }, { "name": "shoes_material", "values": [ "Nappa Leather" ] }, { "name": "shoes_sole_type", "values": [ "Suede Sole" ] }, { "name": "size_guide", "values": [ "0" ] }, { "name": "walmart_product_status", "values": [ "Not-Uploaded" ] }, { "name": "walmart_product_validation", "values": [ "Not-Validated" ] }, { "name": "walmart_profile_id", "values": [ "Unassigned" ] }, { "name": "wholesale_price", "values": [ "97.250000" ] } ], "visibility": "Catalog, Search", "displayable": true, "buyable": true, "inStock": true, "lowStock": false, "categories": [ "capezio-com/women/shoes/character-shoes", "capezio-com/gift-guide/for-her/over-40", "capezio-com/gift-guide/for-her/over-40-eu", "capezio-com/gift-guide/for-her/over-50", "capezio-com/tap-shoes" ], "currency": "USD", "prices": null, "parents": [], "options": [ { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIxNjMwNiJ9", "type": "configurable", "name": "Color", "values": [ { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjUwNzEifQ==", "value": "Black", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjUwOTcifQ==", "value": "Chai", "minimumPrice": null } ], "allowMulti": false }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIxNjMwNyJ9", "type": "configurable", "name": "Size", "values": [ { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3MjMifQ==", "value": "5.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3MjcifQ==", "value": "6", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3MzEifQ==", "value": "6.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3MzUifQ==", "value": "7", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3MzkifQ==", "value": "7.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NDMifQ==", "value": "8", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NDcifQ==", "value": "8.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NTEifQ==", "value": "9", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NTUifQ==", "value": "9.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NTkifQ==", "value": "10", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NjMifQ==", "value": "10.5", "minimumPrice": null }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyNjY3NjcifQ==", "value": "11", "minimumPrice": null } ], "allowMulti": false }, { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIxNjMwOCJ9", "type": "configurable", "name": "Width", "values": [ { "id": "eyJ0eXBlIjoiY29uZmlndXJhYmxlIiwiaWQiOiIyODc3MTUifQ==", "value": "M", "minimumPrice": null } ], "allowMulti": false } ], "variants": [], "inventoryHash": "8a3bb795", "deleted": false, "weightUnit": null, "environmentId": "61a48216-6484-4a3f-b430-a0291a6fc066", "createdTs": "2018-05-29T18:22:54Z", "attributes.variants": [], "rating": 3.6 }}

Notes

m2-assistant[bot] commented 4 years ago

Hi @nrkapoor. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


bricht commented 4 years ago

Might be unrelated but my variants data was not syncing to elastic storage. (other data was) After I downgraded from elasticsearch 7.7.1 to 6.7.1 (also wiped elasticsearch container and volume) it worked again.

yaroslavGoncharuk commented 4 years ago

@mslabko cannot reproduce on 2.3-develop and elastic versions 7.7.1/7.1.0

  ["variants"]=>
  array(2) {
    [0]=>
    array(3) {
      ["sku"]=>
      string(8) "Conf-red"
      ["minimumPrice"]=>
      array(2) {
        ["regularPrice"]=>
        float(10)
        ["finalPrice"]=>
        float(10)
      }
      ["selections"]=>
      array(1) {
        [0]=>
        array(2) {
          ["name"]=>
          string(5) "Color"
          ["value"]=>
          string(3) "red"
        }
      }
    }
    [1]=>
    array(3) {
      ["sku"]=>
      string(10) "Conf-green"
      ["minimumPrice"]=>
      array(2) {
        ["regularPrice"]=>
        float(20)
        ["finalPrice"]=>
        float(20)
      }
      ["selections"]=>
      array(1) {
        [0]=>
        array(2) {
          ["name"]=>
          string(5) "Color"
          ["value"]=>
          string(5) "green"
        }
      }
    }
  }
yaroslavGoncharuk commented 4 years ago

@mslabko @nrkapoor I was able to reproduce the issue with enabled MSI If the last inventory source for a configurable product option (simple product) is set to 0, null will be returned for "variants" Steps:

  1. Create a configurable product with several options (simple products)
  2. Configure several Inventory Sources
  3. Assign created sources for each configurable option (simple product)
  4. Set 0 quantity for the last Source in each configurable product option (simple product), see screenshot Note. If 0 is set for any source except the last one everything is OK.
  5. Reindex
  6. Null is returned for "variants"
RuslanKostiv1 commented 4 years ago

@mslabko @bricht @akaplya can you link this issue to PR that is ready for review?

mslabko commented 4 years ago

Moved to Blocked until response from Customer CC: @nrkapoor

nrkapoor commented 3 years ago

@akaplya can we close this issue?