2

Only i need to show the number of quantity items in the shopping cart page.

if any one know the answer please share the exact code and folder structure. since i'm new to magento.

Any help would be appreciated. Thank you!

shopping cart page screenshot:

enter image description here

1 Answer 1

2

you need to override form.phtml file in your theme under :

app/design/frontend/Vendor/Theme/Magento_Checkout/templates/cart/form.phtml

and comment the Price and Subtotal's th tag :

<thead>
    <tr>
        <th class="col item" scope="col"><span><?= /* @escapeNotVerified */ __('Item') ?></span></th>
        <?php /*<th class="col price" scope="col"><span><?= __('Price') ?></span></th> */ ?>
        <th class="col qty" scope="col"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></th>
        <?php /*<th class="col subtotal" scope="col"><span><?= __('Subtotal') ?></span></th> */ ?>
    </tr>
</thead>

also you need to override default.phtml file in your theme under :

app/design/frontend/Vendor/Theme/Magento_Checkout/templates/cart/item/default.phtml

and comment the Price and Subtotal's td tag :

<?php /*
    <?php if ($canApplyMsrp): ?>
        <td class="col msrp" data-th="<?= $block->escapeHtml(__('Price')) ?>">
            <span class="pricing msrp">
                <span class="msrp notice"><?= __('See price before order confirmation.') ?></span>
                <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
                <a href="#" class="action help map" id="<?=  ($helpLinkId) ?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?=  $helpLinkId ?>","productName": "<?= $product->getName() ?>","showAddToCart": false}}'>
                    <span><?= __("What's this?") ?></span>
                </a>
            </span>
        </td>
    <?php else: ?>
        <td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
            <?= $block->getUnitPriceHtml($_item) ?>
        </td>
    <?php endif; ?>
*/ ?>
<?php /*
    <td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
        <?php if ($canApplyMsrp): ?>
            <span class="cart msrp subtotal">--</span>
        <?php else: ?>
            <?= $block->getRowTotalHtml($_item) ?>
        <?php endif; ?>
    </td>
*/ ?>

enter image description here

Flush the cache and check

Hope this will help you!

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.