Questions tagged [template]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
260 views

Magento 2 blocks and templates

Following are the 4 conditions. Single block and multiple templates - I think this is possible and we use it frequently while customizing Magento. Multiple blocks and single template - Never seen ...
0
votes
0answers
20 views

Magento 2 - Relation between Block and Templates files [duplicate]

What is the Relations between blocks and templates ? Pick 3 options. A) - Single block can have multiple template files. B) - Multiple block can have single template files. C) - Single Block instance ...
3
votes
2answers
2k 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') ->...
0
votes
0answers
16 views

How to overwrite a payment method js renderer component?

Resolved: Seems the error has been caused by the requirejs and my lobster hands :) I rewrite a default Component and trying to extend it inside own component which rewrites a default component: ...
1
vote
1answer
26 views

Shipment Label Change

I want to know that form which file this label is coming:
0
votes
0answers
23 views

Magento2: How to show Open street map on category page

I am trying to place the OSM map on the category page with the location marker. For this purpose, I have created a template module, but it is not loading a map on the page. On the page is just a gray ...
0
votes
1answer
22 views

Override Amasty template

New to magento, I'm trying to override vendor/Amasty/Promo/view/frontend/templates/notification.phtml called in vendor/Amasty/Promo/view/frontend/layout/default.xml So I've added the file in this ...
0
votes
1answer
48 views

How to pass text input value to js in magento 2 knockout js?

In my template.html file, I am having only the input field. After I complete entering the text in the input field, I need to pass the value to the js file without any button click. How to achieve this ...
0
votes
4answers
45 views

How to add css in custom module using layout file in Magento2?

I wan't to add bootstrap.css to a template in a custom layout.xml, this is my code: view/frontend/web/css/bootstrap.css here is the css file view/frontend/layout/pakke_trackshipment_info.xml <?...
1
vote
1answer
114 views

Magento2 get ID of product in price template default.phtml

How can I get the ID of product in Magento 2, in tempalte vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml I copied it to my theme: /app/design/frontend/xxx/ddd/...
1
vote
1answer
1k views

how to override email html file in magento2

I want to change following text in checkout page You can create an account after checkout. Actually this line is coming from following file. app/code/Magento/Checkout/view/frontend/web/template/...
0
votes
1answer
24 views

Magento 2 How to pass data from Controller to Block

I need to send data from controller to Block, I have used many ways but it does not work. I'm trying this way: Controller.php public function execute() { $order_id = $this->getRequest(...
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
1k 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): <...
36
votes
10answers
28k views

Where is Template Path Hints in Magento 2?

Just started playing about with Magento 2. Can anyone tell me where I can find the "Template Path Hints" option that used to be in System > Configuration > Developer > Debug?
1
vote
1answer
38 views

Disable (product data items) tabs in Product page

I want to disable tabs in product pages, i mean not display product data items (description, more information,Ratings) as tabs. So I override web/css/source/sections.less And remove tabs and ...
1
vote
3answers
9k views

Updating html template not show in Magento 2 Checkout page

I use Magento 2.0 for the first time and I am trying to make some changes on Checkout page. For example, I want to change template module-checkout/view/frontend/web/template/estimation.html, so I ...
1
vote
2answers
552 views

Magento 2: Change links html class in customer account navigation

I'm trying to change the html classes for my customer_account_navigation block. What I actually want to achieve is to display different icons for every single link. I tried the following in the ...
0
votes
0answers
11 views

Creating an element through the admin panel and getting it in the template

How to create a separate part of the functionality in the admin panel that will look and work similarly to the products, but will be a separate functional. For example, in this part of the admin ...
1
vote
3answers
1k views

how to call phtml inside phtml

I have a custom phtml inside I called attribute.phtml but it's not working: echo $block->getTemplateFile('Magento_Catalog::product/view/attribute.phtml'); echo $this->getLayout() ->...
1
vote
2answers
628 views

Custom module does not display in page

I'm trying to add custom block module to homepage but it does not load my block.phtml file. Here are my files: app/etc/modules/MG_Block.xml: <config> <modules> <MG_MyBlock&...
2
votes
1answer
687 views

Magento 2 - Override Swatches renderer.phtml

I would like to override file : app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml In my own theme : app/design/frontend/[VendorName]/[theme]/Magento_Swatches/...
0
votes
3answers
4k views

Override html template file in Magento 2 not working

I want to override Magento 2 html template located at vendor/magento/module-checkout/view/frontend/web/template/billing-address/details.html I tried using require-config.js for frontend like this:...
0
votes
1answer
20 views

Adding div around footer elements causes issue

I'm trying to add a simple div around the copyright & bug report links in the footer. I can achieve this by doing this: <referenceContainer name="footer-container"> <container name="...
0
votes
0answers
5 views

Magento 2 - Where to find information in the documentation about how to load a template in a CMS site?

