Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom]

Denotes questions about Custom code or Custom modules which is used to add/extend/enhance the existing functionality of Core Magento.

26
votes
5answers
9k views

Why does Magento have 3 code pools?

Magento has three code pools: community core local Core: It contains all Magento default modules Community and local: We use these code pools for our custom module development. Now I have doubt ...
21
votes
5answers
46k views

How do I add a block on the home page above the content, below the navigation on the home page only?

How do I add a block to the home page only above the content section, but below the navigation to spread across the page whilst still using the two-column template? I am using Magento version 1.9. ...
14
votes
1answer
13k views

how to add pagination on custom collection in Magento 2

I am working on custom module. How can i use default magento pagination with my custom collection and also set custom limits on that?
14
votes
0answers
427 views

Create new Magento Rest API to get category list in Magento 1.9

I am very confused about what kind of error I am doing to follow these steps provided here at the following link : Create new Magento Rest API to get category list in Magento After doing all ...
12
votes
1answer
13k views

Add custom field to contact form Magento 2?

I'm using magento 2 and I would like to add a custom field to the contact form , how I would be able to do that ?
11
votes
0answers
338 views

How to override a static method in Magento2

Plugin Interceptors and overriding with preference does not work on static methods. Need to override getOptionArray method in Magento\Catalog\Model\Product\Visibility to return a custom visibility ...
11
votes
4answers
4k views

Magento 2 - Render custom product collection via list.phtml

