Questions tagged [overrides]
Questions about overriding core features (class rewrites, local code pool, theme overrides). For URL rewrites, use the "url-rewrite" tag instead.
321
questions with no upvoted or accepted answers
2
votes
1
answer
77
views
Overriding class Magento 2.1
I'm trying to inject \Magento\Framework\Filter\FilterManager $filterManager Object to be able to use truncate fucnction in list.phtml
$this->_filter->truncate($string, ['length' => $...
2
votes
1
answer
3k
views
Magento 2: How to override configurable.phtml block
I am just extended configurable block using a custom block, but I couldn't get the "selected_configurable_option" while changing the configurable options [ not getting simple product id ].
Did this ...
2
votes
0
answers
426
views
How to proper extend variables and override module style?
I am new to Magento and currently developing a child theme inherited from the Magento blank theme. I read the developer documentation and doing okay.
I created my own style.less in my web directory ...
2
votes
0
answers
370
views
Edit backend in Magento 2
I've been trying to edit my backend, but without any results, does anyone know how, step by step?
I've already try How to extend backend template files in Magento 2
Maybe I'm doing something wrong, ...
2
votes
1
answer
267
views
Reverting block rewrite, how to set all child block elements
I had a custom page where I had to rewrite page/page.phtml, and inside the template file I needed some methods. So I had to rewrite the base class Mage_Page_Block_Html.
This is how my module's layout ...
2
votes
2
answers
1k
views
Custom Contact Form - Override Controller
I am trying to add a contacts form on multiple cms/products pages. I copied the default contacts from phtml and pasted them into a new phtml file. However, submitting the form redirects to the ...
2
votes
0
answers
74
views
Changing type on WSI file will not allow for an override
In app/code/core/Mage/Catalog/etc/wsi.xml
From the tag for this:
<xsd:complexType name="catalogProductCreateEntity">
I want to delete or change type with a custom module
<xsd:element ...
2
votes
0
answers
202
views
Cannot rewrite ConfigurablePriceResolver in Magento 2
I try to rewrite the ConfigurablePriceResolver in Magento 2, but without success. In my di.xml I have the following:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:...
2
votes
2
answers
681
views
[Solved]Cannot override Pdf/Total/Default.php model
Good morning everybody!
I have a problem trying to override the model app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php with app/code/local/Mycompany/Sales/Model/Order/Pdf/Total/Default.php.
...
2
votes
1
answer
2k
views
Magento2 how to override collection
I want to build a grid that show information from "directory_country_region" table but show only for "country_id" with id = "TH".
I'm using UI component & Magento\...
2
votes
1
answer
174
views
Override Goup Price not working
I've created two product custom attribute to let admin se a starting and ending date for all group price, to let magento calculate correctly the group price only inside the date rage I've override the ...
2
votes
2
answers
608
views
Rewrite Credit Memo API in Magento CE 1.9
I am trying to rewrite the model sales_order_credit_memo_api with my own "info" function.
I have created all the files yet when I access the API call "order_creditmemo.info" it uses the base Mage ...
1
vote
0
answers
2k
views
How do I add a new JS function via mixin to the Magento checkout payment page's shipping information section?
I am trying to add a mixin in Magento 2 for the checkout/payment page shipping info section.
There is an existing section in vendor/magento/module-checkout/view/frontend/web/template/shipping-...
1
vote
0
answers
38
views
Magento 2 - How to override knockoutjs template which is already overriden from a third party module?
I try to override the knockoutjs template vendor\amasty\module-single-step-checkout\view\frontend\web\template\checkout\summary\item\details.html from my own Theme.
The module amasty\module-single-...
1
vote
1
answer
42
views
Magento2.4.2 own module class does not appear in generated (no error while setup:ci:compile)
sorry to bother but I'm really stuck with a strange problem. My goal is to have the invoice PDF changed but the class I've created to do this (which is currently a bunch of code from another guy) does ...
1
vote
0
answers
436
views
Magento2: How to override the Magento\Payment\Gateway\Command\GatewayCommand?
Because I want to send Notification with response error code by Payment Gateway) when transactions are isValid. And I found the Magento\Payment\Gateway\Command\GatewayCommand do the command with ...
1
vote
2
answers
72
views
Cannot override class RuleProductPricesPersistor in Magento 2
I'm trying to override following class
Magento\CatalogRule\Model\Indexer\RuleProductPricesPersistor
Using below code
<preference for="Magento\CatalogRule\Model\Indexer\...
1
vote
1
answer
164
views
How to override a template file in magento 2
I want to override final_price.phtml template file located at /vendor/magento/module-grouped-product/view/base/templates/product/price/
How should i do that?
1
vote
1
answer
231
views
call a vendor function in custom module
I'm trying to create a custom module which will have GoogleSheet Import functionality. So I want to call varienImport.postToFrame() this function works when we click on Check Data option in existing ...
1
vote
1
answer
251
views
How to populate Purchase Order Number with a random rumber?
Magento 2.3.x Purchase Order used as a payment method requieres a purchase order number. Some of our customers don't have that number, so we need to pre-populate this input field with a random content ...
1
vote
1
answer
281
views
Override track.phtml
Before marking as duplicate go through once
I'm facing issue with overriding module-sales/view/frontend/templates/email/shipment/track.phtml
I'm using Magento 2.3.3
Answer is here but its not ...
1
vote
0
answers
164
views
How do I extend the Grouped Product Block Class?
I have a custom module living in:
app/design/frontend/Vendor/Theme/Magento_GroupedProduct
Inside that, I've got a Block, layout and a templates folder.
I was under the impression that I could ...
1
vote
3
answers
177
views
Override CSS file from composer installed module
I've one composer module which has CSS stored in view/base/web/css/style.css
How can I override this file so that I can modify it.
I tried copying that file to my custom theme as below,
app/design/...
1
vote
2
answers
768
views
Override ui_component .xhtml template file
How can I override a ui_components' template file?
The concerning file is:
vendor/magento/module-ui/view/base/ui_component/templates/listing/default.xml
I want to override this file so that it adds ...
1
vote
1
answer
124
views
Magento 2.3: How to override page content
How to override the content editing page to customize it. do you have any ideas?
1
vote
1
answer
251
views
Magento 2 : Override addtocart.phtml for all kinds of products
How can I override addtocart.phtml for all types of products, this code works fine only for simple and configurable products, but I want to override all kinds of products.
<page xmlns:xsi="http://...
1
vote
3
answers
1k
views
Override PrepareTemplate function of Magento\Sales\Model\Order\Email\Sender.php in Magento 2.3
I want to override PrepareTemplate function of Sender.php and have tried to override Sender.php with the help of link Override abstract class but its not working for me.
I have followed the exact ...
1
vote
0
answers
619
views
How to rewrite store view code in Nginx?
I have some trouble to fix this issue.
I have a Magento 2 installation with two websites and several store views:
https://www.websiteone.com/onenl
https://www.websiteone.com/oneen
https://www....
1
vote
0
answers
28
views
Override module's model with another Magento 2 module
I tried to override a custom module model with creating a new module, i got class not found error
etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
0
answers
66
views
Override Api xml Magento1
i made changes in
app/code/core/Mage/Customer/etc/api2.xml
now i want to override this xml in my local module how i do
1
vote
1
answer
1k
views
How to override Product details Page controller magento 2
hi all, i want to override Magento\Catalog\Controller\Product\View.php file
i tried to override but it's not loading the product page.
<?php
/**
*
* Copyright © Magento, Inc. All rights ...
1
vote
1
answer
139
views
Captcha Helper method override not working in Magento2
Need to override method getImgUrl() from vendor\magento\module-captcha\Helper\Data.php but not success
app/code/YourCompany/YourModule/etc/di.xml
<config xmlns:xsi="http://www.w3.org/2001/...
1
vote
1
answer
438
views
Magento 2 Seo title product override not working
I overrided the Magento\Catalog\Block\Product\View.php adding this code
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->pageConfig->getTitle()->set($title . '- ...
1
vote
0
answers
125
views
Incompatible argument type: Required type: \Magento\Framework\Stdlib\StringUtils
I want to override below block file
/var/www/html/dg/vendor/magento/module-gift-card/Block/Sales/Order/Item/Renderer.php
I made this file
/var/www/html/dg/app/code/Drummondgolf/Orderemail/Block/...
1
vote
1
answer
118
views
Are there any restrictions on classes you can override with preference in di.xml
When overriding a class with a custom one using the di.xml, are there any restrictions on what class you can override?
I have tried overriding a class of a third party module, but it does not appear ...
1
vote
0
answers
26
views
Product page (Related.php) error in Magento 2.1.16
I override the page Related.php and add my extra custom function in this class it works perfectly on 2.2.X but in 2.1.16 it shows me this error
Warning: Invalid argument supplied for foreach() in /...
1
vote
1
answer
118
views
Magento 2.3 - extending layouts in custom theme
In Magento 2.* we could extend core layouts using custom theme, for instance, (assuming our custom theme is named Custom/our_theme) if we want to remove header & footer in customer login page we ...
1
vote
0
answers
78
views
New to Magento 2 - Is it possible to change every product price every minute?
I work in -precious metal industry- where item prices change every minute based on markets. At the basic level, UnitPrice=MarketPrice+Premiums per tier.
My questions are:
If we want to import ...
1
vote
1
answer
599
views
Magento 2 in SEO Checker - "The Accessible Index Page is Configured wrong"
So I run our site (on Magento 2.2.3) thru an SEO checker and it flagged up an interesting issue:
The Accessible Index Page is Configured wrong.
Search engines see your https://www.xyz.co and https://...
1
vote
0
answers
24
views
How many ways are there to create a controller and what are they?
I have been developing with Magento 1.9 for the last two weeks. I have found several problems to develop each project (probably because my first project with magento had a high level...).
I come ...
1
vote
1
answer
341
views
Rewrite phtml file and js file in Magento 2
Currently, I have cc card HTML in
MyModule/Testing/view/frontend/web/template/form.html
I want to rewrite this to phtml file with my module and js in web/js folder.
How can I achieve that?
1
vote
1
answer
125
views
third party module controller overriding not working in magento 1
my config.xml
<?xml version="1.0"?>
<config>
<modules>
<Mindtwo_Formbuildercrfprotection>
<version>0.0.1</version>
<depends&...
1
vote
0
answers
126
views
Unable to override account creation email template
I need to modify the welcome email sent to user upon new account creation. I need to do this in my custom module. I tried to override the function sendNewAccountEmail in Magento\Customer\Model\...
1
vote
0
answers
124
views
Magento 2 - How to make responsive layout using child theme css?
How to override styles-m css to set responsive layout? I just add custom blocks in footer area which are not responsive in mobile view. How to override styles-m in Luma child theme?
Thanks
1
vote
0
answers
219
views
Private Function rewrite in magento2
i want to override helper class method
private function _getGeneralFromAttributeSets(array $attributeSetIds)
i use this code and create helper in my module folder
<preference for="Test\Test\...
1
vote
0
answers
83
views
how to overwrite the renderlayer.php in magento 2
When i try to overwrite the Renderlayer.php of module-swatches I am getting error
[2018-09-24 06:48:41] report.CRITICAL: Warning: Declaration of Kygo\Swatches\Block\LayeredNavigation\RenderLayered::...
1
vote
0
answers
23
views
Overwrite a class extended many times
When I have to override a method of a class that is used as extends in many modules I have to copy the class path and put it under app
/local/Mage/.../Core_Class_Extended_ManyTimes.php.
But there is ...
1
vote
0
answers
25
views
Magento 1.9 Can I override the registration page only for one of the stores?
I have multiple stores.
I need to override the existing registration page, but only for 1 store? How can I achieve that?
1
vote
0
answers
487
views
override getLoadedProductCollection of \Magento\Catalog\Block\Product\ListProduct
I am overriding getLoadedProductCollection() in my block where performing some custom query
public function getLoadedProductCollection()
{
$myCategory = $this->...
1
vote
1
answer
460
views
Magento 2: can't override js file
I tried to override magento/module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js
For this in my custom module i have created under Module/Namespace/view/frontend, ...