3

I am working on a Magento 2.1.7 shop.

On my category pages, I need to disable "As low as" price, as it ruins the products grid.

enter image description here

I want to hide it on configurable and non-configurable products, but only on the category pages. If possible, not with CSS (display: none).

What is the easiest and/or the most appropriate way to do this?

4
  • do you want to show for configurable product? Jan 8, 2018 at 11:52
  • I would prefer to hide it on any kind of product, but only on the category page. Jan 8, 2018 at 11:54
  • magento 2 default showing only for bundle, is your product is bundle product? Jan 8, 2018 at 11:55
  • I have added details to the question. Jan 8, 2018 at 11:58

3 Answers 3

4

I have solved it with a piece of less/css:

.product-items .minimal-price-link {
  display: none;
}
1
  • How can this be removed from the product page as well?
    – themew
    Oct 18, 2021 at 10:54
0

check below code:-

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

// @codingStandardsIgnoreFile

?>

<?php
$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : '';
/** @var \Magento\Bundle\Pricing\Render\FinalPriceBox $block */

/** @var \Magento\Bundle\Pricing\Price\FinalPrice $finalPriceModel */
$finalPriceModel = $block->getPrice();
$minimalPrice = $finalPriceModel->getMinimalPrice();
$maximalPrice = $finalPriceModel->getMaximalPrice();
/** ex: \Magento\Bundle\Pricing\Price\BundleRegularPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $regularPriceModel */
$regularPriceModel = $block->getPriceType('regular_price');
$maximalRegularPrice = $regularPriceModel->getMaximalPrice();
$minimalRegularPrice = $regularPriceModel->getMinimalPrice();
?>


<?php if ($block->getSaleableItem()->getPriceView()): ?>
    <p class="minimal-price">
        <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalPrice, [
            'display_label'     => __('As low as'),
            'price_id'          => $block->getPriceId('from-'),
            'include_container' => true
        ]); ?>
        <?php if ($minimalPrice < $minimalRegularPrice): ?>
            <span class="old-price">
                <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalRegularPrice, [
                    'display_label'     => __('Regular Price'),
                    'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                    'include_container' => true,
                    'skip_adjustments'  => true
                ]); ?>
            </span>
        <?php endif ?>
    </p>
<?php else: ?>
    <?php if ($block->showRangePrice() && !$block->isProductList()): ?>
        <p class="price-from">
            <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalPrice, [
                'display_label'     => __('From'),
                'price_id'          => $block->getPriceId('from-'),
                'price_type'        => 'minPrice',
                'include_container' => true
            ]); ?>
            <?php if ($minimalPrice < $minimalRegularPrice): ?>
                <span class="old-price">
                    <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalRegularPrice, [
                        'display_label'     => __('Regular Price'),
                        'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                        'include_container' => true,
                        'skip_adjustments'  => true
                    ]); ?>
                </span>
            <?php endif ?>
        </p>
        <p class="price-to">
            <?php /* @escapeNotVerified */ echo $block->renderAmount($maximalPrice, [
                'display_label'     => __('To'),
                'price_id'          => $block->getPriceId('to-'),
                'price_type'        => 'maxPrice',
                'include_container' => true
            ]); ?>
            <?php if ($maximalPrice < $maximalRegularPrice): ?>
                <span class="old-price">
                    <?php /* @escapeNotVerified */ echo $block->renderAmount($maximalRegularPrice, [
                        'display_label'     => __('Regular Price'),
                        'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                        'include_container' => true,
                        'skip_adjustments'  => true
                    ]); ?>
                </span>
            <?php endif ?>
        </p>
    <?php else: ?>
        <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalPrice, [
            'price_id'          => $block->getPriceId('product-price-'),
            'include_container' => true
        ]); ?>
        <?php if ($minimalPrice < $minimalRegularPrice): ?>
            <span class="old-price">
                <?php /* @escapeNotVerified */ echo $block->renderAmount($minimalRegularPrice, [
                    'display_label'     => __('Regular Price'),
                    'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
                    'include_container' => true,
                    'skip_adjustments'  => true
                ]); ?>
            </span>
        <?php endif ?>
    <?php endif ?>
<?php endif ?>
9
  • Your code shows <?php if ($block->getSaleableItem()->getPriceView()): ?> twice. I only have it once. Jan 8, 2018 at 12:26
  • I'm afraid It does not work. Jan 8, 2018 at 12:36
  • is there showing any error Jan 8, 2018 at 12:36
  • No, so maybe this is wrong: $block->isProductList()... Jan 8, 2018 at 12:48
  • There is an 11 before the first if statement. Jan 8, 2018 at 13:31
-1

We are looking for the following line in the translation file (En_en, Fr_fr... etc.)

"As low as","As low as" change to "As low as",""

Your Answer

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

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