Questions tagged [template]

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

268 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
774 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 ...
4
votes
3answers
957 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\...
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 ...
4
votes
1answer
875 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 ...
4
votes
0answers
238 views

How to display crossed swatches for not available sizes in Magento 2?

I've set up a text swatch for sizes S, M, L. When a size is sold out I want Magento to display the sold out size with a red mark instead of hiding that size option.
3
votes
0answers
232 views

Magento2 Product add form custom form values not posting in observer

I am Creating custom product add form in magento2.2.2. I have added a new tab after product details & Loaded My custom phtml File into It, First To Post Data from product form to observer, i ...
3
votes
1answer
677 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"&...
3
votes
2answers
451 views

Override minicar sidebar price renderer

How can I override a sidebar.phtml from: module-weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml I have tried in the following ways: <referenceBlock name="checkout.cart.item....
3
votes
1answer
63 views

How to work with templates in magento 2

Example.com/customer/account/login/ This page contains three Templates Sociallogin.phtml Login.phtml Newcustomer.phtml I know where these files are located.But i don't know where these files ...
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') ->...
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....
3
votes
0answers
599 views

Magento 2 - Display subcategories above product listing

I'm trying to display the first 8 subcategories above the product listing on a select few category pages. I know that I can easily do this using static blocks, but I'd rather use a custom template ...
2
votes
1answer
155 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 ...
2
votes
1answer
529 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/...
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 ...
2
votes
0answers
163 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
465 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?
2
votes
1answer
2k views

Magento 1.9 add layout and template to custom module in admin

I am new to Magento. 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 ...
2
votes
0answers
22 views

Limit template to only one page in adminhtml

For now I have directly edited this file \vendor\magento\module-backend\view\adminhtml\templates\widget\grid\extended.phtml and I have added a button as you can see from the photo below But this ...
2
votes
1answer
1k views

Add button to admin grid magento 2

How can I add a button in the Adminhtml Reports>>Sales>>Orders
2
votes
1answer
63 views

How to override template in Magento2?

In my custom module I have overwrote the file app/code/Magento/module-checkout/view/frontend/layout/checkout_cart_item_renderers.xml For overriding cart page with the following code: <page ...
2
votes
2answers
155 views

Can't override recent order template from custom module

In customer account dashboard there's a recent orders block, i tried to override it like this: app/code/Test/SuccessPage/view/frontend/layout/customer_account_index.xml <?xml version="1.0"?> &...
2
votes
1answer
419 views

Override summary.phtml template

I want to override the summary.phtml template (vendor/magento/module-review/view/frontend/templates/helper/summary.phtml) with a custom module. The template is overridden in the catalog_product_view....
2
votes
2answers
745 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
0answers
295 views

Magento 2.1 : Multiple Image Uploader in Ui Component Form

I am getting this error <div class="row"> <div class="add-video-button-container"> <button id="add_video_button" title="Add Video" data-...
2
votes
0answers
105 views

Magento 2.1 and symlinks

My server structure is as follows: /var/www/htdocs_webroot/shop -> symlink to: /var/www/shop/deploy_xxxx-xx-xx/htdocs So I can redeploy magento easily and switch back and forth with one simple ...
2
votes
0answers
109 views

Changes to template files not updating in newly created storeview

I am trying to add a second StoreView that uses its own theme and is accessible by a custom URL. For some reason however, I can not get changes to the template files to display in the frontend. This ...
2
votes
0answers
27 views

Recommendations for A/B Testings a block/template

I have a form on my site for customers to request a quote on a product. The form is stored in a template file. I want to test two versions of this form. One form would ask the user to enter their ...
2
votes
1answer
283 views

Magento2 - Get Price without “price-details” AKA Tax

How can I get the price for a product WITHOUT any TAX / Shipping Details? Currently it is echo $block->getProductPriceHtml($_item, $type); and gives out price + price-details (tax etc). Is there ...
2
votes
0answers
3k views

Edit magento 2 order 'print' layout

So when u go to My Account -> My Orders and click on view order and then click Print Order then u see a PDF of the order that u just placed. Mine looks all messy : So I want to edit this. Does ...
2
votes
1answer
439 views

How to use two different price templates / list and detail view

within the following file I can see below shown code: File: frontend/default/ves_fashion/template/common/list/default.phtml Code: <div class="price"> <?php echo $this->getPriceHtml($...
2
votes
2answers
1k 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 ...
1
vote
1answer
17 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:...
1
vote
0answers
29 views

template is not working magento 2 admin customer_index_edit

I am calling a js function form this file current.phtml like this <script type="text/javascript"> require([ 'jquery', 'jquery/ui'], function($){ $(document).ready(function($) { updateAjax()...
1
vote
0answers
27 views

Customizing template in magento2

I need help in 2 questions: 1 - Put a delay for the newsletter popup to open after the uploaded website + 10s 2 - I have 2 javascript (tidio and whatshelp.io) in the footer, the ...
1
vote
1answer
368 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/...
1
vote
1answer
267 views

Why data bind template is not working on 2.2 or greater?

I was studying about Knockout.js and how it works with Magento 2. Then I reached the topic: template integration, in the first sample of it I'm presented to this notation: <div data-bind="...
1
vote
1answer
18 views

Incorrect behavior when sending email with use a block inside a template

When developing the module I encountered the following problem: inside the my controller (class Index extends \Magento\Framework\App\Action\Action) there is a method that calls a method to send email ...
1
vote
1answer
47 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 ...
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 ...
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
0answers
72 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->...
1
vote
2answers
745 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 ...
1
vote
0answers
89 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
517 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/...
1
vote
1answer
400 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 ....
1
vote
0answers
27 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
1
vote
0answers
21 views

Magento 1.9 Can I override the registration page only for one of the stores?

I have multiple stores. I need to override the existing registration page, but only for 1 store? How can I achieve that?
1
vote
2answers
21 views

Using a custom block

I've created a simple module, purely for the block. I want to add it to the newsletter.phtml file that controls the customers newsletter subscriptions as I need to create custom functionality through ...
1
vote
0answers
794 views

Error filtering template: Invalid block type

I'm trying to create my own widget in Magento 2 however I get this error: Error filtering template: Invalid block type: Inchoo1\CatalogWidget\Block\Product\ProductsList My code is identical to ...