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.

1
vote
1answer
18 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
27 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
33 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
21 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
35 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
93 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
27 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 ...
0
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
16 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
51 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
31 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
40 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
33 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
33 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
26 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
63 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
29 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
27 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
36 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
28 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
23 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
43 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
37 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
32 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
28 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
11 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
35 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
103 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
43 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
25 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
31 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/...
1
vote
1answer
21 views

Magento2: Object DOMDocument should be created

I have installed the Tigren_Ajaxcompare extension. Got the error message below Object DOMDocument should be created. Block <?php /** * @copyright Copyright (c) 2017 www....
0
votes
1answer
26 views

Magento 2 - two language version, where is global css?

I have two language version, where is global css? I changed file \htdocs\mgnt2\app\design\frontend\TemplateMonster\framework\web\css\style.css But my changes are visible only one language ...
1
vote
2answers
71 views

Magento 1 - action method setTemplate is ignored

I try to overwrite a template file with another one which I provide with my extension. I also noticed that other action methods are working just fine, e.g. <action method='addLink'... successfully ...
1
vote
1answer
36 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 ....
0
votes
1answer
24 views

How to add lists brand under footer

I want to add brands list under footer: Can anyone help?
0
votes
0answers
11 views

Add payment code as class name in Checkout Payment Methods

In Checkout page, available Payment Methods are listed through this file: vendor/magento/module-payment/view/frontend/web/template/payment/free.html I'd like to add a class name on each payment ...
0
votes
2answers
78 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 ...
0
votes
3answers
41 views

Is it possible to include a phtml file from another module in my template in Magento 2?

I'm making a Megamenu Module, where I want to include the phtml of a file in my MailChimp module (Signup Form). Is there a way I can call on this template from within another module?
3
votes
1answer
115 views

Overriding template for a specific language

I would like to override a template but only for a specific language (ar_SA) The template I want to override is: Magento_Catalog/templates/product/list.phtml I have tried putting it in the following ...
1
vote
0answers
25 views

Not adding in cart magento 2

I installed this template http://magento2.flytheme.net/themes/sm_shop4u/default/ and i am facing this error when triyng to add in cart please help
0
votes
2answers
29 views

Split array in ko template

I have a array with following structure in ko template styleBasedProductsDetails = {{ "image_url": "media/images/home-page/1.jpg", "link_url": "push-up-bra-online/" ...