Questions tagged [extend]

The tag has no usage guidance.

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

Extend Javascript function in another module

So, I programmed an extension, that adds a shipping function with a dropdown. It's working fine with the normal Magento checkout. Now I installed the one-step checkout from mageplaza. Of course, it ...
user avatar
  • 383
0 votes
0 answers
16 views

Adding attributes to OrderItemSearchResult

Sorry for beginner question, but I need to add aggregate field to /V1/orders/items response (2 sum fields) - can you give me a hint how it is usually done?
user avatar
0 votes
1 answer
18 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
user avatar
0 votes
1 answer
55 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 ...
user avatar
  • 60
0 votes
0 answers
27 views

Magento 2 extend errorPlacement in knockout

I need to extend errorPlacement from validation.js in Magento_Checkout/web/.../email.html I want to append error's (in checkout login section) in a custom div created by me in email.html. I tried 2 ...
user avatar
  • 1
0 votes
1 answer
201 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 = ...
user avatar
  • 69
0 votes
2 answers
62 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 ...
user avatar
  • 346
0 votes
2 answers
77 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 <?...
user avatar
  • 828
0 votes
1 answer
49 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\...
user avatar
  • 2,441
0 votes
2 answers
78 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 ...
user avatar
  • 2,441
2 votes
5 answers
2k 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 ...
user avatar
0 votes
1 answer
145 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 ...
user avatar
  • 115
-1 votes
1 answer
204 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 { ...
user avatar
  • 177
1 vote
1 answer
106 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 ...
user avatar
  • 13
1 vote
1 answer
3k 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 ...
user avatar
  • 1,028
0 votes
1 answer
53 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?
user avatar
  • 2,441
0 votes
3 answers
706 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"?> ...
user avatar
  • 3,896
0 votes
1 answer
101 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 ...
user avatar
2 votes
1 answer
21 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 ...
user avatar
1 vote
1 answer
41 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 ...
user avatar
  • 254
0 votes
2 answers
641 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/...
user avatar
1 vote
1 answer
182 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/...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
  • 1,047
0 votes
1 answer
115 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/...
user avatar
  • 746
1 vote
1 answer
442 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 { ...
user avatar
  • 397
2 votes
1 answer
94 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 ...
user avatar
  • 679
0 votes
1 answer
58 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'; ...
user avatar
  • 149
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']); } ...
user avatar
2 votes
2 answers
77 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 ...
user avatar
4 votes
3 answers
1k 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 ...
user avatar
  • 964
0 votes
0 answers
150 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\...
user avatar
  • 1,178
2 votes
1 answer
22 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 ...
user avatar
1 vote
0 answers
162 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 ...
user avatar
1 vote
0 answers
52 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 ...
user avatar
  • 263
0 votes
1 answer
194 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\...
user avatar
  • 45
0 votes
2 answers
53 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 ...
user avatar
0 votes
1 answer
61 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 ...
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 ...
user avatar
0 votes
1 answer
32 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?
user avatar
  • 322
0 votes
1 answer
41 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:...
user avatar
  • 1,458
0 votes
1 answer
178 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 ...
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 ...
user avatar
  • 1,038
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\...
user avatar
  • 387
6 votes
1 answer
2k 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 ...
user avatar
3 votes
2 answers
4k views

Extending Third Party Modules in Magento 2

In Magento 2 for themes, it's incredibly easy to extend from a parent. This follows a nice logical hierarchy when inheriting theme .xml and .phtml files. This is clearly defined in the theme.xml. ...
user avatar
  • 201
2 votes
1 answer
940 views

How to extends virtual type from di.xml

Is it possible to extends virtual type class declared in di.xml ? If yes how ?
user avatar
  • 131
1 vote
1 answer
851 views

How to extend core templates in Magento 2

How to extend vendor/magento/module-checkout/view/frontend/templates/cart/form.phtml so I can add another button to it? I tried it by creating my own module and copied the above file to app/code/"...
user avatar
  • 75
0 votes
1 answer
98 views

Trying to extend Layout. File not used at all

I try to extend /vendor/magento/module-sales/view/frontend/layout/sales_order_view.xml Therefore I created /app/design/frontend/Company/basic/Magento_Sales/layout/sales_order_view.xml inside my ...
user avatar
  • 1
0 votes
1 answer
169 views

Impossible to Extend Mage_Contacts_IndexController

I can't extend the Mage_Contacts_IndexController. I followed this guide http://www.blog.magepsycho.com/adding-upload-field-in-contact-form-and-send-as-attachment/ I made app/etc/modules/...
user avatar
  • 123
3 votes
1 answer
2k views

Magento 2:i18n folder to custom theme

I want to edit .csv file in module-wishlist to my custom theme. I have copied the the file from module-wishlist and copied to app/design/frontend/vendor/theme/Magento_Wishlist/i18n/en_US.csv. ...
user avatar
  • 1,355