All Questions
128 questions
2
votes
1
answer
6k
views
Magento 1.9 add layout and template to custom module in admin
When I try to create a custom module that shows two tabs on the main page with the option to change titles, backgrounds, and colors, I was successful in adding the module's tab in the admin area but ...
0
votes
1
answer
1k
views
Product Listing Ui Component xml file not overriding in custom module
I need to override module-catalog\view\adminhtml\ui_component\product_listing.xml file in my custom module. I have copy the core magento file in my module at view\adminhtml\ui_component but its not ...
0
votes
1
answer
47
views
Change layout based on url parameter - Magento 2.4
We created a custom module, to load a observer before layout_load_before. And then we would like to change the custom layout, based on a url parameter ?content-only=yes. For some reason it does not ...
7
votes
1
answer
10k
views
Magento 2 - Sample module displays blank page
I'm using Magento 2 version beta-1.0.0 and trying to create a simple new custom module. The custom module works but is showing a blank page on body content.
The module done in below way.
Folder ...
2
votes
0
answers
423
views
How can I display a multilingual store from right to left for Arabic store view?
welcome everybody.
I'm Mostafa from Egypt, new to Magento.
I installed magento 2.4.5 in localhost, and used the default theme "Luma", and added the Arabic language pack for the system, and ...
1
vote
1
answer
375
views
Product View gets broken
quick thing, to start, we have a module that is displayed in the sidebar and it gets the product id with the Mage::registry('current_product')->getId(); in the first time is rendering with no problem, ...
1
vote
3
answers
304
views
Can I dynamically change Layouts?
On the view.phtml is it possible to write php to change the layout depending on what item is displayed on that page?
Using code similar to this:
$this->loadLayout()
->...
2
votes
2
answers
6k
views
Magento custom module - cannot load layout file via XML
A very common issue, but can't get my head around this one. Just not able to load the custom layout I want to display under the Admin tab content of my custom module via XML layout file (something ...
2
votes
1
answer
4k
views
Check If JQuery Is Already Included In Head
I want to check if jQuery is already included on the page. I have seen several methods and finally settled on the following:
if ( (typeof jQuery === 'undefined') || !window.jQuery ) {
document....
3
votes
1
answer
1k
views
XML Module Product Page custom options.phtml problem
I've a module in magento which is creating a new view of the product page, by calling a new options.phtml file.
the problem I have is that if I call, via ajax, this modified product page view, with ...
3
votes
3
answers
11k
views
Admin layout file not loading in custom module
I'm trying to load in a block on one of my admin pages in a custom module, but it doesn't appear to be loading. At first I thought it was a handle issue, but I've found out that the handle is ...
3
votes
2
answers
7k
views
Load Custom Admin Template
Developing a simple custom module, and the hardest part is getting the template to load in the admin. I'm sure I'm missing something simple (but important).
The template will not load. I believe ...
8
votes
1
answer
7k
views
Cannot get custom frontend ajax layout to load
I always have challenges identifying the proper handles for everything, so please bear with me here. I've scoured Google, SE, and tried myriad variations, with no luck. (And yes, I've used ...
1
vote
1
answer
880
views
How to create a frontend custom page module with view template files in magento 2.3
I have doubt as how to create Frontend Module with View template files. I have created Module using this reference Magento Documentation "https://devdocs.magento.com/videos/fundamentals/create-a-new-...
0
votes
1
answer
822
views
Magento 2 layout XML reference block added in CMS page
I have a CMS page, and in certain place it references a custom block from my module as such:
{{block class="My\Notification\Block\NotificationForm" name="notification.form" ...
0
votes
0
answers
68
views
Extension Layout won't work when using a custom theme
I have built an extension intending it to add a block underneath the Add to Cart button on the catalog product page.
My extension layout file isn't being executed - instead it just executes my custom ...
0
votes
1
answer
140
views
Can't add block below add to cart button
I am new to Magento and would like to add a custom block underneath the 'Add to Cart' button.
Here is my catalog_product_view.xml file:
<?xml version="1.0"?>
<page xmlns:xsi="...
2
votes
3
answers
1k
views
Magento2 - missing adminhtml custom block after upgrade to 2.2
We had a custom block injected in the adminhtml section. This block is managed in a module (let's call it Vendor/Module) & it was working fine in Magento 2.1.*, following this methodology magento ...
3
votes
1
answer
887
views
Block not showing after layout update
Considering this layout update XML:
<?xml version="1.0"?>
<layout version="0.0.1">
<checkout_cart_index>
<reference name="methods">
<block type="...
0
votes
1
answer
3k
views
How to create a Block, Layout and Template for backend module in magento 2
I have doubt as how to create Backend Module using block,layout and templates.
After creating the block,I have assigned the block in app_appdashboard_index.xml file and I called the block page ...
0
votes
2
answers
234
views
Magento 2: Remove account element only for certain store views?
After much fighting with my layouts to add a link to my customer account page in a way that matches the design I finally succeeded in making the link show up and link to an actual page that also ...
0
votes
2
answers
174
views
Add code to <head> using a custom module & theme
I'm working on a custom theme for Magento. I'm trying to create a module for the theme that adds some code to the <head> but i'm finding it difficult to get it working.
I've created my module ...
0
votes
1
answer
5k
views
Magento 2 - What is the correct way to remove "Billing Agreements" tab from customer account? [duplicate]
What is the correct and the easiest way to remove the "Billing Agreements" tab from frontend ?
The idea is just to hide the link so later if I need I could easily return it back.
To do this in ...
1
vote
2
answers
4k
views
Magento 2 : Override layout.xml File Within Custom Module
Looking at the Magento 2 docs, you can override a base/core layout.xml file - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html
Is it possible, to overide within ...
1
vote
2
answers
145
views
Magento 2.3 Frontend module page blank
I'm trying to create a simple frontend module on Magento 2.3.2,
It seems to work, but I see a blank content on frontend.
I have this folder structure
-app
-code
-MyVendor
-...
0
votes
2
answers
1k
views
Magento 2 - Disable some modules per store view
I have setup two stores in Magento 2.2.6, each store have their own theme and url address.
In one store I have Porto theme installed in the second store I have other theme.
How I can disable for ...
0
votes
0
answers
145
views
Block is not getting called in custom module - Magento 2.3
I created a custom module to list all categories in a custom page. But the associated block is not getting called in the layout file. I can see the controller function is getting executed and page ...
0
votes
1
answer
409
views
I want to override customer-account-index.xml from magento-customer
If we want to override customer-account-index.xml from magento-customer. Where I should override?
By making folder name as Magento_Customer in app\design\vendor\theme or app\code\vendor\module..
...
0
votes
1
answer
2k
views
Magento 2: Header and footer not loading in custom module's CMS layout
I am developing a custom theme which inherits from Magento/blank. I am attempting to develop a CMS homepage layout within a custom module.
I have created the module and successfully applied the ...
3
votes
2
answers
15k
views
Magento2: Add a new page layout
On the page layouts 1 column, 2 columns, 3 columns, there is always a div called "columns" in it. I would like to create a page layout, where that div does not exist. How can I do that? Where is that ...
1
vote
1
answer
70
views
Module layout file not being used
I have a simple module Alpine_AlpineCustom but it seems that my layout.xml file is not being applied properly and I just can't see why.
I can see via Commercebug that the layout file ...
3
votes
0
answers
105
views
Production mode doesnt load any content for custom module
I have created a custom module in Magento 2. In developer mode it is working well, however same module does not show any content in the production mode of Magento its show only white screen. There is ...
0
votes
1
answer
1k
views
How can i add block to existing layout in catalog_category_view.xml?
I want change layout of catalaog_category_view.xml but i can't. I override block category.products and it's work but how can i add my own block to existing category.products block? Because i want add ...
0
votes
1
answer
685
views
Magento2 hello world displaying blank screen
I am trying to create a simple hello world module, I am able to successfully create and install the module but for some reason, my screen is showing up blank. But if I echo something in controller it ...
6
votes
2
answers
15k
views
Magento 2 - Custom Page Layout
I wish to add a custom home page layout in Magento 2.
In Magento 1, it's very simple, i create my module :
<?xml version="1.0"?>
<config>
<modules>
<Vendor_Custom>...
7
votes
1
answer
194
views
Layout Not getting Called In Custom Module
I have developed a custom plugin that used to add a custom made shipping method. For that custom made shipping method I had override the existing templates. It was working fine but changing the server ...
7
votes
5
answers
5k
views
Magento 2: unable to override product/view/addtocart.phtml from my module
I am trying to customize the product/view/addtocart.phtml template in my extension. I was already able to customize other templates but for this one it just won't work.
I found the template is ...
1
vote
1
answer
3k
views
Adding custom block to catalog product view
I'm currently making my own module, but i'm having trouble with just displaying a block in the catalog product view.
I've added this line to default/layout/catalog.xml
<block type="catalog/...
1
vote
1
answer
130
views
Conditionally load js based on cms static block type
What I want to achieve: I want a local js file included in the <head> only when a particular static block type is called.
Example: When "gallery/view" block type is called like so, {{block ...
4
votes
1
answer
5k
views
Magento 2.2.6 - Change the product name title
how I can change products name attribute. I create a new attribute second_name and I assigned to all products, now I want this attribute to replace the default name attribute. I need to change this on ...
2
votes
1
answer
732
views
White blank screen in custom module production mode magento 2
I have created a custom module in Magento 2. In developer mode it is working well, however same module does not show any content in the production mode of Magento its show only white screen. There is ...
1
vote
2
answers
3k
views
Magento 2 Sequence - Multiple Modules Overriding Same Template
I am using Magento Commerce 2.2.6 running in developer mode.
I have multiple modules that are overriding the same template via the setTemplate action in layout xml. I am using sequence in the ...
37
votes
6
answers
43k
views
Debugging layout XML loading
TL;DR: is there a way I can debug the loading of the layout? As I believe one module's layout is conflicting with another.
Related to a previous question I made: How to make a module layout to be ...
0
votes
0
answers
234
views
Fatal error: Uncaught Error: Call to a member function setPid() on boolean magento 2
I have created a custom module.
In controller i am setting variable as
$resultPage->getLayout()->getBlock('custom_block')->setPid($pId);
In production mode I am getting above error, ...
0
votes
1
answer
1k
views
Magento 2.2: How can I override "checkout.item.price.unit" and "checkout.item.price.row" in the cart?
My goal is to switch out the .phtml files: magento_module-wee::item/price/unit.phtml as well as magento_module-wee::item/price/row.phtml with my own custom ones and change how the prices are displayed ...
0
votes
2
answers
378
views
Blank Page with Front End Template in Controller
I have a controller that needs to display text, but I get a blank page. Here is what I have:
Controller/Index/Index.php
namespace Veratad\AgeVerification\Controller\Index;
use Magento\...
1
vote
2
answers
2k
views
Changing the background colour of Magento 2 based on Luma
I want to change the background colour of my magento 2 default page but it doesn't seem to be working. My code is:
Pulsestorm/StartinWithLess/etc - module.xml
<?xml version="1.0"?>
<...
0
votes
2
answers
99
views
Magento Override frontend template in custom module file
I want to override the contact page frontend from my module file.
To override the frontend template of contact form, i have created module and in that module i have created layout file mymodule.xml ...
1
vote
1
answer
1k
views
can't add child block by reference in custom layout file (solved) [closed]
I'm trying to add new block to billing form in my custom layout file. I've debugged method getFileLayoutUpdatesXml from Mage_Core_Model_Layout_Update and i see that my file is loaded. I have the ...
1
vote
1
answer
139
views
Adding a preview product section on the product page
I am fairly new to the Magento platform so excuse my lack of knowledge!
I'm working on a Magento 2 project.
I need to add a preview section for my products.
Ideally, it would be between the product-...