Questions tagged [template]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
21k views

How to change template of category page depending on category level in code?

I had a project where there was no pattern and I applied all changes of categories layout in Admin area (Catalog->Manage Categories->Custom Design tab). Now I need to have the following: Parent ...
3
votes
2answers
7k views

Load Custom Admin Template

Developing a simple custom module, and the hardest part is getting the template to load in the admin. I'm sure I'm missing something simple (but important). The template will not load. I believe ...
3
votes
2answers
670 views

Italian translation.csv for tax not working

We have a Italian website on our Magento installation. All the translations are working from our theme's locale/it_IT/translate.csv file with the exception of "Tax","IVA". On the italian site Tax is ...
3
votes
3answers
8k views

Magento 2: How to call function in phtml file from parent block

I have create a block which contains a phtml file.This .phtml file called other phtml file. Please check code : block name : ..\block\country.php This block has a template file, name : country....
3
votes
1answer
2k views

pass data from phtml file to controller

I want to pass data from my 'phtml' template file to controller file please help me to do this. this is my code for text box in phtml file <input type="text" class="input-text watch-keyup" id="...
3
votes
3answers
827 views

Override templates no effect - magento 2.0.1?

I try to override listing.phtml for the purpose of remove add to cart button from widget. I follow this link But no effects will be happen.I am using customize theme which extends to magento blank. ...
3
votes
1answer
49 views

Magento 2: Ajax without effect

My problem is as follow, my script except ajax in working (no problem with giving value or console.log) but my ajax doesn't give me the result expected (remove hidden class and fill a drop list with ...
3
votes
3answers
1k views

Provide properties to views in Magento

In Zend Framework we provide properties to layouts which are then consumed in the view. An example of this would be: $this->layout = new Zend_Layout(); $this->layout->username = 'John'; $...
2
votes
3answers
4k views

Add store code to body as class on all pages

I have a website with 2 stores, one for each language. Magento adds the store name to the body on CMS pages, but not on the rest of the sites. The only setting that is remotely related allows me to ...
2
votes
2answers
296 views

How Can A Block Render Without Specifying `as` property of the block, When we use getChildHtml() Method

This is the source for my doubt. Please have a a look on this question, answer and answer's comment. Basically the question demands to include a core/template block inside header block. For this we ...
2
votes
2answers
1k 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 ...
2
votes
1answer
2k views

Magento 2 - Get Attribute Set by ID?

Is there a way from a phtml file to get the attributes of an attribute set given the set id?
2
votes
1answer
279 views

Can't override template file in Magento 2.1 module

I'm trying to override Magento's built-in addtocart.phtml file, but nothing I try seems to be working. I Have a module named QuantityDropdown under the Rethink namespace. As far as I can see it's ...
2
votes
1answer
600 views

Forcing a Sorting Direction? dir=asc&order=popularity

I want to disable a sorting direction for sort field. "Relevance" is a good example. Ordering by least-relevant results gives the most horrible results. Basically I want to disable that option. The ...
2
votes
1answer
991 views

Magento 2: Change on widget template not applied to frontend

I'm currently working with Magento2 (I'm an absolut beginner with this) and I need to adjust the template of a widget to my requirements. So I found the appropiate .phtml file used by that widget and ...
2
votes
1answer
2k views

Magento 2 - Quantity Field on Related Products Listing

I'm trying to add a quantity field to the related products section on my product page. I'm overriding module-catalog/view/frontend/templates/product/list/items.phtml in my theme. So far, here is my '...
2
votes
1answer
3k views

Load catalog/product/list.phtml for Custom Module collection

I am writing a new module to get a filtered Collection. Currently I am using my own template file to show the results but I want to use directly my templates catalog/product/list.phtml file to keep ...
1
vote
1answer
2k views

Magento 2: How to override Product View Attributes block?

How to override Product View Attributes block: vendor/magento/module-catalog/Block/Product/View/Attributes.php in Magento 2? Jsp/Attributes/etc/module.xml <?xml version="1.0"?> <config ...
1
vote
1answer
1k views

How to get the current post being viewed from the aw_blog extension

I have the following code in template/page/html/head.phtml, and for social network sharing I need access to the blogpost content so I can extract the images from the blogposts. $post = Mage::...
1
vote
1answer
337 views

How to create a different template for catalog_category_layered

This might be a bit too specific, but I couldn't, for the life of me find where how to do this but it might be pretty simple for a non-magento newbie. I am using Layered Navigation and Framefish and ...
1
vote
3answers
1k views

How to modify <script type=“text/x-magento-templ”>?

