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
3answers
183 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\...
14
votes
4answers
22k views

Magento 2 Get order total on success page?

I'm trying to get the order total on the success page on magento 2 , I have added this code <?php $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); $totall = $...
0
votes
1answer
972 views

Failed to call function “on click” in magento 2

I have created the add button using the below block file. On button click I have called return FilterControl.addItem() from my template file seo.phtml. But it shows error like below Uncaught ...
2
votes
2answers
2k 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
1answer
4k views

Magento 1.9 add layout and template to custom module in admin

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 in the admin area but ...
1
vote
4answers
77 views

How to pass variable to $block->getChildHtml('form_additional_info')

I need to pass the customer object from the edit.phtml template to a child template: I have this but it does not work: <?php $block->getChildBlock('form_additional_info')->setData('customer', ...
2
votes
1answer
925 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. ...
9
votes
3answers
4k views

Magento 2: proper use of helpers

I'm starting to see more and more people declaring helpers classes in order to be able to use the following in the template files: $this->helper('Path/To/Helper/Class')->customMethod(); This ...
0
votes
1answer
263 views

Template vars/placeholders

Relatively new to Magento and seeing a lot of this lately in (email) templates: {{template config_path="design/email/footer"}} {{depend order.getIsNotVirtual()}} {{layout handle="...
2
votes
4answers
1k 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?
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: ...
0
votes
0answers
10 views

Error log showing a template file but module not found in my files

My Magento 2.2.6 Website is become very slow when we are adding product or updating product in backend and some time website is crashing . So when i check the log file i have found following error ...
0
votes
2answers
440 views

Magento 2 : Search query in magento search terms

What is Search Query On Magento search terms? How it affect the website ? I have over 3 million query on my website a lot of them have nothing to do with what I sell ? Do i need to delete it from ...
4
votes
2answers
697 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 ...
0
votes
2answers
40 views

I want to call phtml file from Magento_Theme to static block. but it is giving some error

PHTML file is located in Magento_Theme/templates/html/breadcrumbs.phtml. I tried with the code {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html\...
0
votes
1answer
1k 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
1k views

Product Page Layout

I'm trying to find a way to add a new custom layout for some products so I can just go to the Design Tab and choose the "Page Layout" from the dropout. I can only find CMS Layout pages in google. Also ...
0
votes
5answers
2k views

Custom magento 2 theme not showing up up on content/design/configuration

I have been trying for two day to figure out how I can customize my magento template. Recently I have become stuck on being able to pull up my new magento theme in the backend admin panel. I have ...
0
votes
1answer
40 views

Make product data tabs collapsed by default

I want all product data tabs on the product details page to be collapsed by default. I edited this line in app/design/frontend/<Namespace>/<theme>/Magento_Catalog/templates/product/view/...
0
votes
0answers
15 views

I want to add swatch images from product page to home page product list

I want to add swatch images from product page to home page product list. swatch images from here to to here, replace the text"THIS is a custom" to swatch images How can I do this.
13
votes
2answers
9k views

Magento 2 : How to add placeholder text to street fields in checkout?

In back-end I've set the street address to have 3 lines. I'd like to put a different placeholder in each field: Street Building / Apartment Area This way user can enter data in a more structured ...
4
votes
1answer
2k 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 ...
0
votes
1answer
16 views

Magento 2 Invoice Emails: Tax row alignment in subtotals

So I wanted to change the layout of my invoice emails, especially order totals. I wanted labels to align right. I copied my totals.phtml file in my theme and added my styling. <?php /** * ...
5
votes
1answer
1k 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 ...
0
votes
0answers
9 views

Can't override a renderer template in sales_order_item_renderer.xml

I have already checked a lot of posts about overriding item renderers (and some of them really work in places like e-mail and checkout), but I can't override a template in sales_order_item_renderers....
0
votes
1answer
925 views

How to override or extend Product List Page template to show Icon on Product Images in Magento Extension

Consider the Below Image I want to show an Icon on the Image of each product. I am developing an extension and I want to do this task via that extension, independent of theme. How can I achieve this ...
0
votes
1answer
2k views

Javascript in ajax loaded modal popup

I'm working on a module that needs to open modal window and show some content inside of it + some js logic. So I load template with ajax request which works just fine: (simplified template): <...
2
votes
0answers
144 views

Magento 2 Tricky Certification Question - Relation between Block and Templates files [duplicate]

Case 1: Single Block & Multiple Templates No this can not be true as at a time only 1 template can be assigned to any block. you can not assign multiple templates to any block. the block template ...
1
vote
1answer
48 views

How to add Custom Step on Checkout and move Shipping methods in that step In Magento 2.3.5

In this i want one custom checkout step can having only shipping methods inside the step means shipping address and Shipping methods are on different steps on checkout page. So, Please can anyone have ...
1
vote
1answer
2k 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
1answer
97 views

Adding Meta tags to the head of a CMS page Magento 2.3.6

In order to add the following meta tags to the home page I have done the followings: <meta property="og:image" content="https://example.com/media/wysiwyg/abc.png"> <meta ...
1
vote
3answers
888 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="...
0
votes
1answer
1k views

Magento 2 Credit Memos : Template override doesn't work after clicking “Update Qty's” button

I am creating a custom module to simplify the Credit Memo creation for admin users. One of the features is hiding the "Return to Stock" column. I have overwritten 2 files for this: vendor/magento/...
1
vote
1answer
16 views

Calling the welcome message in different template?

Is it possible to call the default welcome message when user is logged in ("Welcome, customer.fullname") in a different .phtml? I'd need this message in my Magento_Customer/templates/account/...
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
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') ->...
0
votes
3answers
2k views

Email template preview is not working on live Magento 2

When i try to view the template in Live i am getting a blank screen but if try to view the template locally or on staging it works without any issues. Can anyone give me a hint or any help idea to ...
0
votes
1answer
41 views

Magento 2 layout and template overload in child theme not working

Good Afternoon All, I am having trouble with overloading a template for Magento 2 "module-catalog" module. My overload in the child theme would be the 4th overload in the chain and it is not ...
0
votes
0answers
22 views

How to get dial code from selected country in textbox before telephone filed using knockout js

I want to develop functionality in that i have created one field for country dial code on checkout page and according to changes of country dropdown dial code will be changes automatically in that ...
0
votes
1answer
14 views

Magento 2 - Show validation message in custom container on product update page

I try to show the validation message which shows if you enter a wrong value (for example 0) and try to add the product to the cart, in a custom place. I try to do this on the product update site, ...
0
votes
0answers
15 views

Magento 2 how to use step navigator of checkout in a custom template?

I'm trying to use the checkout step navigator bar in another template. I tried this but did not work, it just shows buttons: in phtml. <div id="steps" data-bind="scope:'steps'"&...
0
votes
2answers
2k views

Magento 2 Retrieve store phone number

I tried using this function $this->_scopeConfig->getValue( 'general/store_information/phone', \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES ); And it is always returning ...
0
votes
1answer
38 views

How can i insert custom tracking url in Order confirmation Email Template?

I want to insert my custom tracking url in Order Confirmation email and url is https://vitalticks.shiprocket.co i put code like this Track you Order here:Vitalticks Order Tracking Page But it is not ...
0
votes
0answers
14 views

Magento 2 How to send data from one html template to another?

I'm developing 2 forms with knockout js and html template. This 2 forms templates need to be separated, however they share data in common, for example, coverages amounts (this templates are about ...
2
votes
1answer
58 views

Magento 2 Custom template content will not shown in graphql response of CMS page

I have a CMS page in which I want to show the date e.i Current date OR Date after 5 days etc. So for that I have created a template file and call inside the CMS page. It will show content in Front but ...
2
votes
3answers
244 views

Magento 2 - How to override knockoutjs template?

I try to override the following template from my own module vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html but I don't find the file where I can override it, I ...
4
votes
3answers
4k 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\...
1
vote
2answers
2k 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
0answers
19 views

Magento 2 send data from html template to Controller without Ajax

So I have created a component which has 2 templates, but the property data is the same for both. I wanted to know if there is a way to send data without using ajax. Why? Because I don't need to use ...
1
vote
1answer
918 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
2 3 4 5
28