Questions tagged [extend]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
57 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 ...
Harris's user avatar
  • 1
2 votes
3 answers
475 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?
Nghia Hoang Trong's user avatar
0 votes
2 answers
47 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 { ...
IHateMagento's user avatar
1 vote
1 answer
205 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/...
steve's user avatar
  • 33
0 votes
1 answer
53 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 ...
Black's user avatar
  • 3,340
1 vote
1 answer
24 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?
A. Andersen's user avatar
1 vote
1 answer
355 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"?> <...
Lou Nik's user avatar
  • 443
2 votes
1 answer
152 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....
Ajith's user avatar
  • 66
0 votes
1 answer
446 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 ...
MagentoDev's user avatar
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
surbhi agr's user avatar
0 votes
1 answer
433 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 ...
Bushra's user avatar
  • 62
0 votes
1 answer
457 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 = ...
Gijsve's user avatar
  • 99
0 votes
2 answers
308 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 ...
Rui Silva's user avatar
  • 374
0 votes
2 answers
156 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 <?...
Ramesh KR's user avatar
  • 866
0 votes
1 answer
64 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\...
Black's user avatar
  • 3,340
0 votes
2 answers
150 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 ...
Black's user avatar
  • 3,340
2 votes
5 answers
6k 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 ...
Pratik Navapara's user avatar
0 votes
1 answer
213 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 ...
KaMZaTa's user avatar
  • 205
-1 votes
1 answer
582 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 { ...
jojo's user avatar
  • 39
1 vote
1 answer
189 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 ...
stukev's user avatar
  • 13
1 vote
1 answer
5k 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 ...
Tirth Patel's user avatar
  • 1,039
0 votes
1 answer
76 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?
Black's user avatar
  • 3,340
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"?> ...
Bojjaiah's user avatar
  • 4,002
1 vote
1 answer
166 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 ...
Lucian Magento's user avatar
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 ...
Morgan Tartreau's user avatar
1 vote
1 answer
53 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 ...
Boss Nass's user avatar
  • 264
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/...
Mage Explorer's user avatar
1 vote
1 answer
329 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/...
Mage Explorer's user avatar
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 ...
prabhakaran7's user avatar
  • 1,087
0 votes
1 answer
176 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/...
pinicio's user avatar
  • 766
1 vote
1 answer
585 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 { ...
Trenox's user avatar
  • 397
2 votes
1 answer
115 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 ...
S Adamson's user avatar
  • 699
0 votes
1 answer
178 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'; ...
kig's user avatar
  • 169
0 votes
1 answer
1k 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']); } ...
LeaLopez95's user avatar
2 votes
2 answers
433 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 ...
Morgan Tartreau's user avatar
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 ...
sudo55's user avatar
  • 994
0 votes
0 answers
177 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\...
fudu's user avatar
  • 1,278
2 votes
1 answer
24 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 ...
Amblymoron's user avatar
1 vote
0 answers
185 views

Magento 2 top.links loads and then disappears

I am learning Magento 2 theme and I am playing with layout. My goals is to move account links (Default welcome msg, Sign In, My account etc etc) into the navbar. I used Magento Luma as parent theme ...
Giulio Savoca's user avatar
1 vote
0 answers
57 views

Proper way of adding custom code to vendor module?

Is there a guide somewhere to overriding, extending or otherwise adding to the composer module sets that show up in /vendor/? I've run into a couple of scenarios where I just have to make a few small ...
Scott's user avatar
  • 273
0 votes
1 answer
239 views

Magento2 extend a class from SalesRule module

I'm using magento 2.2 and I'm trying to extend a class, more exactly this one: \Magento\SalesRule\Model\Utility And I'm facing an error: Declaration of MagePal\CouponCodeExtraValidation\Model\...
Cosmin's user avatar
  • 45
0 votes
2 answers
61 views

Best way to change a color

I have created a new theme which is inheriting from Luma. Let's say I want to change the .page-header color, what is the best approach to do this? Should I use a _extend.less file? Or should I copy ...
Klevis Miho's user avatar
0 votes
1 answer
67 views

Inserting Button in customer account navigation - Sorting order

I inserted a button in customer/account navigation with the following file in my own module: MyCompany/CustomRouter/view/frontend/layout/customer_account.xml: <?xml version="1.0"?> <page ...
Gloweye's user avatar
  • 133
2 votes
1 answer
2k views

Magento2 LESS extend/override custom theme

I have been going through research and tests for whole day and still found answers do not work for my case or I just do not understand how to properly implement them - therefore post here: I have ...
Toms Bugna's user avatar
0 votes
1 answer
34 views

What's the best way to manipulate the product list in the category page?

How can I manipulate the list of products which will be shown on the category page?
Luigi T.'s user avatar
  • 332
0 votes
1 answer
43 views

Overriding Custom module's controller in Magento2 giving error

I am trying to override the controller of an extension in Magento2. My di.xml file is:- <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Gagan's user avatar
  • 1,478
0 votes
1 answer
203 views

Including static blocks in a product description

I'm trying to follow this article by Marius so that I can use {{block}} calls in a product description, as many of our products have the same detailed product description, with some minor capacity ...
Giles Campbell's user avatar
1 vote
1 answer
4k views

Magento 2.2 <preference> not working to override a model class

I want to override a model call (Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector). We used preference to override a model call inside di.XML like magento 2.1.x But it is not working on Magento ...
Kamlesh Jha's user avatar
  • 1,058
6 votes
1 answer
3k views

Magento 2 Extend Ui DataProvider file

I have created a module. All working fine. Just want to extend one file but can't success. I added extra field at admin tier price using this file. \Magento\Catalog\Ui\DataProvider\Product\Form\...
JACK's user avatar
  • 387
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 ...
P S's user avatar
  • 1,983