Questions tagged [template]
The folder that contains all the `phtml` files used to display at frontend or backend.
1,406
questions
1
vote
1
answer
591
views
How to override adminhtml template file in magento 2
I want to override one adminhtml template file located at /vendor/magento/module-sales/view/adminhtml/templates/order/create/form/account.phtml
What steps i need to follow?
2
votes
2
answers
572
views
Error filtering template: The entity that was requested doesn't exist. Verify the entity and try again
I am trying to fetch the order details
$order = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId);
Order id is correct 000000020. In var log main.CRITICAL: The entity ...
1
vote
0
answers
25
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()-&...
0
votes
0
answers
90
views
Update/overwrite Third party module which is installed in vendor folder
I have two extensions installed via composer and that is in vendor folder. I have done some customisation on those modules ie: updating the files in the vendor/mymodule/ folder. Now after a Magento ...
0
votes
2
answers
25
views
Can't read new product attribute in template
I added a new attribute to a product. The attribute is named "is_brand_new". The product shows in the catalog product view in the upselling and related slider.
But the new attribute is not in the ...
0
votes
1
answer
56
views
Best method to use helper in any template
It seems to be impossible to use a helper in the template Magento_Catalog\templates\product\list\items.phtml.
I have tried it via argument injection:
app\design\frontend\company\base\Magento_Catalog\...
0
votes
0
answers
26
views
Overriding the product template, where to find the default file?
Inherited a project and am not familiar with Magento enough to know where to find things.
There are a bunch of errors on our product detail page (app/design/frontend/{name}/{dir}/Magento_Catalog/...
0
votes
1
answer
697
views
Magento 2 : How to change html/css classes of onepage checkout in custom theme
I'm creating a new theme from scratch, I would like to change the html code of the checkout/#shipping page. However, the template (Magento_Checkout/onpage.phtml) containing the html code that I would ...
1
vote
1
answer
239
views
can't update a page template
Hi all and nice to meet you.
Some days ago I've modified vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml in order to add a static phrase to every product page.
I ...
1
vote
1
answer
1k
views
How to change html output of method "getItemHtml" in custom theme
I'm overriding the file Magento_Checkout/templates/cart/form.phtml, I stumbled upon some php code generating html code which I can't find its origin
Here is the code
<?php foreach ($block->...
0
votes
1
answer
602
views
Display mini search form in template?
Magento 2.3.3
I want to display the mini search form form.mini.phtml in a template. In Magento 1 I did it like this:
$this->getLayout()->createBlock('core/template')->setTemplate('...
3
votes
1
answer
2k
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. ...
0
votes
2
answers
418
views
Invalid template File after installing on Windows
I am just freshly installed Magento 2.3 on Windows 10 . When i load the url for front end , the templates are not loading correctly and there is Dark blank page when loading admin url. I found this ...
0
votes
1
answer
35
views
Issue with calling attribute value on product view - Magento 2
I have two custom product attributes that I'm using in my product page template files. One of them doesn't seem to work and I'm wondering if it's something to do with the attribute code.
The ...
0
votes
2
answers
513
views
Add static page via custom theme
I created a custom Theme for our shop which works pretty fine.
Just one thing is bothering me: I created some words in the footer and want to link them to custom pages which only have static content. ...
0
votes
1
answer
478
views
Override comment history order in backend
I'm trying to override the template for the comment history of a order (the part next to the total of the order).
this is my path to layout .xml :
app/code/Portail/Fournisseur/view/adminhtml/...
0
votes
1
answer
641
views
Magento 2 How I can add a div inside `product-image-container` in Magento to catalog pages
I want to add a New <div> in inside class="product-image-container" in Magento 2 I have searched and found that this class is rendered like this
$productImage = $block->getImage($_product, $...
0
votes
1
answer
343
views
Magento 2 - Override core template in own module
I want to override the template Magento_Customer/templates/form/register.phtml in my own module.
At the moment the override is in my theme:
app/design/frontend/company/base/Magento_Customer/...
0
votes
4
answers
606
views
How to know which template I am currently working in magento 2
good morning everyone, I am a little bit new on Magento 2.x, I am working the full time make some changes in some view which contains a template but I suffer and struggle to know which template in ...
0
votes
1
answer
390
views
Filter custom attribute in product collection
I have created a custom attribute with name product_deisgn_proof.
I want to filter this attribute using product collection in custom template file. When I try to fetch collection of product in an ...
0
votes
2
answers
820
views
Magento 2 : Getting PHP variable in js extended template
I added a step in Magento 2 checkout process.
by extending a template using .js file
return Component.extend({
defaults: {
template: 'vendor_module/mytemplate.phtml'
...
0
votes
2
answers
284
views
How to get data from a model without calling the objectManager in the template
I have a custom Order model, it has a method in it @method int getIncrementId()
I have a template to transfer the id of the current order/app/code/Qq/Www/view/frontend/templates/success/index/...
0
votes
1
answer
801
views
Custom catalogsearch layout and template override not displaying custom block content [EDITED]
Edit: Could not having crontab and cron set up affect compiling the layout files and be related at all to the custom layout not loading? I have since moved all my logic out of the app/design/frontend/...
2
votes
0
answers
134
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.
0
votes
1
answer
538
views
How to display crossed visual swatches for not available sizes in Magento 2?
I've set up a Visual swatch for sizes S, M, L. When a size is sold out I want Magento to display the sold out size with a red cross mark instead of hiding that size option.
1
vote
1
answer
2k
views
Magento 2.3.* - How to override ViewModel for override block?
Magento 2.3.*
I want to override ViewModel for the override block (custom.block.name). But the issue is my .phtml a file called from the block and it is calling on some condition. Not every time call....
1
vote
1
answer
414
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
0
answers
40
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 ...
0
votes
1
answer
83
views
Add block from Luma parent into child theme
I'm using a custom child theme with Luma as the parent, I have a custom page layout xml file and I'd like to include a block that's defined in the parent theme:
<block class="Magento\Theme\Block\...
1
vote
3
answers
222
views
Magento2.3: How to show the template file in a particular category page?
I have a custom module and on that I have a template file. I want to show that template in a particular category instead of it displaying in all the category pages.
How can I achieve that?
Anyone ...
0
votes
1
answer
768
views
Magento 2 How to call template file in block file
My block file form.php and I want to call phtml file in this block to display table in this custom admin form, I have no created a layout for this phtml file, if is there any other way to display the ...
0
votes
3
answers
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
1
answer
229
views
Modification to .phtml does not render
In content/page homepage I insert a widget from the porto theme:
{{block class="Smartwave\Filterproducts\Block\Home\LatestList" name="latest_product"
product_type="4" product_count="50" category_id="...
0
votes
2
answers
78
views
Magento Commerce Cloud 2.3 which template(s) for products displayed by page builder
In my custom theme I need to modify the product list/grid templates for products that were placed there using the page builder.
Can anyone please tell me where I can find these template files? Thanks
1
vote
0
answers
218
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 ...
0
votes
1
answer
2k
views
How to create a Block, Layout and Template for backend module in magento 2
I have doubt as how to create Backend Module using block,layout and templates.
After creating the block,I have assigned the block in app_appdashboard_index.xml file and I called the block page ...
1
vote
1
answer
627
views
How to create a frontend custom page module with view template files in magento 2.3
I have doubt as how to create Frontend Module with View template files. I have created Module using this reference Magento Documentation "https://devdocs.magento.com/videos/fundamentals/create-a-new-...
3
votes
0
answers
213
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 ...
0
votes
1
answer
694
views
How to overwrite a payment method js renderer component?
Resolved: Seems the error has been caused by the requirejs and my lobster hands :) I rewrite a default Component and trying to extend it inside own component which rewrites a default component: ...
1
vote
1
answer
52
views
Shipment Label Change
I want to know that form which file this label is coming:
0
votes
1
answer
469
views
Override Amasty template
New to magento, I'm trying to override vendor/Amasty/Promo/view/frontend/templates/notification.phtml called in vendor/Amasty/Promo/view/frontend/layout/default.xml
So I've added the file in this ...
0
votes
1
answer
4k
views
How to pass text input value to js in magento 2 knockout js?
In my template.html file, I am having only the input field. After I complete entering the text in the input field, I need to pass the value to the js file without any button click. How to achieve this ...
0
votes
4
answers
98
views
How to add css in custom module using layout file in Magento2?
I wan't to add bootstrap.css to a template in a custom layout.xml, this is my code:
view/frontend/web/css/bootstrap.css here is the css file
view/frontend/layout/pakke_trackshipment_info.xml
<?...
0
votes
1
answer
408
views
Magento 2 How to pass data from Controller to Block
I need to send data from controller to Block, I have used many ways but it does not work.
I'm trying this way:
Controller.php
public function execute()
{
$order_id = $this->getRequest(...
1
vote
1
answer
514
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 ...
0
votes
1
answer
163
views
Adding div around footer elements causes issue
I'm trying to add a simple div around the copyright & bug report links in the footer. I can achieve this by doing this:
<referenceContainer name="footer-container">
<container name="...
1
vote
1
answer
541
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\...
0
votes
3
answers
224
views
Magento2.3: How to set the border bottom for whole header?
I have a megamenu in header and want to set the border bottom for the whole header and it should be aligned with the megamenu border but its not working as expected.
I have tried that into the ...
3
votes
0
answers
162
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/...
6
votes
1
answer
1k
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:...