How add simple product SKU to grouped products table? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to create an add to cart button for simples within a grouped product AND still get parent image in cart in no image is specified for the simpleTwo grouped products are listed on other grouped product as simple productsMagento 2, Grouped product imagesEntering simple and grouped productsGrouped Products: Filter based on simple productsHide on grouped product tableHow to make grouped products table show in its own row above the details tab and below the images/short description?Remove SKU only for grouped productsHow to redirect simple products to the parent grouped product?Adding a grouped product to cart via the rest api

Can an alien society believe that their star system is the universe?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

How does the particle を relate to the verb 行く in the structure「A を + B に行く」?

English words in a non-english sci-fi novel

Can I cast Passwall to drop an enemy into a 20-foot pit?

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

Can any chord be converted to its roman numeral equivalent?

How to call a function with default parameter through a pointer to function that is the return of another function?

How come Sam didn't become Lord of Horn Hill?

What is the role of the transistor and diode in a soft start circuit?

How do I keep my slimes from escaping their pens?

Why did the Falcon Heavy center core fall off the ASDS OCISLY barge?

Using audio cues to encourage good posture

Why was the term "discrete" used in discrete logarithm?

List of Python versions

Why did the rest of the Eastern Bloc not invade Yugoslavia?

If a contract sometimes uses the wrong name, is it still valid?

What does this icon in iOS Stardew Valley mean?

Using et al. for a last / senior author rather than for a first author

How to tell that you are a giant?

What exactly is a "Meth" in Altered Carbon?

Should I use a zero-interest credit card for a large one-time purchase?

Why is my conclusion inconsistent with the van't Hoff equation?

A coin, having probability p of landing heads and probability of q=(1-p) of landing on heads.



How add simple product SKU to grouped products table?



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to create an add to cart button for simples within a grouped product AND still get parent image in cart in no image is specified for the simpleTwo grouped products are listed on other grouped product as simple productsMagento 2, Grouped product imagesEntering simple and grouped productsGrouped Products: Filter based on simple productsHide on grouped product tableHow to make grouped products table show in its own row above the details tab and below the images/short description?Remove SKU only for grouped productsHow to redirect simple products to the parent grouped product?Adding a grouped product to cart via the rest api



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















How do you add the simple product sku to the grouped product table?



Basically, I want to remove the grouped product sku and add the sku's to each simple product that are listed in the grouped product table. See the image below and the red drawing for a visual of what I am trying to accomplish:



enter image description here










