0

I'm trying to overwrite tier_prices.phtml file.

  1. mkdir -p app/design/frontend/Vendor/Namespace/Magento_Catalog/view/base/templates/product/price/

  2. nano app/design/frontend/Vendor/Namespace/registration.php


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

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Vendor/Namespace', __DIR__);
  1. nano app/design/frontend/Vendor/Namespace/theme.xml


     Custom Tier Prices
     Magento/luma

  1. nano app/design/frontend/Vendor/Namespace/Magento_Catalog/view/base/templates/product/price /tier_prices.phtml

tier_prices.phtml is original file copied from vendor folder with my editing.

  1. rm -rf pub/static/* generated/* var/view_preprocessed/*

  2. php bin/magento setup:di:compile

  3. php bin/magento setup:di:static-content:deploy -f

  4. Check from admin>content>configuration>design configuration of my view -> set my custom theme

SAVE

nothing works!!! Why? I try to change Magento_Catalog with Magento_ConfigurableProduct but it's not work.

Thanks for any answer

0

To override phtml files there are two methods

1- Copy it in your custom theme app/design/themeX/themeY/Magento_Catalog/templates/product/price/tier_prices.phtml

2- Create custom module and override phtml file

app/code/Filippo/Catalog/etc/module.xml
app/code/Filippo/Catalog/registration.php
app/code/Filippo/Catalog/view/frontend/templates/product/price/tier_prices.phtml

Enable the module and refresh cache

bin/magento module:enable Filippo_Catalog
bin/magento cache:flush
2
  • Hi, thanks. These methods don't work
    – Filippo
    Mar 12 at 14:31
  • check if the same file are not overrided else where or you have a capital letter error flush magento cache flush varnish cache check that you are on developer mode Mar 14 at 9:04
0

The path of the template is wrong

Put your code in: app/design/themeX/themeY/Magento_Catalog/templates/product/price/tier_prices.phtml

Clear cache and recheck

1
  • Hi, thanks. With your path it doesn't work. Any other suggestions?
    – Filippo
    Mar 12 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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