在 Magento 1 中,我如何隐藏所有产品的所有原价,而只显示特殊价格?

问题描述 投票:0回答:1

我是商店的老板,但我没有数据库的完全访问权限。

我尝试了更新属性,但我无法做到这一点。我尝试过设计,但我也不能从那里开始。 谢谢你。

法律发生了变化,我们必须只看到特价并隐藏原价。

updates magento1
1个回答
0
投票

好的,所以您可能正在谈论欧盟法律,当您有特价时,您必须显示过去 30 天内的最低价格?如果是这样,您有可用的模块可以帮助您解决此问题:

Magento 2 30 天内最低价格

Magento 1.9 / Openamge 30 天内最低价格

如果您只想隐藏 Magento 2 的常规价格,您可以在模板中编辑文件。 应用程序/设计/前端/Your_Theme/Your_Theme/Magento_Catalog/templates/product/price/final_price.phtml 并编辑如下文件:

<?php
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */

/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
$priceModel = $block->getPriceType('regular_price');

/** ex: \Magento\Catalog\Pricing\Price\FinalPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $finalPriceModel */
$finalPriceModel = $block->getPriceType('final_price');
$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : '';
$schema = ($block->getZone() == 'item_view') ? true : false;
?>
<?php if ($block->hasSpecialPrice()) :?>
    <span class="special-price">
        <?= /* @noEscape */ $block->renderAmount($finalPriceModel->getAmount(), [
            'display_label'     => __('Price'),
            'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
            'price_type'        => 'finalPrice',
            'include_container' => true,
            'schema' => $schema
        ]); ?>
    </span>
<?php else :?>
    <?= /* @noEscape */ $block->renderAmount($finalPriceModel->getAmount(), [
        'display_label'     => __('Price').':',
        'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
        'price_type'        => 'finalPrice',
        'include_container' => true,
        'schema' => $schema
    ]); ?>
<?php endif; ?>

原始文件位置:public_html/vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml

或通过CSS文件

.old-price {
    display: none;
}
© www.soinside.com 2019 - 2024. All rights reserved.