Questions tagged [template]

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

Filter by
Sorted by
Tagged with
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
0answers
10 views

Magento 2 send data from html template to Controller without Ajax

So I have created a component which has 2 templates, but the property data is the same for both. I wanted to know if there is a way to send data without using ajax. Why? Because I don't need to use ...
2
votes
0answers
25 views

Magento 2 Custom template content will not shown in graphql response of CMS page

I have a CMS page in which I want to show the date e.i Current date OR Date after 5 days etc. So for that I have created a template file and call inside the CMS page. It will show content in Front but ...
1
vote
1answer
834 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 ....
2
votes
1answer
4k 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 ...
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
919 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 ...
37
votes
4answers
67k views

magento 2 how to call any block function in phtml

How can I call any block function in any phtml? For example if I want to call my custom block function in product list.phtml?
0
votes
2answers
19 views

Invalid template file: 'Company_module::menubtn.phtml' in module: '' block's name: 'custom_menu'

I want display a phtml file in the header, i created a phtml file and called in the default.xml but it is giving invalid template file block's name, what should be give as a block name menubtn.phtml &...
2
votes
4answers
61 views

Magento 2 : Override template file /info/default.phtml

How to override below file in module ? Magento2/vendor/magento/module-payment/view/frontend/templates/info/default.phtml
0
votes
3answers
25 views

Magento 2 - Get name of templates block from .phtml file

Is it possible to get the block name of the current template? For example I added a block to catalog_product_view.xml: <block class="Magento\Contact\Block\ContactForm" name="...
1
vote
1answer
830 views

Allow symlinks not working

I have a preprod Magento environment and I want to allow symlinks in template setting. I allowed it via Configuration->Advanced->Developer->Template Setting but it's not working. It has worked before....
0
votes
2answers
40 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 ...
1
vote
4answers
62 views

Magento 2 : override template file

Is their any way we can override below template file Magento_Sales::email/items/order/default.phtml which is defined in vendor/magento/module-gift-card/view/frontend/layout/...
3
votes
3answers
1k views

Magento2: Cross-sell not showing in cart, missing crosssell.phtml file

For some reason, my theme is missing the crosssell.phtml file that shows cross-sell products in the cart. I found out from my Magento2 system.log file; [2017-03-26 21:21:11] main.CRITICAL: ...
2
votes
4answers
1k 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?
0
votes
1answer
24 views

Email address variable causing items to disappear from email template

I've inserted a variable to bring in the customer email into the default new order template however when I added this I noticed that the items and total amount now disappear - any idea what's going on?...
6
votes
8answers
25k views

Magento 2: How to get current Currency and symbol in PHTML File?

How can I get current currency and currency symbol in Magento 2 in a template (.phtml file)? Without creating a block
0
votes
1answer
11 views

Magento two cannot update sales_order_create_load_block_items.xml

I need to overwrite Magento_Sales::order/create/items/grid.phtml in sales_order_create_load_block_items.xml created My_Module/view/adminhtml/sales_order_create_load_block_items.xml <?xml ...
0
votes
1answer
1k views

Magento 2 Custom Module Controller getLayout , createBlock, getBlock , append Fatal error:

namespace My\Module\Controller\Index; use Magento\Framework\App\Action\Context; class Index extends \Magento\Framework\App\Action\Action { protected $_resultPageFactory; public function ...
0
votes
1answer
1k views

Product Page Layout

I'm trying to find a way to add a new custom layout for some products so I can just go to the Design Tab and choose the "Page Layout" from the dropout. I can only find CMS Layout pages in google. Also ...
0
votes
1answer
24 views

Magento 2 : override Magento_Sales::email/items/creditmemo/default.phtml

What is the best way to override below template file in module ? Magento_Sales::email/items/creditmemo/default.phtml
0
votes
1answer
26 views

Magento 2: Override Magento_Payment::info/default.phtml

What is the best way to Override Magento_Payment::info/default.phtml in module ?
0
votes
1answer
97 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
16 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 ...
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
841 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
7 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
998 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
916 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
473 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
12 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
18 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
426 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 ...
0
votes
1answer
986 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
17 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
21k 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
16 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
20 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
467 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:...
0
votes
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
98 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?

1
2 3 4 5
28