Questions tagged [template]

The folder that contains all the `phtml` files used to display at frontend or backend.

Filter by
Sorted by
Tagged with
2
votes
1answer
4k views

Magento 1.9 add layout and template to custom module in admin

I am new to Magento. 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 ...
0
votes
1answer
37 views

Magento 2 : Override email/shipment/track.phtml in module

Is their any way we can override email/shipment/track.phtml ? in module ? created layout file view/frontend/layout/sales_email_order_shipment_track.xml <?xml version="1.0"?> <page ...
0
votes
0answers
15 views

Shipment email template amendment

I am trying to amend our shipment email template so it will show a list of items NOT YET DISPATCHED (if applicable) - call it a backorder list if you like. Does anybody know how I can do this? Thanks ...
0
votes
0answers
26 views

Can't override list.phtml in Magento 2.4

I try to override the list.phtml in Magento 2.4 but it's not working. Here is the path to my new file : app/design/frontend/Magento/timeote/Magento_Catalog/templates/product/list.phtml All the other ...
3
votes
2answers
4k views

Remove or overwrite style-l.css in custom theme

I have some issues because of the order that CSS is being loaded in. We have <link rel="stylesheet" type="text/css" media="all" href="https://<site>/pub/static/_cache/merged/...
1
vote
2answers
764 views

Magento 2 : how to add content on customer dashboard

On customer dashboard you see this https://github.com/magento/magento2/blob/ddf42caaf25311f10b23b95a92746f99943e045e/app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml#L23 ...
4
votes
1answer
1k views

Magento2.1: How to override the template in custom module?

I want to create an extension that will give shop owners ability to edit their product image. So I understand I need this template Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml I ...
0
votes
0answers
6 views

Making A costume PDF invoice

I am new to magento 2 and want to customize my invoice PDF that is created, I want to change the design completely and want to add new field also I want to make a conditional paragraph that shows in ...
5
votes
1answer
992 views

Customer name is missing in welcome message after login

