Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [template]

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

0
votes
0answers
6 views

JS Error breaks Minicart in developer mode only Invalid template file

I'm working on a project and I'm getting the below browser console error only in developer mode when I add an item to the cart Invalid template file: 'cart/item/price/sidebar.phtml' in module: '...
0
votes
1answer
39 views
+50

override wysiwyg_images.files

I try to override Magento_Cms::browser/content/files.phtml but when i test , the block is dont display , and i dont know why i have the next extructure <Vendor>_<Module> ├── <Stuff&...
0
votes
0answers
24 views

How to fetch product data into custom .phtml block on product view

I'm having trouble trying to fetch Product data such as price, SKU etc into a custom .phtml file referenced as a block within my catalog_product_view.xml file. Here's what I'm struggling with... I'm ...
0
votes
0answers
8 views

How to call a template after minicart is loaded in magento 2

How to call a template after minicart is loaded in magento 2 I wish to call the template for all the pages after the quote is created. So please provide me a solution to cal a template after the quote ...
2
votes
0answers
15 views

How to override Magento 2 welcome email upon new customer account creation

I need to customize default Magento welcome email template which is sending upon new customer account creation in my custom module. I'm using the following functions for sending welcome email upon ...
1
vote
3answers
22 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
17 views

in custom homepage template images added only in newline (magento 1.9.4)

Following is the homepage.phtml <html> <?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this ...
0
votes
1answer
39 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 ...
1
vote
0answers
25 views

M2 Confirmation Mail: prefix won't translate

Customers are saved in the DB with prefix "Mr." or "Mrs.". Registration Confirmation Email Template looks like this {{template config_path="design/email/header_template"}} <p class="greeting">...
0
votes
0answers
19 views

magento2 How can I override root.phtml in custom controller?

Is there any way I can override root.phtml in my custom controller only? Something like this from M1: <?xml version="1.0" encoding="UTF-8"?> <layout> <mycustommodule_index_index&...
1
vote
2answers
41 views

Template doesn't load on custom theme

I have a problem with loading a new template on payment methods section on checkout, but only on my custom theme. I have created a custom module that adds a new block with template in the above ...
1
vote
1answer
20 views

Can I add the search box to a template without xml?

Can I add the search box to a template without xml? I need to create a dropdown with the search box when I click on a magnifying glass icon.
0
votes
1answer
31 views

Magento2: How to move header-bottom to top

I am trying to move the header to the top of the page. I'm use in default.xml <move element="header-bottom" destination="header-top" as="new_alias" before="header-middle"/> But without a ...
0
votes
3answers
34 views

How to edit template header

I want to change header in template. Hide cart , Login, wishlist etc. from: https://zabezcen.pl/ to: http://zabezcen.pl/strona.png Anyone help me how can I do ? @Update Thank you Guys, I ...
0
votes
0answers
24 views

Product Attribute swatch image in template

I have a product Attribute that can be set as a swatch with an image. How can I get the swatch image src in my template ? I can use the following to get the label. $attribute_value = $_product->...
0
votes
1answer
36 views

How can I get a list of all of the product Attributes?

I have some code to get the product in my block template: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $_product = $objectManager->get('Magento\Framework\Registry')->...
0
votes
1answer
38 views

How to override a phtml from extension?

I am using Mega Menu free extension from Ibnab. I want to override menu file to add custom li. app/code/Ibnab/MegaMenu/view/frontend/templates/html/top-mega.phtml Is there any way to override this ...
0
votes
1answer
35 views

From a plugin how can I override a different plugin template file.?

I'm really new to Magento. How can I override a modules templates files from another module ? I have this file: /app/code/Amasty/Shopby/view/frontend/templates/layer/filter/swatch/default.phtml ...
5
votes
2answers
115 views

How to debug in ko template in magento 2?

Here is the code in \vendor\magento\module-checkout\view\frontend\web\template\shipping-address\custom-method-item-template.html <tbody collapsible="as: '$collapsible_' + method.method_code"> &...
0
votes
0answers
30 views

Adding link below custom image on Product page

Not a developer so please bear with me, On one of my stores I have a manufacturer section that uses a separate plugin for magento 1.9.2.4. It has the option to add the manufacturer logo on the ...
-1
votes
0answers
9 views

End of Long Products DropDown Menu goes off screen in template

Trying to modify A long dropdown menu so the end of the products list will no go off the end of the main-container/page I would like it to work like Solution For Very Long Dropdown Menus form css-...
0
votes
1answer
27 views

Output Base URL in root.phtml

my root.phtml looks like this: <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile ?> <!doctype html> &...
0
votes
0answers
19 views

How to render HTML in x-magento-template?

I have used this blog https://webkul.com/blog/how-to-write-javascript-template-in-magento2/ to use x-magento-template. In this I can render data using such code: <%- data.name %> But it shows ...
1
vote
2answers
90 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
32 views

Magento2: Template how to edit header

I want little change header in template. 1) I need to shorten a little search engine 2) Move logo to banner search engine 3) Search engine move to up and stick always on top. Can anyone help me ...
0
votes
0answers
10 views

M2 js getUrl links randomly absolute or relative