I'm looking for a way to modify the default dehavior of a select template. I just want to add a button and keeping what's already done by magento team. So, I copied the template select.phtml in my ...
1
vote
1answer
66 views

XML has extra content

for a plugin we generate an XML output which works on several systems without a problem. One system though adds extra content. In the related controller we do have the following lines: $this->...
1
vote
1answer
2k views

Different Template for Configurable Products

Totally stuck here. I'm working with a very customized template and the configurable products are just showing up in the bottom of the product page. I would like to change this and other things (...
1
vote
1answer
2k views

Magento 2.2.1: How to override recently viewed template

I want to override recently viewed template that is currently located in vendor/magento/module-catalog/view/base/web/template/product/list/listing.html catalog_product_view.xml ...
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
1answer
690 views

Hide address fileds in registration page

I have created a cms page for registration page, which is working fine. My layout Update XML is below <reference name="content"> <block type="customer/form_register" name="...
1
vote
1answer
669 views

How to create different page layouts for a theme

Consider I have a custom theme called MyTheme1 in default design package. I want to create different page layouts ( like 1column, 2column, 3column ) for this specific theme. So if theme selected by ...
1
vote
1answer
467 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....
1
vote
1answer
2k views

Magento 2 - How to add custom block/template to transactional mail?

In order confirmation email I want to add custom block/template (phtml file). How can I achieve it?
1
vote
2answers
213 views

My Magento page shows content above the header

I have added a new template file between cart page and checkout.The issue I am facing is that the content of the file is shown above the header please help me to solve this issue public function ...
1
vote
1answer
777 views

magento2 toolbar.phtml issue-not overriding

Guys I'm stuck in the below issue for overriding core template file. I'm trying to override default Magento search engine. I want to override core filter.phtml and toolbar.phtml I get the products ...
0
votes
2answers
62 views

How to override Adminhtml template files in Magento 2.3?

How to override Adminhtml template files in Magento 2.3? In a proper way. File to override: vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml
0
votes
1answer
137 views

Magento2: How to change layout product detail

I want to change size and layout product detail: from: similar to: details.phtml <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @...
0
votes
1answer
542 views

Setting a template for all actions of a controller using local.xml

I have created a custom module create/routing, with a controller RoutingController.php which has several actions index, upload, instagram and I would like to update the template for all of these ...
0
votes
2answers
1k 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
491 views

How to create a Product Template

I'm trying to create a Configurable Product The doc says to first create a Product Template: http://docs.magento.com/m2/ce/user_guide/catalog/product-templates.html?Highlight=product%20template ...
0
votes
1answer
3k views

What is the problem with my filtering

In my category/view.phtml, I have tried this code for some test purpose. However I am facing some problems with my filtering. Filtering code look like this. //gets current category $current_category =...
0
votes
2answers
4k views

Layout problems with extension when new theme installed

I've made an extension that requires some dynamically set .js and .css files. Using the default theme I added them in through a template set in a block in the head like this: in ...\app\design\...
0
votes
3answers
2k views

Open header cart when product added to cart

I'd like to know how I can automatically open the header mini cart when a product is added to the shopping cart. At present if you add a product to the cart the default Magento message appears which ...
0
votes
1answer
212 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="...
0
votes
2answers
103 views

How do I add a new template in magento?

What I am trying to do is to create a new template in my theme. I created a file in frontend/mytheme/default/template/page/2columns-left-cms.phtml. This is the content of it : <!DOCTYPE html> &...
0
votes
2answers
4k views

Magento 1.8 - Display block in email template

I try to display a custom block in email template and pass the order object. I tried {{block type='module/blockname' area='frontend' order=$order template='template/module.phtml'}} Block is like:...
0
votes
3answers
2k views

Magento 2 : Override custom option text template

I tried to change the template of the text custom option in frontend. I copied the original /vendor/magento/module-catalog/view/frontend/templates/product/view/options/type/text.phtml to Vendor/...
0
votes
1answer
444 views

How can I change my account link?

I'm on developing a new theme. I replaced the cart and the Wishlist Links with icons. Now I wanted to do the same with My Account. But I'm not able to find the template file. I found this Question: ...
0
votes
1answer
5k views

Magento 2: New Checkout step – Shipping Method prices not showing

I would like to add a new Checkout step to the Checkout page but would like to place it between the customer's shipping details (name, address, email) and the shipping methods radio buttons. To do ...
-2
votes
1answer
469 views

How to add a CSS class to selected option?

Hi i used custom "sort by" option in <a> tag Now i want to add a CSS class name based on selection <div class="sort-by_custom"> <?php foreach($this->getAvailableOrders() as $...