1

I want to create all my configurable product without any price and I don't want to see the price information on the whole website.
How to proceed step by step, please?

Thanks in advance

2

You should create a plugin to hide product price, and then edit some templates like

{magento_dir}/vendor/magento/module-checkout/view/frontend/templates/cart/item/default.phtml {magento_dir}/vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml

and anything else using $product->getPrice()

With plugin, you can reference my example:

1. app/code/Training/Test/etc/frontend/di.xml

<type name="Magento\Catalog\Pricing\Render\FinalPriceBox">
  <plugin name="training_final_price_box" type="Training\Test\Plugin\Catalog\Pricing\Render\FinalPriceBox"/>
</type>

2. app/code/Training/Test/Plugin/Catalog/Pricing/Render/FinalPriceBox.php

class FinalPriceBox
{
    function aroundToHtml(\Magento\Catalog\Pricing\Render\FinalPriceBox $subject, \Closure $proceed)
    {
        return '';
    }
}

Hope this will help you

Regards

  • thanks for your replay but i did not understand the utility of the class Final Box : is it an override of something or just some clss to hide price in specific place ??? – Developper Magento Dec 20 '18 at 8:06

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.