You can load a template in a CMS page like this: {{block class="Magento\Framework\View\Element\Template" template="{Vendor}_{theme}::fotorama_slider.phtml"}} Where can I find more details about ...
2
votes
2answers
1k views

Magento 2: How to change the error/validation message in the customer login page?

I'm trying to override the error message that shows when a user inserts a wrong password/ wrong email. You did not sign in correctly or your account is temporarily disabled. Where and how i can ...
4
votes
3answers
1k 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\...
1
vote
1answer
5k views

Magento 2 : Display Related Products Block in Product View

I'm using magento 2.1.3 and I want to display related products under product_view. Product view is using 1 column template. I've added successfully related products to some products. I've reindexed ...
3
votes
1answer
693 views

Add filter toolbar to advanecd search page

How I can add filter toolbar to advanced search page. I created catalog_category_view.xml and added the XML below but it does not change the template. <referenceBlock name="product_list_toolbar"&...
1
vote
2answers
855 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 ...
6
votes
0answers
80 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
2answers
3k views

Magento2 | How to call Template from a Controller

I got this controller: <?php class MyClass extends \Magento\Sales\Controller\Adminhtml\Order { public function execute() { echo "TEST"; } } ?> I want it to ...
1
vote
1answer
18 views

Magento 2 - how to reference a template of my theme in a layout file?

I have this file app\design\frontend\company\mytheme\web\templates\header\foobar.phtml How can I reference it in a layout file e.g. in app\design\frontend\company\mytheme\Magento_Theme\layout\...
0
votes
2answers
719 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
2answers
52 views

Magento 2 How to remove template in checkout page?

We have a custom template file and want to display it on all the pages except the checkout page. However, it shows even in checkout page. We have used the below code in our theme default.xml. <...
0
votes
0answers
19 views

Not able to set layout in magento 1.9

Not able to set layout in magento 1.9. When i am setting catlog category> themes>layout and check the checkbox and save.It not saves the layout.And what is the meaning of checked and unchecked in 1.9. ...
0
votes
3answers
37 views

Magento2.3: How to set the border bottom for whole header?

I have a megamenu in header and want to set the border bottom for the whole header and it should be aligned with the megamenu border but its not working as expected. I have tried that into the ...
6
votes
1answer
810 views

Override Wishlist view.phtml from custom module not working

I tried to override wishlist view.phtml which loaded at customer account page like this: app/code/Test/Salesman/view/frontend/layout/wishlist_index_index.xml <?xml version="1.0"?> <page ...
0
votes
0answers
30 views

Set a custom html template for a specific shipping method?

While creating a custom shipping method works great, how to set up a specific template for specific shipping method in the checkout? Seeing the vendor/magento/module-checkout/view/frontend/web/js/...
2
votes
1answer
42 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
2answers
18 views

Trouble in getting in customer data using block class

I'm having trouble in getting the customer details using block class. I want to show the customer name after he/she logged in using block class. I can do it via object manager but not through block. ...
2
votes
2answers
2k views

How to create custom drop down field on checkout page in Magento 2?

How to create custom field on checkout billing address in magento2? I want simple drop down on checkout page just we can use for admin order and this field also saves in the database table like ...
2
votes
1answer
457 views

Magento 2 set block template in layout vs in block

There are two ways to set a blocks template. Either in the block using $this->setTemplate('Vendor_Module::template.phtml'); or in layout <block class="Vendor\Module\Block\BlockName" name="...
0
votes
0answers
5 views

Product Options Template Font Issue

Issue- Font colour on template has gone to white. (no changes have been made) Same product is on another multi store website and template colour is correct. Does anybody know how to resolve this so ...
0
votes
2answers
796 views

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

Hello Developer community, 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 ...
0
votes
0answers
53 views

Magento 2 Return Controller data in the same page

I got help to accomplish send data from Controller to a Block, and then display the info from Block in a template. The thing is that I want to send a form and display the data from that form in the ...
0
votes
0answers
13 views

Magento 2 get Controller data in the same page it was sent

I got help to accomplish send data from Controller to a Block, and then display the info from Block in a template. The thing is that I want to send a form and display the data from that form in the ...
0
votes
1answer
68 views

Magento 2 pass data from Controller to Block and display in Template

I'm a little bit stuck. I want to send a form and display it in a phtml. Here is my code: 1. Controller Search.php <?php namespace Vendor\SearchStores\Controller\Index; use Magento\Framework\...
0
votes
2answers
36 views

Invalid template file for custom module

I am Creating a simple layout block and template, but it is giving error Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Test_Module::stock_left.phtml' in ...
1
vote
3answers
1k views

Add product name in product view within a new phtml?

I copied catalog_product_view.xml and pasted it into app\design\frontend\Mytheme\DreamShop\Magento_Catalog\layout folder and code is added before the default.phtml <block class="Magento\Catalog\...