share|improve this question




























    1















    How do you add the simple product sku to the grouped product table?



    Basically, I want to remove the grouped product sku and add the sku's to each simple product that are listed in the grouped product table. See the image below and the red drawing for a visual of what I am trying to accomplish:



    enter image description here










    share|improve this question
























      1












      1








      1


      1






      How do you add the simple product sku to the grouped product table?



      Basically, I want to remove the grouped product sku and add the sku's to each simple product that are listed in the grouped product table. See the image below and the red drawing for a visual of what I am trying to accomplish:



      enter image description here










      share|improve this question














      How do you add the simple product sku to the grouped product table?



      Basically, I want to remove the grouped product sku and add the sku's to each simple product that are listed in the grouped product table. See the image below and the red drawing for a visual of what I am trying to accomplish:



      enter image description here







      magento2 grouped-products






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 10 '18 at 14:23









      Will CousinWill Cousin

      698




      698




















          2 Answers
          2






          active

          oldest

          votes


















          1














          Copy the below file:




          vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml




          To:




          app/design/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml




          And add the below code:



          <?php
          /**
          * Copyright © Magento, Inc. All rights reserved.
          * See COPYING.txt for license details.
          */

          // @codingStandardsIgnoreFile

          /**
          * Grouped product data template
          *
          * @var $block MagentoCatalogBlockProductViewBaseImage
          * @var $block MagentoGroupedProductBlockProductViewTypeGrouped
          */
          ?>
          <?php $block->setPreconfiguredValue(); ?>
          <?php $_product = $block->getProduct(); ?>
          <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
          <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>

          <div class="table-wrapper grouped">
          <table class="table data grouped" id="super-product-table">
          <caption class="table-caption"><?= /* @escapeNotVerified */ __('Grouped product items') ?></caption>
          <thead>
          <tr>
          <th class="col item" scope="col"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
          <th class="col sku" scope="col"><?= /* @escapeNotVerified */ __('Sku') ?></th>
          <?php if ($_product->isSaleable()): ?>
          <th class="col qty" scope="col"><?= /* @escapeNotVerified */ __('Qty') ?></th>
          <?php endif; ?>
          </tr>
          </thead>

          <?php if ($_hasAssociatedProducts): ?>
          <?php foreach ($_associatedProducts as $_item): ?>
          <tbody>
          <tr>
          <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
          <strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
          <?php if ($block->getCanShowProductPrice($_product)): ?>
          <?php if ($block->getCanShowProductPrice($_item)): ?>
          <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
          <?php endif; ?>
          <?php endif; ?>
          </td>
          <td data-th="<?= $block->escapeHtml(__('Sku')) ?>" class="col sku">
          <?= $block->escapeHtml($_item->getSku()) ?>
          </td>
          <?php if ($_product->isSaleable()): ?>
          <td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
          <?php if ($_item->isSaleable()) : ?>
          <div class="control qty">
          <input type="number"
          name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          data-selector="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          value="<?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>"
          title="<?= /* @escapeNotVerified */ __('Qty') ?>"
          class="input-text qty"
          data-validate="'validate-grouped-qty':'#super-product-table'"
          data-errors-message-box="#validation-message-box"/>
          </div>
          <?php else: ?>
          <div class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
          <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span>
          </div>
          <?php endif; ?>
          </td>
          <?php endif; ?>
          </tr>
          <?php if ($block->getCanShowProductPrice($_product)
          && $block->getCanShowProductPrice($_item)
          && trim($block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ))): ?>
          <tr class="row-tier-price">
          <td colspan="2">
          <?= $block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ) ?>
          </td>
          </tr>
          <?php endif; ?>
          </tbody>
          <?php endforeach; ?>
          <?php else: ?>
          <tbody>
          <tr>
          <td class="unavailable"
          colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>">
          <?= /* @escapeNotVerified */ __('No options of this product are available.') ?>
          </td>
          </tr>
          </tbody>
          <?php endif; ?>
          </table>
          </div>
          <div id="validation-message-box"></div>





          share|improve this answer























          • This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

            – Will Cousin
            Aug 10 '18 at 15:04











          • Do you want to remove that sku only for group products? Can you add one new question for that?

            – Sukumar Gorai
            Aug 10 '18 at 15:05


















          0














          What about adding the simple product description or short description to each line as well as the SKU. $_item->getDescription or $_item->getShortDescription don't appear to exist/work. Additionally is there a way to see which methods are available for $_item and possibly add getDescription to the class?





          share








          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • you can post new question for this

            – magefms
            2 mins ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f237989%2fhow-add-simple-product-sku-to-grouped-products-table%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Copy the below file:




          vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml




          To:




          app/design/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml




          And add the below code:



          <?php
          /**
          * Copyright © Magento, Inc. All rights reserved.
          * See COPYING.txt for license details.
          */

          // @codingStandardsIgnoreFile

          /**
          * Grouped product data template
          *
          * @var $block MagentoCatalogBlockProductViewBaseImage
          * @var $block MagentoGroupedProductBlockProductViewTypeGrouped
          */
          ?>
          <?php $block->setPreconfiguredValue(); ?>
          <?php $_product = $block->getProduct(); ?>
          <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
          <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>

          <div class="table-wrapper grouped">
          <table class="table data grouped" id="super-product-table">
          <caption class="table-caption"><?= /* @escapeNotVerified */ __('Grouped product items') ?></caption>
          <thead>
          <tr>
          <th class="col item" scope="col"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
          <th class="col sku" scope="col"><?= /* @escapeNotVerified */ __('Sku') ?></th>
          <?php if ($_product->isSaleable()): ?>
          <th class="col qty" scope="col"><?= /* @escapeNotVerified */ __('Qty') ?></th>
          <?php endif; ?>
          </tr>
          </thead>

          <?php if ($_hasAssociatedProducts): ?>
          <?php foreach ($_associatedProducts as $_item): ?>
          <tbody>
          <tr>
          <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
          <strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
          <?php if ($block->getCanShowProductPrice($_product)): ?>
          <?php if ($block->getCanShowProductPrice($_item)): ?>
          <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
          <?php endif; ?>
          <?php endif; ?>
          </td>
          <td data-th="<?= $block->escapeHtml(__('Sku')) ?>" class="col sku">
          <?= $block->escapeHtml($_item->getSku()) ?>
          </td>
          <?php if ($_product->isSaleable()): ?>
          <td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
          <?php if ($_item->isSaleable()) : ?>
          <div class="control qty">
          <input type="number"
          name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          data-selector="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          value="<?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>"
          title="<?= /* @escapeNotVerified */ __('Qty') ?>"
          class="input-text qty"
          data-validate="'validate-grouped-qty':'#super-product-table'"
          data-errors-message-box="#validation-message-box"/>
          </div>
          <?php else: ?>
          <div class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
          <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span>
          </div>
          <?php endif; ?>
          </td>
          <?php endif; ?>
          </tr>
          <?php if ($block->getCanShowProductPrice($_product)
          && $block->getCanShowProductPrice($_item)
          && trim($block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ))): ?>
          <tr class="row-tier-price">
          <td colspan="2">
          <?= $block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ) ?>
          </td>
          </tr>
          <?php endif; ?>
          </tbody>
          <?php endforeach; ?>
          <?php else: ?>
          <tbody>
          <tr>
          <td class="unavailable"
          colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>">
          <?= /* @escapeNotVerified */ __('No options of this product are available.') ?>
          </td>
          </tr>
          </tbody>
          <?php endif; ?>
          </table>
          </div>
          <div id="validation-message-box"></div>





          share|improve this answer























          • This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

            – Will Cousin
            Aug 10 '18 at 15:04











          • Do you want to remove that sku only for group products? Can you add one new question for that?

            – Sukumar Gorai
            Aug 10 '18 at 15:05















          1














          Copy the below file:




          vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml




          To:




          app/design/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml




          And add the below code:



          <?php
          /**
          * Copyright © Magento, Inc. All rights reserved.
          * See COPYING.txt for license details.
          */

          // @codingStandardsIgnoreFile

          /**
          * Grouped product data template
          *
          * @var $block MagentoCatalogBlockProductViewBaseImage
          * @var $block MagentoGroupedProductBlockProductViewTypeGrouped
          */
          ?>
          <?php $block->setPreconfiguredValue(); ?>
          <?php $_product = $block->getProduct(); ?>
          <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
          <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>

          <div class="table-wrapper grouped">
          <table class="table data grouped" id="super-product-table">
          <caption class="table-caption"><?= /* @escapeNotVerified */ __('Grouped product items') ?></caption>
          <thead>
          <tr>
          <th class="col item" scope="col"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
          <th class="col sku" scope="col"><?= /* @escapeNotVerified */ __('Sku') ?></th>
          <?php if ($_product->isSaleable()): ?>
          <th class="col qty" scope="col"><?= /* @escapeNotVerified */ __('Qty') ?></th>
          <?php endif; ?>
          </tr>
          </thead>

          <?php if ($_hasAssociatedProducts): ?>
          <?php foreach ($_associatedProducts as $_item): ?>
          <tbody>
          <tr>
          <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
          <strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
          <?php if ($block->getCanShowProductPrice($_product)): ?>
          <?php if ($block->getCanShowProductPrice($_item)): ?>
          <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
          <?php endif; ?>
          <?php endif; ?>
          </td>
          <td data-th="<?= $block->escapeHtml(__('Sku')) ?>" class="col sku">
          <?= $block->escapeHtml($_item->getSku()) ?>
          </td>
          <?php if ($_product->isSaleable()): ?>
          <td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
          <?php if ($_item->isSaleable()) : ?>
          <div class="control qty">
          <input type="number"
          name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          data-selector="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          value="<?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>"
          title="<?= /* @escapeNotVerified */ __('Qty') ?>"
          class="input-text qty"
          data-validate="'validate-grouped-qty':'#super-product-table'"
          data-errors-message-box="#validation-message-box"/>
          </div>
          <?php else: ?>
          <div class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
          <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span>
          </div>
          <?php endif; ?>
          </td>
          <?php endif; ?>
          </tr>
          <?php if ($block->getCanShowProductPrice($_product)
          && $block->getCanShowProductPrice($_item)
          && trim($block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ))): ?>
          <tr class="row-tier-price">
          <td colspan="2">
          <?= $block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ) ?>
          </td>
          </tr>
          <?php endif; ?>
          </tbody>
          <?php endforeach; ?>
          <?php else: ?>
          <tbody>
          <tr>
          <td class="unavailable"
          colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>">
          <?= /* @escapeNotVerified */ __('No options of this product are available.') ?>
          </td>
          </tr>
          </tbody>
          <?php endif; ?>
          </table>
          </div>
          <div id="validation-message-box"></div>





          share|improve this answer























          • This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

            – Will Cousin
            Aug 10 '18 at 15:04











          • Do you want to remove that sku only for group products? Can you add one new question for that?

            – Sukumar Gorai
            Aug 10 '18 at 15:05













          1












          1








          1







          Copy the below file:




          vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml




          To:




          app/design/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml




          And add the below code:



          <?php
          /**
          * Copyright © Magento, Inc. All rights reserved.
          * See COPYING.txt for license details.
          */

          // @codingStandardsIgnoreFile

          /**
          * Grouped product data template
          *
          * @var $block MagentoCatalogBlockProductViewBaseImage
          * @var $block MagentoGroupedProductBlockProductViewTypeGrouped
          */
          ?>
          <?php $block->setPreconfiguredValue(); ?>
          <?php $_product = $block->getProduct(); ?>
          <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
          <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>

          <div class="table-wrapper grouped">
          <table class="table data grouped" id="super-product-table">
          <caption class="table-caption"><?= /* @escapeNotVerified */ __('Grouped product items') ?></caption>
          <thead>
          <tr>
          <th class="col item" scope="col"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
          <th class="col sku" scope="col"><?= /* @escapeNotVerified */ __('Sku') ?></th>
          <?php if ($_product->isSaleable()): ?>
          <th class="col qty" scope="col"><?= /* @escapeNotVerified */ __('Qty') ?></th>
          <?php endif; ?>
          </tr>
          </thead>

          <?php if ($_hasAssociatedProducts): ?>
          <?php foreach ($_associatedProducts as $_item): ?>
          <tbody>
          <tr>
          <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
          <strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
          <?php if ($block->getCanShowProductPrice($_product)): ?>
          <?php if ($block->getCanShowProductPrice($_item)): ?>
          <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
          <?php endif; ?>
          <?php endif; ?>
          </td>
          <td data-th="<?= $block->escapeHtml(__('Sku')) ?>" class="col sku">
          <?= $block->escapeHtml($_item->getSku()) ?>
          </td>
          <?php if ($_product->isSaleable()): ?>
          <td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
          <?php if ($_item->isSaleable()) : ?>
          <div class="control qty">
          <input type="number"
          name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          data-selector="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          value="<?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>"
          title="<?= /* @escapeNotVerified */ __('Qty') ?>"
          class="input-text qty"
          data-validate="'validate-grouped-qty':'#super-product-table'"
          data-errors-message-box="#validation-message-box"/>
          </div>
          <?php else: ?>
          <div class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
          <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span>
          </div>
          <?php endif; ?>
          </td>
          <?php endif; ?>
          </tr>
          <?php if ($block->getCanShowProductPrice($_product)
          && $block->getCanShowProductPrice($_item)
          && trim($block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ))): ?>
          <tr class="row-tier-price">
          <td colspan="2">
          <?= $block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ) ?>
          </td>
          </tr>
          <?php endif; ?>
          </tbody>
          <?php endforeach; ?>
          <?php else: ?>
          <tbody>
          <tr>
          <td class="unavailable"
          colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>">
          <?= /* @escapeNotVerified */ __('No options of this product are available.') ?>
          </td>
          </tr>
          </tbody>
          <?php endif; ?>
          </table>
          </div>
          <div id="validation-message-box"></div>





          share|improve this answer













          Copy the below file:




          vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml




          To:




          app/design/Vendor/Theme/Magento_GroupedProduct/templates/product/view/type/grouped.phtml




          And add the below code:



          <?php
          /**
          * Copyright © Magento, Inc. All rights reserved.
          * See COPYING.txt for license details.
          */

          // @codingStandardsIgnoreFile

          /**
          * Grouped product data template
          *
          * @var $block MagentoCatalogBlockProductViewBaseImage
          * @var $block MagentoGroupedProductBlockProductViewTypeGrouped
          */
          ?>
          <?php $block->setPreconfiguredValue(); ?>
          <?php $_product = $block->getProduct(); ?>
          <?php $_associatedProducts = $block->getAssociatedProducts(); ?>
          <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>

          <div class="table-wrapper grouped">
          <table class="table data grouped" id="super-product-table">
          <caption class="table-caption"><?= /* @escapeNotVerified */ __('Grouped product items') ?></caption>
          <thead>
          <tr>
          <th class="col item" scope="col"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
          <th class="col sku" scope="col"><?= /* @escapeNotVerified */ __('Sku') ?></th>
          <?php if ($_product->isSaleable()): ?>
          <th class="col qty" scope="col"><?= /* @escapeNotVerified */ __('Qty') ?></th>
          <?php endif; ?>
          </tr>
          </thead>

          <?php if ($_hasAssociatedProducts): ?>
          <?php foreach ($_associatedProducts as $_item): ?>
          <tbody>
          <tr>
          <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item">
          <strong class="product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
          <?php if ($block->getCanShowProductPrice($_product)): ?>
          <?php if ($block->getCanShowProductPrice($_item)): ?>
          <?= /* @escapeNotVerified */ $block->getProductPrice($_item) ?>
          <?php endif; ?>
          <?php endif; ?>
          </td>
          <td data-th="<?= $block->escapeHtml(__('Sku')) ?>" class="col sku">
          <?= $block->escapeHtml($_item->getSku()) ?>
          </td>
          <?php if ($_product->isSaleable()): ?>
          <td data-th="<?= $block->escapeHtml(__('Qty')) ?>" class="col qty">
          <?php if ($_item->isSaleable()) : ?>
          <div class="control qty">
          <input type="number"
          name="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          data-selector="super_group[<?= /* @escapeNotVerified */ $_item->getId() ?>]"
          value="<?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>"
          title="<?= /* @escapeNotVerified */ __('Qty') ?>"
          class="input-text qty"
          data-validate="'validate-grouped-qty':'#super-product-table'"
          data-errors-message-box="#validation-message-box"/>
          </div>
          <?php else: ?>
          <div class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
          <span><?= /* @escapeNotVerified */ __('Out of stock') ?></span>
          </div>
          <?php endif; ?>
          </td>
          <?php endif; ?>
          </tr>
          <?php if ($block->getCanShowProductPrice($_product)
          && $block->getCanShowProductPrice($_item)
          && trim($block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ))): ?>
          <tr class="row-tier-price">
          <td colspan="2">
          <?= $block->getProductPriceHtml(
          $_item,
          MagentoCatalogPricingPriceTierPrice::PRICE_CODE
          ) ?>
          </td>
          </tr>
          <?php endif; ?>
          </tbody>
          <?php endforeach; ?>
          <?php else: ?>
          <tbody>
          <tr>
          <td class="unavailable"
          colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>">
          <?= /* @escapeNotVerified */ __('No options of this product are available.') ?>
          </td>
          </tr>
          </tbody>
          <?php endif; ?>
          </table>
          </div>
          <div id="validation-message-box"></div>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 10 '18 at 14:35









          Sukumar GoraiSukumar Gorai

          6,9803729




          6,9803729












          • This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

            – Will Cousin
            Aug 10 '18 at 15:04











          • Do you want to remove that sku only for group products? Can you add one new question for that?

            – Sukumar Gorai
            Aug 10 '18 at 15:05

















          • This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

            – Will Cousin
            Aug 10 '18 at 15:04











          • Do you want to remove that sku only for group products? Can you add one new question for that?

            – Sukumar Gorai
            Aug 10 '18 at 15:05
















          This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

          – Will Cousin
          Aug 10 '18 at 15:04





          This worked for the grouped products table. The only other thing is how to remove the sku under the product title when it is a grouped product only (that sku is not used so its not useful to display it).

          – Will Cousin
          Aug 10 '18 at 15:04













          Do you want to remove that sku only for group products? Can you add one new question for that?

          – Sukumar Gorai
          Aug 10 '18 at 15:05





          Do you want to remove that sku only for group products? Can you add one new question for that?

          – Sukumar Gorai
          Aug 10 '18 at 15:05













          0














          What about adding the simple product description or short description to each line as well as the SKU. $_item->getDescription or $_item->getShortDescription don't appear to exist/work. Additionally is there a way to see which methods are available for $_item and possibly add getDescription to the class?





          share








          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • you can post new question for this

            – magefms
            2 mins ago















          0














          What about adding the simple product description or short description to each line as well as the SKU. $_item->getDescription or $_item->getShortDescription don't appear to exist/work. Additionally is there a way to see which methods are available for $_item and possibly add getDescription to the class?





          share








          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • you can post new question for this

            – magefms
            2 mins ago













          0












          0








          0







          What about adding the simple product description or short description to each line as well as the SKU. $_item->getDescription or $_item->getShortDescription don't appear to exist/work. Additionally is there a way to see which methods are available for $_item and possibly add getDescription to the class?





          share








          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          What about adding the simple product description or short description to each line as well as the SKU. $_item->getDescription or $_item->getShortDescription don't appear to exist/work. Additionally is there a way to see which methods are available for $_item and possibly add getDescription to the class?






          share








          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.








          share


          share






          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 4 mins ago









          mag2Lplatesmag2Lplates

          1




          1




          New contributor




          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          mag2Lplates is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • you can post new question for this

            – magefms
            2 mins ago

















          • you can post new question for this

            – magefms
            2 mins ago
















          you can post new question for this

          – magefms
          2 mins ago





          you can post new question for this

          – magefms
          2 mins ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f237989%2fhow-add-simple-product-sku-to-grouped-products-table%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

          Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

          Aasi (pallopeli) Navigointivalikko