Questions tagged [template]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
128 views

Magento2: How to change layout product detail

I want to change size and layout product detail: from: similar to: details.phtml <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @...
-1
votes
1answer
306 views

Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in

Magento 2.2.5 version. Every time trying to go to product page I get error: Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in /var/www/html/app/code/MGS/Mpanel/Helper/...
1
vote
1answer
49 views

different template files for product detail page of simple and grouped product types. - Magento 2.2.x

I have 2 types of product in my website. 1) simple products and 2) grouped products i wanted different design for both this types of product types. so how can i have different template file for ...
2
votes
0answers
26 views

How to deal with multiple extensions overriding the same template file?

I have two extensions which load their own template for the block with name customer_form_register in customer_account_create The first extensions overrides the template to add a new field to the ...
1
vote
1answer
16 views

Invalid template file within custom template

I am trying to work out why related products arent being displayed on my frontend, and when I check the logs I am presented with the below. Any help would be great. Thanks [2019-02-14 13:56:02] main....
1
vote
0answers
26 views

subcategories collapse after click in menu

When I click on parent category then sub category opens and when I click on subcategory the respective page open but the menu collapse it does not show on which category and sub-category we are. Can ...
0
votes
1answer
406 views

Magento2 render custom block in adminhtml layout.xml

I can not render my custom block within my custom template, Point is on newsletter subscriber, I extend newsletter_subscriber_form.xml, Add container within my block but it says that template is ...
1
vote
1answer
117 views

Magento 2 Templates: How `$block` is assign in template?

Can you please tell me where the assignment of the $block variable to the template occurs? \Magento\Framework\View\TemplateEngine\Php::render() I found : $tmpBlock = $this->_currentBlock; $...
1
vote
1answer
142 views

How add a country selector in the header section?

I need add a country selector in the header section, next to the currency selector. How is the right way to do this? Edit: I realized that there was not much information in my question, so it was ...
1
vote
1answer
130 views

finding location of $this->getLinks() in template

I have a phtml template that has the following code in it: <?php $links = $this->getLinks(); ?> <ul class="social-links"> <?php foreach ($links as $name => $group): ?> ...
1
vote
3answers
1k views

Magento 2 override minicart.phtml in custom module

I'm trying to override minicart.phtml file from Magento2\vendor\magento\module-checkout\view\frontend\templates\cart\minicart.phtml to my custom module Magento2\vendor\XXXX\YYYY\view\frontend\...
0
votes
0answers
26 views

Install layouts and templates from the theme divante

I installed the theme https://github.com/DivanteLtd/magento2-rapid-theme, the theme got up, everything is in order, I don’t understand how to set the main page to make it as an example. The topic has ...
0
votes
1answer
145 views

Show Separate product detail page based on attribute value in Magento 2

Shall we load separate product detail page based on the product attribute value in magento2 ? I have created the attribute product called "type_of_product" If this attribute value is "Test 2", I ...
1
vote
1answer
251 views

Magento 2 knockout js dynamic button title in minicart

I'm trying to add dynamic checkout button title in minicart using knockout js. Button title will be configured in admin configs. I configured in minicart.js But I dont know how to use/call in template ...
3
votes
2answers
206 views

Magento 1.9xx - Not valid template file

Today I took a look into the system.log from one of our Magento shops and I saw that there is an error: 2019-01-20T09:05:52+00:00 CRIT (2): Not valid template file:frontend/base/default/template/...
0
votes
0answers
24 views

what are all possibility available in magento 2 for all block and template relations?

Recently, I received this question from a reader of my personal blog and it's puzzled me too. He also asked another question: block can be assigned to multiple templates? I think a template can be ...
0
votes
3answers
153 views

Magento2: How to center box with price, product name etc

I try to center box with product details: So, in list.phtml I found code responsible for this box. <div class="product details product-item-details"> <hr /> ...
0
votes
0answers
33 views

Magento2: How to check template name

I want to check template name for this website: https://sportofino.com/ I try to find in source skin but cannot find. Anyone help?
0
votes
0answers
35 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
70 views

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
171 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
14 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
169 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 ...
2
votes
4answers
489 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
22 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 ...
1
vote
1answer
965 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
65 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">...
1
vote
2answers
161 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
50 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
285 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
86 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 ...
1
vote
0answers
73 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
40 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
74 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
120 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
1k 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
1answer
56 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
1answer
209 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
768 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
673 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
2answers
196 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
116 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
45 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
349 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
3answers
223 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\...
1
vote
0answers
90 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"> { ...
1
vote
1answer
140 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
304 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
38 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
387 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 ...