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
1answer
189 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
2answers
1k 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
4answers
125 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
1answer
46 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
1answer
43 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 ...
2
votes
1answer
15k views

Not valid template file in magento

I have added the following to local.xml file <?xml version="1.0"?> <layout version="0.1.0"> <contacts_index_index translate="label"> <label>Contact Us Form</...
0
votes
1answer
695 views

Cannot Load Page Items

On the front page of our site, some of the modules are not loading with a simple error message in place. "We're sorry, an error has occurred while generating this email" On looking in the exception ...
0
votes
1answer
367 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/...
0
votes
1answer
120 views

Magento2 - Google Pagespeed Insight : any idea why it takes account of desktop css?

My question might not be magento specific, but I'm curious, as I couldn't find the answer elsewhere (or failed to find the correct terms). When I use Google Pagespeed Insight on a magento 2 website ...
0
votes
2answers
72 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
2answers
58 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/...
1
vote
0answers
61 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
2answers
34 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
1answer
269 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....
0
votes
1answer
145 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
1answer
155 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
21 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
1answer
41 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
3answers
76 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 ...
16
votes
5answers
32k views

Why does my translate.csv and the translation files not work?

I'm trying out a new theme and it seems to not get the translations properly. If I search for the English phrase in my files, I can find: "You have no items to compare.","Sie haben keine Artikel ...
0
votes
1answer
155 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 ...
1
vote
3answers
2k views

how to call phtml inside phtml

I have a custom phtml inside I called attribute.phtml but it's not working: echo $block->getTemplateFile('Magento_Catalog::product/view/attribute.phtml'); echo $this->getLayout() ->...
0
votes
1answer
47 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
2answers
3k views

How to remove Social Media Icons from Product View page?

I am looking everywhere in the Admin panel and in the file manager. I can not find where to remove the social media icons from under the "Add to Cart" button. Can someone please point me in the ...
1
vote
1answer
121 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-...
1
vote
0answers
45 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
1answer
93 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: ...
4
votes
1answer
611 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 ...
1
vote
0answers
108 views

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

What is the Relations between blocks and templates ? Pick 3 options. A) - Single block can have multiple template files. B) - Multiple block can have single template files. C) - Single Block instance ...
1
vote
1answer
31 views

Shipment Label Change

I want to know that form which file this label is coming:
0
votes
1answer
147 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
1answer
2k 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
4answers
50 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 <?...
1
vote
1answer
478 views

Magento2 get ID of product in price template default.phtml

How can I get the ID of product in Magento 2, in tempalte vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml I copied it to my theme: /app/design/frontend/xxx/ddd/...
1
vote
1answer
2k views

how to override email html file in magento2

I want to change following text in checkout page You can create an account after checkout. Actually this line is coming from following file. app/code/Magento/Checkout/view/frontend/web/template/...
0
votes
1answer
46 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(...
37
votes
10answers
32k views

Where is Template Path Hints in Magento 2?

Just started playing about with Magento 2. Can anyone tell me where I can find the "Template Path Hints" option that used to be in System > Configuration > Developer > Debug?
2
votes
3answers
11k views

Updating html template not show in Magento 2 Checkout page

I use Magento 2.0 for the first time and I am trying to make some changes on Checkout page. For example, I want to change template module-checkout/view/frontend/web/template/estimation.html, so I ...
1
vote
2answers
732 views

Magento 2: Change links html class in customer account navigation

I'm trying to change the html classes for my customer_account_navigation block. What I actually want to achieve is to display different icons for every single link. I tried the following in the ...
1
vote
2answers
665 views

Custom module does not display in page

I'm trying to add custom block module to homepage but it does not load my block.phtml file. Here are my files: app/etc/modules/MG_Block.xml: <config> <modules> <MG_MyBlock&...
1
vote
3answers
7k views

Override html template file in Magento 2 not working

I want to override Magento 2 html template located at vendor/magento/module-checkout/view/frontend/web/template/billing-address/details.html I tried using require-config.js for frontend like this:...
0
votes
1answer
46 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="...
3
votes
2answers
3k 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 ...
0
votes
2answers
6k views

Magento2 | How to call Template from a Controller

I got this controller: <?php class MyClass extends \Magento\Sales\Controller\Adminhtml\Order { public function execute() { echo "TEST"; } } ?> I want it to ...
1
vote
1answer
90 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
2answers
179 views

Magento 2 How to remove template in checkout page?

We have a custom template file and want to display it on all the pages except the checkout page. However, it shows even in checkout page. We have used the below code in our theme default.xml. <...
0
votes
3answers
102 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 ...
6
votes
1answer
1k 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 ...
2
votes
0answers
68 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/...
0
votes
2answers
28 views

Trouble in getting in customer data using block class

I'm having trouble in getting the customer details using block class. I want to show the customer name after he/she logged in using block class. I can do it via object manager but not through block. ...

1 2 3
4
5
28