Questions tagged [custom]

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

Filter by
Sorted by
Tagged with
2
votes
3answers
5k views

Magento 2: How to set Max Length for Street Address?

I would like to set Max Length for Customer's Street Address 1 to 50 Characters & Street Address 2 to 100 Characters. Changes will be applied on Frontend only, where we can find Street Address. ...
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> ...
15
votes
1answer
14k 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?
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 ...
3
votes
2answers
7k views

Magento redirect from all pages if not logged in

So, I need to redirect user to some page(tt can be CMS or customer/account) if he did not logged. And on this page(CMS or customer/account) I will have a form to login/register. So, I made an observer ...
4
votes
2answers
10k views

How to override core catalog block product list?

I am trying to override core/catalog/block/product/List.php with following Ref:http://www.magentocommerce.com/boards/viewthread/14692/ file: Ziva/Customcatalog/etc/config.xml <config> <...
1
vote
2answers
86 views

Magento 2: jQuery Datatables Button Extentions Not Working

============================UPDATED 1.1============================ I'm new to Magento 2.3, I'm trying to apply jQuery DataTable(DONE), after than, I want to add it's Button Extension, for that i ...
10
votes
5answers
21k 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!
3
votes
1answer
7k views

how to add custom data in order email in magento 2

I am new to Magento. I want to override new order email template and add custom details in order email. Please help. Steps I have done 1.I have create new email template and assign to new order in ...
7
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:...
1
vote
0answers
817 views

Magento 2: Admin price changes are not refreshing minicart immediately till checkout

I have added 1 product with it's price in Cart. It's value is 100 USD. Now from backend I'm enabling Special Price & set it to 50 USD. How can I directly apply that price in Cart? I know we can ...
6
votes
1answer
14k 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 ...
2
votes
2answers
1k views

custom message based on total for free delivery

Is it possible to display a message in a pop-up box or alert on the cart page when a customer is close to the free delivery threshold i.e. "Spend another £5 and you qualify for free delivery"
3
votes
3answers
10k views

How to implement Magento Captcha in Contact- Us form?

I need to show default magento captcha in contact-us page.
9
votes
1answer
5k 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 ...
5
votes
1answer
868 views

Magento 2.2.4 Show error message returned by plugin

I'm beginner to Magento2 and I want to validate pincode which exists in custom table or not on Checkout page (www.test.com/checkout/), according to that I want to display error message on same page. ...
4
votes
1answer
768 views

Magento 2: How to enable newly created admin theme & override module?

I'm using Magento 2 CE Version 2.1.2. I have followed Magento StackExchange Questions/Answer for this. Still having issues. I would like to Override Magento 2: How to override Adminhtml "...
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 ?
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. ...
9
votes
1answer
16k 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 ...
2
votes
2answers
749 views

How do i add product grid in customer admin section and save the checkbox values to database

I want to add product grid in Magento 2 admin customer section with a separate tab, that I got completed, but when I select the checkbox values from grid and hit save. It does not get the values of ...
11
votes
2answers
39k 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(); /** @...
6
votes
3answers
6k 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 ...
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(); //...
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, ...
4
votes
1answer
3k views

Magento 2 - Emails -> if statement

I'm currently configuring my transactional emails for Magento 2 and since I am in germany and want to ship some parts to a partner inside the EU i can place those orders without calculating taxes for ...
2
votes
3answers
5k views

Magento 2: How to set Tier Pricing Programatically Group Wise [closed]

I'm following Programmatically add tier prices On top of below post i'm trying to add Tier Pricing Magento 2: Save all product data outside Magento with Images I have done below thing $tierPrices =...
1
vote
1answer
558 views

Custom css for custom block/phtml.

Where should I put the custom .css file for my custom block/phtml. When I want to customize the display of my block then I have to create a custom .css for that. But where do I have to put that .css ...
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'...
3
votes
1answer
4k views

Magento2 Custom Customer Attribute Save Data

I cannot save data for custom customer attributes in Magento2 admin. I am creating custom Customer Attributes in a {customModule}/Setup/UpgradeData.php script. To execute it, I remove the entry for ...
2
votes
1answer
1k views

Magento 2: Server side validation not showing filled up data while error [SOLVED]

I have below code app\code\Custom\Module\Controller\MyModule\PostForm.php namespace Custom\Module\Controller\MyModule; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\...
1
vote
1answer
1k views

Magento EE - Enterprise Logging

I have small problem. I have created my own module at local, I'd like to add logs for save/edit/delete actions with Enterprise Logging module. I have created logging.xml at etc dir app/code/local/AB/...
0
votes
1answer
23 views

How to create a separate log file to print the admin details who deletes a customer profile? [duplicate]

I want to create a new log file which will print the admin details who deletes a customer profile from admin panel in magento 2. How can I do that?
0
votes
1answer
441 views

Magento 2: ACL Permission Call Manually for Logged In Admin

Magento 2: ACL Permission for Admin Module In magento\app\code\Custom\Module\Controller\Adminhtml\Posts\Index.php namespace Custom\Module\Controller\Adminhtml\Posts; use Magento\Framework\View\...
0
votes
1answer
587 views

Magento 2: How to define Scope For Router.php

I have created Custom Module. As it requires some front-end routing, have to create Router.php Whenever I'm accessing Magento eCommece Frontend other pages, say Category/Product Page. It will call my ...
0
votes
1answer
4k views

Related Products template customize

How do you change the related products template output. Instead select all I would like to add a "add to cart" button to all related products and remove checkboxes.
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 ...
6
votes
2answers
25k 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 ...
10
votes
2answers
8k 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\...
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
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?
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="...
2
votes
2answers
3k views

Magento 2: Import Script Store Id Related Issue

I'm using Magento 2 CE Version 2.1.3 Magento 2: Save all product data outside Magento with Images Once I imported data from CSV using above script. If put as ->setStoreId(0), then it will add ...
8
votes
3answers
8k 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-...
7
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->...
4
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
3
votes
1answer
868 views

Magento 2 - discrepancy between documentation and theme files structure on github

I am creating a new theme and would like to start by duplicating the default blank theme and then modify it to become my new theme. When I checked the frontend developer guides, it indicated the ...
4
votes
1answer
3k views

Override the frontname for a existing Magento module

I recently started working on Magento for one of my projects and stuck at something, which i see a very common use case. I tried looking at different blog post but couldn't find any which can hint ...
3
votes
1answer
3k views

Magento 2: Check condition on Click of “Proceed to Checkout”

May be I need to create Event Observer. I would like to check Product's Type Condition & Display Message Accordingly on Shopping Cart Page. <event name="...
3
votes
1answer
3k views

Magento 2: Custom Admin Module: On Edit data not filled up [SOLVED]

I'm using Magento 2 Version 2.1.0. I have below file for form. {folder path}\magento2\app\code\Custom\Module\view\adminhtml\ui_component\custom_module_form.xml <?xml version="1.0" encoding="UTF-...