Skip to main content

Questions tagged [extend]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
1 vote
2 answers
453 views

Extend Magento Luma theme less

When extending Magento Luma less files in one children theme, what exactly is the name and the complete structure of the "parent" folder (mentioned at https://developer.adobe.com/commerce/...
0 votes
2 answers
71 views

How to override checkout_index_index.xml

this is the file present in my app/design dir. i need to disply shipping address section on right side bar and move the product overview section from right side bar to the place of currenct shipping ...
2 votes
3 answers
732 views

How to extend catalog_product_view.xml for a specific product type?

I created a new product type, and I want to create a product page in the frontend. How can I customize catalog_product_view.xml without affecting other product types?
0 votes
2 answers
50 views

How do I hide images and compare button in category view List mode?

Using Codazon Fastest theme, I have created ~/fastest/fastest_child/Magento_Catalog/web/css/source/_extend.less which contains the following CSS extensions: .catalog-category-view.product-item-photo { ...
1 vote
2 answers
1k views

Magento model extension experiment, return: "class does not exist"

trying to create a new model class to be used as a source model for the admin configuration setting of a new module, I got the following message: Class Makke\GroupOrders\Model\Config\Source\Sort ...
2 votes
3 answers
94 views

How to create REST API's in Magento 2?

I have to create a REST API that can be used in android phone to list all the products including product image using category id ?
0 votes
1 answer
63 views

Magento 2 - Change value in .less file of a third party module

I need to change a value in this file of a 3rd party module from my own theme: vendor/amasty/xsearch/view/frontend/web/css/source/module/components/_search-input.less Am I correct that I need to make ...
1 vote
1 answer
28 views

Can a widget extend a class besdides Template?

All widgets I have ever created programmatically extends Template implements BlockInterface and I was curious if you can extend different classes for a widget module's block?
1 vote
1 answer
464 views

magento 2.4 extending 3rd party module js file without overriding it

I have a 3rd party module installed in app/code/ that has a js file injected to the product page via the frontend/layout/default_head_blocks.xml script tag: <?xml version="1.0"?> <...
1 vote
1 answer
493 views

how do i extend a magento class from core?

I know that it is not safe to modify the core, so i want to extend a class. My need is to add a new button. In the image below you can see where: So, I created a module for that. I think the idea is ...
2 votes
1 answer
177 views

Unable to override \Magento\Directory\Block\Data class-magento2

Can anybody help me to add a class in getCountryHtmlSelect() I have tried to override \Magento\Directory\Block\Data file using plugin but i can't extend that so i go for perference. added code in di....
0 votes
1 answer
624 views

Magento 2: How to override the core interface and add a new constant?

I need to extend the core interface Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface and need to add a new constant but when I override the interface via preference its not working. When I ...
2 votes
5 answers
7k views

How to add new custom fields in existing GraphQL API (Query and Mutuation)?

I have basic knowledge about GraphQL. Now, I would like to convert my knowledge into action. For that, I want to know about few things like how can I add my custom field to any GraphQL Query and ...
11 votes
3 answers
26k views

How can I extend a Ui component JavaScript in Magento 2?

I know there is already a topic about this, as well as a documentation, but I just can't get it to work: How can I extend Ui Components' JavaScript in Magento 2? I'm trying to extend Magento_Ui/js/...
0 votes
1 answer
76 views

Extend Core Js File in magento2

I want to extend vendor/magento/Magento_Customer/view/frontend/web/js/address/js to my custom module.Please help
8 votes
0 answers
1k views

How to extend core UI Component in Magento 2

I've tried to bring the Sales -> Shipments grid into my extension. It works fine when I use this in my layout file .xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3....
0 votes
1 answer
480 views

Magento 2: How to override Catalog Model class in custom extension?

I am trying to extend Magento\Catalog\Model\Product\Image\ParamsBuilder class in the custom extension and I have passed all the parameters of parent constructor but I'm getting this error, Type ...
0 votes
1 answer
510 views

Override \Magento\CatalogSearch\Model\Advanced in Magento 2.4

Update I think this is where it is going wrong: ItemCollectionProviderInterface $collectionProvider = null, ProductCollectionPrepareStrategyProvider $productCollectionPrepareStrategyProvider = ...
2 votes
2 answers
3k views

how to add another field to category edit page in backend?

In version 2.0.x I was able to add another tab to the category edit page in the backend. But since Magento2 moved to UI Components with version 2.1.x it's broken. I can't get my head around it ...
0 votes
2 answers
364 views

How to add tables to database with foreign key?

I'm trying to extend costumers to add some wholesale info we need, so I'm trying to create a module with an InstallSchema to create, let's say, the table 'wholesale_info' with some columns and getting ...
1 vote
1 answer
806 views

Extend or override blanks theme js

I have a custom theme which inherits from blank and I would like to override navigation-menu.js options how would I do that?
4 votes
1 answer
2k views

Modifying authentication popup

I'm trying to apply the authentication popup on a custom button in my module. I've implemented it by overriding it in my requirejs-config. var config = { map: { '*': { '...
0 votes
2 answers
162 views

Issue in extending a model magento 2

I want to extend the Magento\ConfigurableProduct\Helper\Product\Options\Loader as per this github issue https://github.com/magento/magento2/issues/21663#issuecomment-477966963 My di.xml file is <?...
0 votes
1 answer
67 views

Best method to use helper in any template

It seems to be impossible to use a helper in the template Magento_Catalog\templates\product\list\items.phtml. I have tried it via argument injection: app\design\frontend\company\base\Magento_Catalog\...
0 votes
2 answers
154 views

Magento 2 - Incompatible argument type, even though constructor parent call matches extended class

I try to extend this class from my own module, because I need to inject another dependency to the constructor and add a few new methods: vendor\aheadworks\module-wbtab\Block\Wbtab\ProductList.php ...
0 votes
1 answer
217 views

Add code to a method without edit Magento core file

I'm in this condition: Magento 2.3.4 with Elasticsuite installed and I want to customize the search box so when #search get focus the page get darker adding a <div class"blury"></div>. I ...
-1 votes
1 answer
653 views

Error when extending the Magento\Catalog\Block\Product\ListProduct::class

I tried to extend the Magento\Catalog\Block\Product\ListProduct::class like this : namespace Vendor\Module\Block\Product; class ListProduct extends \Magento\Catalog\Block\Product\ListProduct { ...
1 vote
1 answer
211 views

Declaration warning when extending _afterLoad() in AbstractModel

I've created a backend module to which I've added the possibility to set storeview specific data today. That worked and showed up fine. So I'm trying to load and save my storeview data now but it just ...
1 vote
1 answer
6k views

Magento2 - Extend Magento Block class in custom module

Basically, I want to use some additional functionality in the layered navigation file Magento_LayeredNavigation::layer/view.phtml file for that using Objectmanager my code works fine. (Also I don't ...
0 votes
1 answer
87 views

Magento 1 - Create own adminhtml theme (to override templates from adminhtml)

I need to override the file app\design\adminhtml\default\default\template\catalog\product\edit\options\option.phtml. What steps are required?
6 votes
1 answer
3k views

When to use mixins and when to use map?

I'm following magento 2 official documentation to create my checkout step. I'm very new to knockoutjs, requirejs, js components which are massively used in magento 2, specially in checkout. I'm ...
0 votes
3 answers
1k views

Extend/Override .phtml file in Magento 2

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"?> ...
20 votes
1 answer
12k views

Best way to extend module less found in web/css/source/module, like _minicart.less?

Which is then the best way to extend less files content in <module>/web/css/source/module/, like for instance Magento_Checkout/web/css/source/module/_minicart.less? Assuming that to A) ...
16 votes
1 answer
11k views

DI & Extending a Block on Magento 2

I seem to be struggling to grasp Magento 2 dependency injection with blocks, every time I try to extend a block that isn't \Magento\Framework\View\Element\Template I end up with errors. I want to ...
1 vote
1 answer
187 views

Extend/Override Javascript Included from Layout (head->link)

I want to extend: vendor/magento/module-catalog/view/adminhtml/web/js/edit-tree.js Which is loaded by layout: vendor/magento/module-catalog/view/adminhtml/layout/catalog_category_edit.xml:12 Why I ...
1 vote
1 answer
60 views

Add fullwidth background to related products

I am trying to add a full-width background to the related products on my magento 2 site extending the luma theme. the problem i am having is that the background is being applied but the left/right is ...
2 votes
1 answer
129 views

How do I extend css with theme that doesn't call extend?

sorry if this is obvious or has been answered. I tried looking around and didn't see it. Also I'm getting around Magento okay but by no means an expert. I have a Magento 2 theme that it was ...
2 votes
1 answer
26 views

Adding option to a product create error

I'm extending the \Magento\Catalog\Block\Product\View file in AddToCart.php. In my AddTocart, I've added this line : $stock = $this->isInStockCustom($sku); Now, I'm adding options to my ...
0 votes
2 answers
1k views

How to rename the product detail tab title, and display as the last tab?

How to rename the product detail tab title, and display as the last tab? This is what i added, but didn't make any effect. the file is at the following location: /app/design/frontend/Infortis/...
1 vote
1 answer
341 views

How to override or extend template and layout files for an extension downloaded by composer?

I have an extension that is downloaded through composer, there are two files i would like to update. How to I override/extend the files? what is the correct paths i need to create in app/design/...
0 votes
1 answer
2k views

How i can extend more than one class in magento 2? [duplicate]

<?php use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\RequestInterface; use ...
0 votes
0 answers
179 views

Magento 2.2.5: _init() return error " Allowed memory size of 792723456 bytes exhausted"

I'm doing "Banner Slider", and I'm following module-catalog/category. So when i trying to copy this file: C:\xampp\htdocs\magento\vendor\magento\module-catalog\Model\ResourceModel\Product\...
0 votes
1 answer
194 views

How to override Quick Order model

I'm working on a Magento 2.2.3 B2B, with the Quick Order feature enabled, and I can't find a way to extend a method of the Magento\QuickOrder\Model\Cart model. So far I tried the usual: MyCompany/...
1 vote
1 answer
615 views

Magento 1.9 Extend Model, Load It Before Parent

Class Test1/Module1/Model/A { protectedfunction doSomething(){ //behaviour //behaviour //behaviour } } Class Test2/Module2/Model/B extends Test1/Module1/Model/A { ...
0 votes
1 answer
192 views

Is this the correct way to write a constructor that extends this other PHP file?

I am using Magento 2.2.6. The file I am extending is \Magento\UrlRewrite\Model\Storage\DbStorage. It has the following constructor: /** * DB Storage table name */ const TABLE_NAME = 'url_rewrite'; ...
0 votes
1 answer
2k views

Magento 2 - How to extend wysiwyg setup.js to add language settings?

i need to modify: setup: function (mode) { if (this.config['widget_plugin_src']) { tinyMCE.PluginManager.load('magentowidget', this.config['widget_plugin_src']); } ...
2 votes
2 answers
526 views

Extends constructor

I have a class that extends \Magento\Customer\Block\Account\Dashboard\Info and I want to extend its constructor to get customer session, but how do I extend constructor? PhpStorm is highlighting my ...
4 votes
3 answers
2k views

how to override Reviews Module

I'm working on Custom module in which I need to override Magento's reviews Module. I want to add some extra fields in Magento's Review Form. I created Preferences in adminhtml/di.xml Now whenever I ...
2 votes
1 answer
26 views

What does it really mean to "extend" a style?

If the purpose of _extend.less in a custom theme is to "extend" a style, what does this really mean? Should it be used in the following cases: Change the value of an existing attribute of an existing ...