I am not used to frontend development... We have a link like this: <a class="primary button" data-bind="attr: { href: getUrl('my-special-page') } href="my-special-page"> <span data-bind="...
0
votes
2answers
42 views

How do I override plugin phtml file added by XML?

I have the MageFan Awesome Blog plugin for my Magento 2 instance. I've managed to override the recent posts template by adding my own BlogOverride plugin to my vendor. Now I am trying to override the ...
0
votes
2answers
36 views

Magento 1 - setTemplate in block class constructor does not work

I try to overwrite the template app\design\frontend\venedor\custom\template\catalog\product\view\options\type\select.phtml with app\design\frontend\base\default\template\wr\catalog\product\view\...
1
vote
1answer
35 views

Why is my override not working?

I've been trying to create an override for the addto.phtml file but it doesn't seem to be working. I have this theme file: /app/design/frontend/Vendor/theme/Magento_Catalog/product/view/addto....
0
votes
1answer
30 views

Magento1 How to set template for a widget?

I have created a widget and I don't know how to set the phtml template for the widget.
0
votes
2answers
93 views

Print all PHP variables available in template

How can I print all the available PHP variables which I can use in a template? For example all variables which I can access in app\design\adminhtml\default\default\template\wr\catalog\product\edit\...
0
votes
0answers
33 views

Update programmatically config content text/x-magento-init script inside of phtml template

For a requirement I had to override the config of the configurable.js script that is initialised inside configurable.phtml, this one specifically: <script type="text/x-magento-init"> { ...
0
votes
0answers
10 views

Magento 1 widget structure

I want to create a widget which I am gonna use it as an advertising banner. I followed this tutorial widget. The thing is (in this tutorial and all the rest that I was able to find) there was not a ...
1
vote
1answer
31 views

Magento 2.2: Where is the block of template html?

I need to add a conditional by checking the information of an custom attribute, for example if it is 'S' to show the address, if it is 'B' not to show the address I need to modify the next template: ...
0
votes
1answer
41 views

Getting “Invalid block type” exception on Magento 1.9.3.7 for custom template inside catalog/product

I am facing a strange issue. I am getting "Invalid block type" exception for a custom block that I have created. I am using the block like this {{block type="example/menu" name="product.menu" ...
0
votes
0answers
29 views

Magento 2 add Block Template in php (not XML)

In Magento 2 one can do with XML : <referenceContainer name="content.bottom"> <block class="My\Module\Block\Index\Index" name="my.block" template="My_Module::test.phtml" /> </...
0
votes
1answer
24 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
10 views

How to change this magamenu logo image?

So, I've been trying my best to remove this menu from my magento2 megamenu but I am unable to do so. Can't change the logo image either. This thing started to suck now. Can you help me with it? The ...
0
votes
1answer
24 views

Magento 2 - adding custom.phtml file

I'm trying to add a custom phtml file in the Product Page before Product Name/Title. For that I've created a custom.phtml file in the path- "...> Magento_Catalog > templates > custom.phtml". ...
0
votes
1answer
45 views

How to call product new.phtml in admin cms home page magento 2.2.6

How to call new.phtml file in the home page admin Magento 2.2.6 version? Please check my screenshot link here http://prntscr.com/lapiu7. And also check my theme default.xml code. <referenceBlock ...
0
votes
2answers
41 views

web html template not able to overwrite

I'm trying to overwrite below html template file but not working. I have already run commands. vendor\magento\module-sales-rule\view\frontend\web\template\payment\discount.html to app\design\...
0
votes
1answer
45 views

Magento 2 - Move Button from Middle Column to Side Bar Section

Hello I need help moving my finance button from the middle column of the product page over to the fixed right side bar of my product page below Add to Cart button. The finance button is a module ...
0
votes
3answers
33 views

Magento 2: Adding a template file before the page footer (invalid template file error)

I am trying to add a template file above my footer to show a subscribe form. In my template I have created a file app/design/frontend/<vendor>/<theme>/Magento_Theme/layout/default.xml. ...
0
votes
1answer
31 views

Magento 1 Set Template Doesnt work

I'm new to M1. I'm trying to add a new custom option type in product My Config <?xml version="1.0"?> <config> <modules> <CompanyName_ModuleName> <version>0....
0
votes
0answers
12 views

Add template below price info in product grid

I would like to add a new template file below price info in product grid. I found the widget used for product grid:vendor/magento/module-catalog-widget/etc/widget.xml:36 Is there any method to add a ...
0
votes
1answer
37 views

Block filter is output to category page

A block filter is output only for a specific category page. I do not know the cause. Is there something wrong with the following templates? app/design/frontend/vendor/theme/Magento_LayeredNavigation/...
2
votes
1answer
169 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 ...
1
vote
1answer
66 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
30 views

$block->escapeJs replacing hyphen with \u002D

On the Send Friend page, under Invitee the label for the email form should be 'E-Mail' on the German store, but because of $block->escapeJs it looks like this: This is the relevant code in the ...
0
votes
1answer
32 views

Wrong template location after overwrite

I have overwritten the _beforeToHtml() method in the class Magento\CatalogWidget\Block\Product\ProductsList. After doing this, I received the following error: Invalid template file: 'product/widget/...