Questions tagged [overriding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How to Override abstract class protected function in magento2

In magento2, how to override the abstract class protected method? I have checked the below link but it is not working. Override abstract class in Magento 2 Any help, please?
0
votes
0answers
33 views

Magento 2.3.X - Override /checkout/cart to show my custom module

I am trying to create a module that replaces the default /checkout/cart page. I have created app/code/NewShop/Cart module and it just displays a text now. app/code/NewShop/Cart/etc/frontend/routes....
0
votes
0answers
25 views

Magento 2: Failed to load resource: the server responded with a status of 404 (Not Found)

I am trying to override magento 2 core js ' require-config.js file at path Test/JsOverride/view/frontend/ var config = { "map": { "*": { "menu": "...
0
votes
1answer
29 views

Overriding CustomerData/Cart.php removes Total from MiniCart Magento 2

I have overridden \vendor\magento\module-checkout\CustomerData\Cart.php file in my custom plugin using di.xml using below code: <preference for="Magento\Checkout\CustomerData\Cart" ...
0
votes
0answers
37 views

Issue with Overriding cart in Magento2.3.1

I want to add a custom button having a different value on the cart page I am facing issues with JS and won't understand what below line will do: data-mage-init='{"Magento_Checkout/js/action/update-...
0
votes
0answers
20 views

Overwriting FinalPriceBox Class for the wishlist

we have overwritten the FinalPriceBox.php in order to show a custom price with some conditions. This works well with the categories and product page. But we have seen it's not working on the wishlist. ...
0
votes
1answer
33 views

I have compilation error like Incompatible argument type: Required type: \Magento\Shipping\Model\Rate\ResultFactory. Actual type: array; File:

use Magento\OfflineShipping\Model\Carrier\Flatrate\ItemPriceCalculator; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Shipping\Model\Carrier\AbstractCarrier; use Magento\Shipping\...
0
votes
0answers
212 views

Display notification/error message in frontend from a helper override

I have created a custom module for restrct one cms page access in few conditions. If the page is restricted, then I want to redirect the page to home page and display one message. My code is ...
3
votes
1answer
181 views

Overriding template for a specific language

I would like to override a template but only for a specific language (ar_SA) The template I want to override is: Magento_Catalog/templates/product/list.phtml I have tried putting it in the following ...
0
votes
2answers
128 views

Magento 2 : Issue With Override Magento\Checkout\Model\Session

i am override the checkout model seesion in this way in magento 2.2.5 "\app\code\Namespace\Modulename\etc\di.xml" <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
1answer
350 views

Magento2 override module-ui base admin template file?

i want to override following file in my custom module so that when magento admin sales grid renders this template from vendor it would take file from my module: vendor\magento\module-ui\view\base\web\...
0
votes
1answer
74 views

Magento2.2.2: Module override cause in Wysywig editor shows broken image

I have to override the Customer module. vendor/magento/module-customer/Model/Indexer/Source.php in my custom module app/code/Magenticians/Moduleproduct/Model/Indexer/Source.php here is ...
1
vote
0answers
46 views

Issue in Overriding Magento_Contact's form.phtml file

I want to override the form.phtml file from the magento's core contact module using my custom theme. So i created a folder structure like below, app/design/frontend/Ziffity/Weight/Magento_Contact/...
2
votes
1answer
633 views

Remove Qty Box from mini cart and the page of checkout page

I have a site to buy a unique product (qty =1) so i need to eliminate Qty from mini cart, i just overrided /web/template/minicart/item/default.html : i removed div Qty but she still there any idea how ...
1
vote
1answer
162 views

Unable To Override “ getJsonSwatchConfig() ” Method in Magento 2

I am working on magento 2 and want to override getJsonSwatchConfig method of Magento\Swatches\Block\Product\Renderer\Configurable class to meet the requirement but facing an issue. I have overrided ...
0
votes
1answer
291 views

How to override vendor theme in app/design folder magento 2?

We have one project which has a custom theme in vendor folder. Like vendor/{Vendor}/{custom-theme}/ vendor/{vendorname}/custom-theme/registration.php <?php \Magento\Framework\Component\...
0
votes
4answers
74 views

Overriding template not showing up

I am trying to override template of Magento_Review module I added new layout file under my module app/code/Custom/CustomReview/view/frontend/layout/review_product_list.xml <?xml version="1.0"?...
3
votes
1answer
632 views

$block->getViewModel() returning NULL

I am overriding the layout and adding ViewModel in that layout but when I try to fetch the ViewModel getting below error PHP Fatal error: Uncaught Error: Call to a member function getCodes() on ...
0
votes
1answer
510 views

Overriding Base file template file

There is a file that is used asynchronously in the front end called listing.html at the following path. vendor/magento/module-catalog/view/base/web/template/product/list/listing.html It is used by ...
0
votes
1answer
69 views

Getting product object inside defaultinvoice.php file for getting custom attribute values

I will tell what i have done till now. I have made a custom module to override the Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice file and its working fine. I am able to get sku, ...
1
vote
1answer
626 views

Magento 2 How to override extension frontend template file?

I have one extension and it has the following file: app/code/[Namespace]/[Module]/view/frontend/templates/test.html I want to override that specific file in my theme: app/design/frontend/[Namespace]/[...
0
votes
1answer
106 views

How to override core block class correctly? - Magento 1.x

1 way: to copy directory structure of core block to local code pool and copy core block file. For example : app/code/core/Mage/Catalog/Block/Navigation.php to app/code/local/Mage/Catalog/Block/...
1
vote
0answers
146 views

Possible useless methods overriding magento2

This is a grid collection file. In this i didn't get any grid issues. According to CodingStandard it shows this warning: ---------------------------------------------------------------------- 32 | ...
1
vote
2answers
803 views

Override HTML Template from custom module not working

I am trying to override HTML template in my custom module. I am working on Magento ver 2.2.2 Vendor/Moule/view/frontend, I have created a requirejs-config.js file: var config = { map: { ...
2
votes
0answers
59 views

The magento custom sorting functionality is not working

I am creating a Magento module to add a sorting option of a bestseller on the category page. For doing so I have to override few classes in the core. In the beginning, I have created config.xml file. ...
2
votes
4answers
747 views

Magento2 Best practice to edit layout xml file

Suppose that I want to edit the file vendor/magento/module-theme/view/frontend/layout/default.xml Do I edit the file directly? It seems not a best practice to me. Or is there anyway I can ...
1
vote
1answer
80 views

Template overriding not working

I need to override the template:module-checkout/view/frontend/web/template/shipping.html I have created requirejs-config.js var config = { map: { '*': { 'Magento_Checkout/...
1
vote
1answer
186 views

Magento2 Custom module Footer

I have Created a Custom Email template module, I wants asign all the footer design same as my module footer design, how to override Default Footer to my custom email module. Thanks