The product grid of a category page (frontend) is rendered via layout in catalog_category_view.xml. Lets say I have a custom product collection (which I got via ProductRepositoryInterface::...
10
votes
2answers
15k views

Add Custom attributes to Custom attribute set programmatically

Hi Could someone help me with this? I created a custom attribute set and custom attribute as $installer = $this; /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer->startSetup(); //...
10
votes
2answers
36k views

Magento 2 : Get Custom Attribute Value of Product [duplicate]

I'm trying to get custom attribut from my product. I tried various methods like below, but non of them worked. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); /** @...
10
votes
2answers
7k views

Magento 2 How to uninstall attributes added by custom module?

So far I know that when uninstalling a custom module, it is possible to remove custom tables or columns added by custom module by using uninstall.php which extends \Magento\Framework\Setup\...
10
votes
2answers
236 views

Magento 2 and Services Contracts

I know there is a lot of topics about this question but I'm not sure to clearly understand.. When did we need to use service contract ? Are they replacing the CRUD done by Model / ResourceModel ? ...
9
votes
5answers
19k views

Magento2 : How to get product id to my custom module

I am new to magento2 and currently I'm building a custom module and i want to get the product ID/SKU from the catalog. I'm trying to call using a function located in the Block folder. please advise!
8
votes
2answers
4k views

Magento 2 - custom admin grid field - error when sorting or filtering

I added custom column to admin grid, like this <column name="customer_name" class="Vendor\Module\Ui\Component\Listing\Columns\CustomerName"> <argument name="data" xsi:type="array">...
8
votes
5answers
12k views

theme is not showing in admin panel list magento2

i just create new test theme but it is not showing in admin panel theme list app/design/frontend/Magento/mytheme/theme.xml <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
8
votes
2answers
8k views

Magento 2 - Set custom attribute value on cart page

In Magento 1.x I have created following function in Namespace/Modulename/Model/Observer.php public function salesQuoteItemSetCustomAttribute($observer){ $quoteItem = $observer->...
8
votes
3answers
7k views

Magento 2: How to add additional block on checkout page?

I would like to override the above file & display my custom block in the li. magento\vendor\magento\module-checkout\view\frontend\web\template\shipping.html <li id="shipping" class="checkout-...
8
votes
5answers
5k views

Custom Order, Invoice, and Shipping Starting Numbers

What's the safest approach to change the next starting numbers for order, invoice, and shipment on a live site?
8
votes
1answer
15k views

Magento2 How to get custom attribute and its value of a customer? [duplicate]

I followed this tutorial to add a custom attribute to Customer. Then in Controller LoginPost.php, I want to get the value of that attribute of a particular customer to do some checking. But I found ...
8
votes
6answers
9k views

404 Page not found error when I try to access Custom module in Magento 2

I have created 2 custom module inside vendor folder .This is my layout structure : -app -code -Company -Blog -HelloWorld -Controller -Hello -World.php ...
8
votes
1answer
4k views

Whats the best way to check if a custom attribute exists in Magento2

In being careful, I want to check if my custom attribute exists before I attempt to utilize it in any way. I need to check against all attributes collection, not just the product collection. My ...
8
votes
3answers
8k views

Magento 2: How to override Luma Theme Home Page

I'm using Magento 2 CE Version 2.1.0 on WAMP Windows 10 I already referred Magento 2: How to override mini-cart default template html file? Would like to override Magento 2 Default Luma Theme I ...
8
votes
2answers
11k views

Custom api Invalid api path

So I followed this example for creating custom api. But I am not sure if I am calling it wrong or my code is not correct. Here is what I have. Folder structure: Mycompany Syncreports etc ...
8
votes
1answer
612 views

Magento 2.1: How to add a custom row to admin custom grid

I have created a custom grid in admin for "Seller Commission". Now, I want to show total commission earned, so need to add a row at the end of the grid which should say "Total Amount". Please help.
8
votes
2answers
1k views

Best practice to create a custom pdf?

is there a best practice to create e new custom e.g. invoice PDF? I need a separate custom PDF with my own layout and tables. And here is my problem: I had never created a PDF in Magento before so ...
7
votes
1answer
12k views

Simple Magento2 example of retrieving and displaying a custom table field?

I have a custom table in my Magento2 database and can not find a simple working example of how to connect, retrieve, and display the field data in a Magento2 page. This one mostly works but is ...
7
votes
2answers
11k views

Magento 2: How to change the default country in the “Estimate shipping” block in cart?

I've set my default country (Spain) in admin, also set it to be the only destination country available for shipping, however in the cart the default country is United States. How can I change it?
7
votes
2answers
23k views

How to add a custom javascript to theme in Magento 2?

I have experience with Magento 1, and there adding a custom javascript file was very straightforward and logical. But when it comes to Magento 2, I can't figure out how to add a new js file, where I ...
7
votes
6answers
24k views

Magento: Add captcha to custom contact form

I created a new custom contact form in Magento website, I am trying to add captcha at the end of it. I have added to app/code/core/Mage/Captcha/etc/config.xml <customcontacts> ...
7
votes
2answers
2k views

Add new field in customer billing and shipping page

I used this tutorial: Add new field in magento(1.9) customer registration to add new custom field in magento. But I want to show custom field in billing and shipping address. How to do this?
7
votes
2answers
3k views

Use Magento opConfig.reloadPrice() with jQuery and Custom options

I am trying to use the Magento reloadPrice() with jQuery to refresh the price. I have a configurable product with custom options. Without jQuery, the SELECT code for the option is : <select id="...
6
votes
1answer
13k views

how to create custom layout page in custom theme

I want to create a custom page layout in my custom theme. I have created a custom theme named "ktheme" with a parent theme. I created cutome_home.xml in the layout folder but I am just getting a blank ...
6
votes
1answer
5k views

How to detect a change in data inside the tab in custom admin module [closed]

While editing the elements in the custom admin form, how can I check whether the form has been edited to the last saved data of the form? Is there any way I can check this using any inbuilt Magento ...
6
votes
3answers
5k views

Magento 2 - Ajax is not calling Controller

I tried to make a simple ajax-call to my controller. Somehow I don't get a valid response. MyCompany/MyModule/Index/GetAjax.php namespace MyCompany\MyModule\Controller\Index; class GetAjax extends ...
6
votes
1answer
2k views

Create a custom resource model that fetches data from 3rd-party API (non-db)

I'd like to create a custom model that connects to an API instead of the Magento database. It would also be nice to be able to use (or extend) Magento's collection classes. We created a custom module ...
6
votes
5answers
2k views

Redirect from plugin Magento 2

I am trying to redirect to custom URL by using plugin feature of Magento 2 but somehow I am not able to redirect it. For this, I tried a couple of options like, Magento2: redirection from Observer ...
6
votes
1answer
1k views

How does the payment gateway works in Magento 2?

I want to integrate my own payment gateway in Magento 2. I've read many topics, studied the sample code from the Magento 2 repository and the braintree module. However I've not found great posts ...
6
votes
1answer
763 views

Order by joined custom table

I've got a productcollection, which i joined a custom table to. I'd now like to order the collection on the custom joined table row "custom_row_value". I've tried the below method, but this does not ...
6
votes
1answer
8k views

Can anyone suggest tutorial for creating own Magento theme?

I searched the web to find any tutorial which guides step by step to create a custom theme. Basically what I expect is to convert a HTML and CSS code to a Magento theme. But still couldn't find a ...
6
votes
0answers
657 views

How to add dynamic custom column in UI component

I have configured UI component columns in admin grid and its working fine. I need to add custom columns dynamically. For example we can add custom column in __prepareColumns function in Block layout ...
5
votes
1answer
5k views

How render product wishlist link functionality in custom template (phtml) in magento 2

How to display wishlist link (with functionality) in custom phtml file using template file in magento 2
5
votes
2answers
2k views

Magento 2 : Upgrade Existing Custom Customer Attribute

I have created custom customer attribute and use at registration process. Its working fine. Now I want update attribute like - previously its 'required'=> false. Now I want to set it as 'required'...
5
votes
1answer
12k views

Magento 2: Creating a custom layout

I'm having trouble creating a custom layout. I have successfully created a layout called home_page.xml which is a copy of the default 1column layout. I have selected this layout for my home page, ...
5
votes
1answer
565 views

How to add a dynamic label In Magento 2?

I want to add a dynamic label in customer dashboard (label name set dynamically ) <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" ...
5
votes
2answers
402 views

How to use Custom Module Js to RequireJS

I add my custom Module to JS to requirejs-config.js File var config = { paths: { 'Test/jquery':"Test_Header/js/jquery.min" , 'Test/popup':"Test_Header/js/jquery....
5
votes
1answer
161 views

Create a custom index with product information [closed]

I'm trying to create a custom index where I want to index product information. I having trouble finding some real good information about this. Documentation or really good commented example needed. I ...
5
votes
1answer
1k views

change 1column template

I hope I can ask this question correctly. I am attempting to edit the "1column.phtml" file so that the "side bar left" appears as well. I have pulled the code from "2columns.phtml" and it works , how ...
5
votes
1answer
359 views

Magento 2 :- How can i add tab in customer group?

I tried to create new tabs as per the customer tab, add in admin side, but I am getting the error so can any one help me. How can i do this thing? I refer this link for that 1) http://www.dckap.com/...
5
votes
0answers
878 views

Magento 2: Get Order Information Outside Magento Issue for Date

I have below script, trying to get all Orders. I have issue with Date. That i have solved using https://github.com/magento/magento2/issues/7560 //place this before any script you want to calculate ...
5
votes
0answers
889 views

Magento 2: How to Show Discount Coupon Applied Code Product wise?

In Shopping Cart, I have 2 products. When I am applying the Promo Code it's going to apply on only 1 product as per the Shopping Cart/Promotion Rules. I would like to show discount code on basis of ...
5
votes
0answers
349 views

Case / Package Products in Magento 2

I have this requirement: A product should have each individual price and case / package price. For each product, N items make a case. For example: In product, A 20 items makes a case. In product B 5 ...