1

I have used the below code its not working. Please suggest the solution.

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

di.xml file:

    < type name="Magento\Catalog\Pricing\Render\FinalPriceBox">
        < plugin name="customization_finalpricebox" type="Checkout\Customization\Plugin\FinalPriceBox"/>
    < /type>
< /config>

Plugin file code:

FinalPriceBox.php

namespace Checkout\Customization\Plugin;

class FinalPriceBox
{
function aroundToHtml($subject, callable $proceed)
{

    if($subject->getSaleableItem()->getHidePrice()==1){
        return '';
    }else{
        return $proceed();
    }

}

}

Your Answer

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

Browse other questions tagged or ask your own question.