In header, there is a welcome message which can be configured in the Magento backend. However after login, i found that the customer fullname is not insert into the welcome message,(i.e. always ...
0
votes
1answer
913 views

How to override or extend Product List Page template to show Icon on Product Images in Magento Extension

Consider the Below Image I want to show an Icon on the Image of each product. I am developing an extension and I want to do this task via that extension, independent of theme. How can I achieve this ...
0
votes
1answer
2k views

Javascript in ajax loaded modal popup

I'm working on a module that needs to open modal window and show some content inside of it + some js logic. So I load template with ajax request which works just fine: (simplified template): <...
0
votes
1answer
406 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
0answers
10 views

Sort By option not working properly when using ascending or descending button

So the problem is as follows: I have the Sort By option set to "Price", but once i try to change the order from descending to ascending or vice versa, the Sort By" turns back to ...
1
vote
1answer
2k views

Magento2: Fatal error: Uncaught Error: Cannot instantiate interface

Got the error below: Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Config\DataInterface in /var/www/html/public_html/vendor/magento/framework/ObjectManager/Factory/...
0
votes
0answers
17 views

Magento 2 - How to customize “new address” form in checkout?

In magento you can add a new address during the checkout process. I need to add a little text at the position seen in the screenshot: I can't figure out how this is done. I've read through the ...
0
votes
2answers
424 views

Invalid template file: 'Magehit_Bestsellerproducts::html/bestsellerblock.phtml'

After upgrading to Magento 2.2.0, the Magehit bestseller module is causing the following exception. Can someone please help solving it? Thanks 1 exception(s): Exception #0 (Magento\Framework\...
0
votes
4answers
1k views

Custom magento 2 theme not showing up up on content/design/configuration

I have been trying for two day to figure out how I can customize my magento template. Recently I have become stuck on being able to pull up my new magento theme in the backend admin panel. I have ...
1
vote
1answer
931 views

Magento 2 Credit Memos : Template override doesn't work after clicking “Update Qty's” button

I am creating a custom module to simplify the Credit Memo creation for admin users. One of the features is hiding the "Return to Stock" column. I have overwritten 2 files for this: vendor/magento/...
0
votes
1answer
15 views

How to add attribute to product grid?

I would like to add the sku attribute to my product widget. Here is the original Magento code- <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ ...
3
votes
2answers
3k views

How to get processed email template using template id in Magento 2?

I wanted to load a particular processed email template by using its id. how to process this in magento 2. in magento 1.x the code is like $sTemplate = Mage::getModel('core/email_template') ->...
9
votes
3answers
4k views

Magento 2: proper use of helpers

I'm starting to see more and more people declaring helpers classes in order to be able to use the following in the template files: $this->helper('Path/To/Helper/Class')->customMethod(); This ...
5
votes
4answers
20k views

How to show related products in product view page in Magento 2?

How can I show related products on bottom section of the product view page? I want to show 3 related products in bottom part of product view page in Magento 2
3
votes
2answers
2k views

Magento 2 widget doesn't show - how to debug?

I have a module that is installed in other sites. In one site it doesn't show up when inserted into CMS Pages. {{widget type="Company\Modulename\Block\Widget\Test" template="widget/newsletter/test....
0
votes
1answer
13 views

ViewModel modification makes existing list.phtml break

I recently made a modification to catalog-category-view.xml and overrode category.products.list. It seemed to work at the time, I had badges displaying on a rendered page. Now the template file errors ...
0
votes
1answer
19 views

Magento 2 - Conflict in localisation csv file

I understand the general structure of i18n csv files that is like <key_hook>,<translation_of_that_key> but according to the documentation there is the possibility to add a module ...
3
votes
1answer
411 views

What's the difference between element and elementTmpl

In UI components, what's the difference between setting template and elementTmpl in a component's <config/> node? <item name="config" xsi:type="array"> <item name="template" xsi:...
1
vote
0answers
15 views

Sending Email with custom header,footer

I want to create a custom header and footer for email templates. currently when the user receives an email the logo in the head redirects it to the store URL but I want it to redirect to somewhere ...
0
votes
0answers
11 views

Before the control rendering tier price template, how to check whether the product having tier price or not in magento 2

How the magento control checks whether the product render the tier price template or regular price template ? How can we do some functionality, before the control reads price template ?
6
votes
1answer
97 views

How to create custom XHTML template system in magento 2?

Hey guys, I want to know how to create a custom XHTML system with the custom module or via core file system in Magento 2 & how it works?
0
votes
0answers
17 views

Apply special template for product page

I would like to apply special template file following an admin product configuration, for example, I have a dropdown product configuration list named layout which have two options: total and normal, ...
0
votes
2answers
17 views

Where is the template file for the front-end grid view in Magento 2.3?

I need to overwrite the front-end grid view but cannot find the correct file. This is the grid view that appears as a front end option for categories and search - not the admin grid.
4
votes
3answers
3k views

Invalid template file in Magento 2.3

I have been reading the forum but I can't find any solution to solve my case. I have a custom module where I'm getting the error: 1 exception(s): Exception #0 (Magento\Framework\Exception\...
3
votes
1answer
298 views

How Do I Add Styling Or Groupings To Widget Parameters?

I have a custom widget with various parameters. Is it possible to style or add grouping, headings, fieldsets, basically anything to give some space and separation to the numerous parameters? My ...
1
vote
2answers
2k views

how to trigger click event in M2

In my header section I have user name and if user have access to different location then he has button saying click me. I want to send ajax call on this button. But JS is not working. Can anybody help ...
0
votes
1answer
23 views

Use different phtml for single product

I understand this is probably very simple, but I have thoroughly confused myself and am hoping someone has a few minutes to provide clarity. I would like to apply some very, very custom stuff to a ...
0
votes
3answers
695 views

Magento 2 : cashondelivery.phtml file custom code not show

First I try to modify the code directly of core file. vendor\magento\module-offline-payments\view\frontend\templates\form\cashondelivery.phtml I added testing code like this. <?php $instructions ...
7
votes
2answers
9k views

How to add Qty in add to cart form on Product Listings Page in Magento 2

How can you add a Qty filed to the the add to cart form on the category listings page. With the Luma theme the user only has the option to add one product to cart at a time from the product listings ...
0
votes
1answer
10 views

Is there a way not to loose input form data on php redirect

I have a webpage with a form when I submit that page I go into a controller...he check the data sent $data = $this->getRequest()->getPostValue(); And if one of the data isn't what I am expecting,...
0
votes
2answers
1k views

Magento2: How to add a small Icon image on product image in product view page in magento 2

I wish to add small icon image on the product image in magento 2. From which template the product image is loaded in product view page. Please provide me a solution.
1
vote
1answer
812 views

Magento 2 jsonParse() does not receive data, Unexpected token '

I'm creating a js template in Magento 2. When I call js, I get an Uncaught SyntaxError: Unexpected token 'in JSON at position 96. Why jsonParse () does not get the value? Can somebody help me? file ....
36
votes
3answers
13k views

Magento 2: template security: which method to use?

I'm aware Magento 2 has several methods available to secure the template: $block->escapeHtml() $block->escapeQuote() $block->escapeUrl() $block->escapeXssInUrl() But I'm wondering when ...
2
votes
2answers
2k views

Magento 2 - Override template files in module

What is the correct way to override a template file ? I need to display custom text in place of In Stock and Price on the product page. I want to override the template - Magento_Catalog/view/...
0
votes
1answer
892 views

Failed to call function “on click” in magento 2

I have created the add button using the below block file. On button click I have called return FilterControl.addItem() from my template file seo.phtml. But it shows error like below Uncaught ...
0
votes
0answers
28 views

The block is not displaying after loading the page

Please help solve this puzzle. I'm created after plugin, after load category widget. The collection of items must be used in the js. The idea is to simply intercept the collection in the plugin, load ...
0
votes
1answer
30 views

How do I get the language code in the product price amount template file?

How can I get the current language code in Magento_Catalog::product/price/amount/default.phtml?
0
votes
0answers
33 views

Magento 2 layout and template overload in child theme not working

Good Afternoon All, I am having trouble with overloading a template for Magento 2 "module-catalog" module. My overload in the child theme would be the 4th overload in the chain and it is not ...
1
vote
0answers
235 views

Magento 2.1.0.0 new order email template preview and save 404 not found issue

My website is at magento 2.1.0 version when i load new order email template, it shows below error: Error: The template did not load. Please review the log for details. To correct the error I ...
1
vote
1answer
35 views

Change parts of email template

I want to change the email template "New Order (Magento/luma)". I want to remove the SKU column from order items table, and I think the following line will send me to the file where I must ...
0
votes
0answers
11 views

Send Attachment within a template mail Magento 1.9

I got this error "Invalid method Mage_Core_Model_Email_Template_Mailer::createAttachment(Array ( [0] => my content ) )" while trying to send an attachment within an email an here is my ...
2
votes
4answers
984 views

Can I and should I call Block methods from its' View Model?

I have a template and should write some logic. I have made a view model and I'm calling it from a template. Should I call block methods from the view model? And if so, how can I do it?

1
2 3 4 5
28