Questions tagged [template]

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

292 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
88 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?
5
votes
1answer
970 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 ...
5
votes
0answers
250 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.
4
votes
3answers
3k 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 ...
3
votes
1answer
526 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 ...
3
votes
0answers
268 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
755 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
625 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
97 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
3answers
1k 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: ...
3
votes
2answers
3k 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
0answers
366 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-...
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
603 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
288 views

Magento 2 email_order_set_template_vars_before observer triggers only when I resend email in the admin

I created a new template var using email_order_set_template_vars_before observer and it works when I send email new order through the Magento admin. But it does not trigger when new order is placed. ...
2
votes
1answer
259 views

Review form in custom template not working Magento 2.3.4

I have created a custom template for the product page based on the attribute value. in my template i used below code to display the review section. <?php echo $block->getLayout()->...
2
votes
0answers
1k 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
2answers
1k 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/...
2
votes
0answers
28 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
253 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
850 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
3k 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
71 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
199 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
0answers
112 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
112 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
29 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
288 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
452 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($...
1
vote
0answers
15 views

Move block after size atributte of product page [Magento 2]

I want to move a block and put it after size attribute because when I click this button magento detect that I add to cart: I use this to move after add to cart, but I don´t known to move to the other ...
1
vote
1answer
32 views

How to override a template file in magento 2

I want to override final_price.phtml template file located at /vendor/magento/module-grouped-product/view/base/templates/product/price/ How should i do that?
1
vote
0answers
29 views

Attempting to display specific custom attributes in a particular table format

This may not be the best place to ask this question as it might be more of a php question but I took up building a Magento site as a hobby during covid-lockdown so I thought I'll ask here - apologies ...
1
vote
0answers
15 views

Display Custom CMS Fields in Magento 2 Template

I'm can't seem to find any documentation on how to get custom CMS fields in a PHTML template in Magento2. The following snippet did it in Magento2: Mage::getBlockSingleton('cms/page')->getPage()-&...
1
vote
0answers
42 views

Magento 2 : What template engine is used for email templates?

What template engine is used for Magento2's email templates? I've not been able to get confirmation on this.
1
vote
1answer
94 views

Magento2 - Search preview not showing up

I have a custom template file in which I am trying to call search block as showing up in header. In header the search is rendering through <?php echo $this->getChildHtml("topSearch"); ?> ...
1
vote
0answers
18 views

Template notations in magento

I was working with the Algolia search module in Magento 2 and foud something like below in the template files. Can anybody let me know what this notation is called and where can I learn more about ...
1
vote
0answers
27 views

Magento 2 - Show Subcategories and Images on Category Template

I want to show subcategories and the images on the category page. If the user clicks on Apparel the page would show all the subcategories with the subcategory image. I placed this code in my theme ...
1
vote
1answer
57 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
1answer
50 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\...
1
vote
0answers
49 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/...
1
vote
0answers
47 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
35 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
591 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
20 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
81 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
41 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
2 3 4 5 6