I have a third party module, and I'm trying to override the third party .phtml file but it's not working for me. For these, I tried below ways.
Third-Party Layout module:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="quotation_item_price_renderers"/> <body> <referenceBlock name="quotation.quote.item.renderers"> <block class="Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer" as="default" template="Magebees_QuotationManager::quote/item/default.phtml"> <block class="Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer\Actions" name="quotation.quote.item.renderers.default.actions" as="actions"> <block class="Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer\Actions\Edit" name="quotation.quote.item.renderers.default.actions.edit" template="Magebees_QuotationManager::quote/item/edit.phtml"/> <block class="Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer\Actions\Remove" name="quotation.quote.item.renderers.default.actions.remove" template="Magebees_QuotationManager::quote/item/remove.phtml"/> </block> </block> </referenceBlock> </body> </page> Now I want to Override quote/item/default.phtml file.
I tried 2 Ways.
1) Extended luma theme
Copied default.phtml file and pasted in design/frontend/Magento/luma/Magebees_QuotationManager/templates/quote/item/default.phtml
After the above step I executed the upgrade, compile, static-content: deploy commands, still not working.
2) Tried with di.xml
created di.xml in etc/frontend/di.xml and written below code.
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer" type="ABCSolutions\CQWCProduct\Block\Checkout\Cart\Item\Renderer" /> </config> And I set the template in the Block file see below code.
<?php namespace ABCSolutions\CQWCProduct\Block\Checkout\Cart\Item; use Magebees\QuotationManager\Helper\Quotation; use Magebees\QuotationManager\Model\QuoteFactory; use Magento\Catalog\Block\Product\ImageBuilder; use Magento\Catalog\Helper\Product\Configuration; use Magento\Checkout\Model\Session; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\Module\Manager; use Magento\Framework\Pricing\PriceCurrencyInterface; use Magento\Framework\Url\Helper\Data; use Magento\Framework\View\Element\Message\InterpretationStrategyInterface; use Magento\Framework\View\Element\Template\Context; class Renderer extends \Magebees\QuotationManager\Block\Checkout\Cart\Item\Renderer{ public function __construct( Context $context, Configuration $qproductConfig, Quotation $quoteHelper, Session $checkoutSession, ImageBuilder $imageBuilder, Data $urlHelper, ManagerInterface $qmessageManager, PriceCurrencyInterface $priceCurrency, Manager $moduleManager, InterpretationStrategyInterface $qmessageInterpretationStrategy, QuoteFactory $quoteFactory, array $data = [] ){ parent::__construct($context, $qproductConfig, $quoteHelper, $checkoutSession, $imageBuilder, $urlHelper, $qmessageManager, $priceCurrency, $moduleManager, $qmessageInterpretationStrategy, $quoteFactory, $data); $this->setTemplate("ABCSolutions_CQWCProduct::quote/item/default.phtml"); } } In default.phtml file pasted the code from the Magebees module & added extra content with "Extended".
Still not getting the updated design.
Please suggest me if I went wrong?
upgrade, compile & static-content:deploycommands. still not working