Questions tagged [template]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
23k views

Get category image to a page template

I have created a new page template here: /template/page/category.phtml and copied inside the content of 1column.phtml. What I want to accomplish is to get the category data variable in this new ...
4
votes
1answer
5k views

Custom price.phtml file for product view template

How do I create a custom price.phtml file and display it on the product view page? Use case: I have updated the price.phtml file under product > view to add rich snippets / structured data. And, I ...
4
votes
2answers
15k views

How to Customize Magento 2 header layout with luma theme

I use Magento 2 with luma theme and trying to change the header layout but I don't know the best way to do that. ie. I want the logo in div with some styles and the navigation in another div and so ...
3
votes
4answers
3k views

Magento 2 - How to auto open cart items on checkout page?

I'm using a mostly stock Magento 2 checkout_index_index layout (checkout page), I was wondering if anyone knew how to default the order summary collapsible to be open on page load. It isn't clear ...
3
votes
3answers
19k views

How to get category name and url on product template?

I'm trying to get breadcrumbs working on product page. I need to display current category and url template file: catalog/product/view.phtml I have tried the following: $categories = $_product->...
2
votes
1answer
2k views

How do I enable Template Path and Block Name hints

I am trying to find where in Magento's massively complex system, the templates are located and what blocks need to be modified. I can use Chrome or Firefox web developer tools to see the code and ...
2
votes
1answer
6k views

Creating custom header extending Magento blank in Magento 2

I am trying to create a theme with Magento Blank as parent in Magento 2 but I can't figure it out how to change the header with a custom one. I first remove header.container from magento blank and ...
1
vote
2answers
3k views

The use of “function setData ()” in the blocks on CMS pages

I can not understand why variable transmission does not work, when the block is called, the display categories on the home page. in the template file I pass a variable to a different template file ...
1
vote
1answer
167 views

How to decrease brand product list page load time in magento?

I am collecting brand specific products based on the brandId in brandproductlist.php as follows., $collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*')...
1
vote
1answer
2k views

Overriding template not working in Magento 2

I have following code etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/...
0
votes
1answer
39 views

How to restore the default checkout template?

I never use Magento but, a friend uses it and a dev. broke their checkout page, how I can restore the TEMPLATE of the checkout to default? I don't see a backup of any of the files, and I no have clue ...
0
votes
1answer
152 views

Magento 2.0: How to override the name.phtml

How Can I override below name.phtml file from customer module vendor/magento/module-Customer/view/frontent/templates/Widget/name.phtml
0
votes
1answer
787 views

changing default values

In an effort to learn how to work with Magento I have set myself a number of (what i believe will be) basic tasks. The aim being to give me an idea of how to access information of the customer, ...
0
votes
1answer
5k views

Related Products template customize

How do you change the related products template output. Instead select all I would like to add a "add to cart" button to all related products and remove checkboxes.
66
votes
2answers
11k views

Magento 2 @escapeNotVerified

I see a lot of occurences of this comment /* @escapeNotVerified */ in the template files for Magento2. Does it have a special meaning? Is there any use for this? Examples: https://github.com/...
11
votes
1answer
12k views

What is the difference between getChildHtml and getBlockHtml

Synopsis What is the difference between getChildHtml and getBlockHtml? How can I get the cms/block title in the template? I have essentially replaced the footer with my own footer and set my own <...
5
votes
3answers
4k views

How can I debug “empty template”: Filename cannot be empty in Template.php

we are suddenly seeing an empty template issue in our logs. And I am finding it difficult to debug which module/function is causing this. Question: with what debug statement could I capture the ...
2
votes
1answer
16k views

CMS Block Widgets for Individual Products

I'm working on a CMS Block to show featured products on the home page. I set up my own template file which loads $this->getProduct() for the data. The problem I'm having is that I'm using the ...
14
votes
1answer
9k views

Customization of total order and additional infos

When want to have the following style of totals on checkout/cart: Discount Subtotal Shipping fee OR Info Text: "excl. shipping" Additional text: "free shipping from 30EUR" (display always) ...
13
votes
6answers
14k views

How to remove Company field from checkout process in Magento 2?

How to remove Company field from checkout process in Magento 2? I've been looking for the template but have not found it. Update: Is there any way to remove this field via layout or template?
6
votes
1answer
5k views

Magento 2 add custom data to checkout

I am trying to add some additonal data under checkout items summary (right sidebar). I am not figuring out how to get dynamic data from maybe Block (or other way). Here it is what I have already ...
6
votes
1answer
5k views

complete flow of a magento

I want to know the complete flow of a magento view. Suppose i am viewing the home page, can I ask how the flow of control goes through the PHTML, XML and PHP files , in order to view the home page? ...
3
votes
2answers
5k views

How Can I Include Customized phtml file in email template

I am trying to send coupon code with email on new account registration. For that I created email template system > transactional emails. Here in this email template I have included coupon.phtml ...
3
votes
1answer
6k views

Multi-Store issues with loading some template files/skins

We're having an issue here, where some stores load the store view with Magento defaults (only one of them does this out of 7 of them). SetEnvIf for MAGE_RUN_CODE is set in .htaccess based on request ...
2
votes
1answer
953 views

Magento 2: Move text “This is a required field” below swatch options

When a user don't select a size option and clicks the "Add to cart" button, the warning "This is a required field" appears under the button. I'd like that warning appear just below the swatches, not ...
2
votes
1answer
474 views

Call CMS Block with Category name as Identifier

The goal is to call a static cms block at the bottom of the category page, with block identifier == category name (so that I can make a block in the admin backend for every category). So I first ...
1
vote
2answers
2k views

layout - call left column block within main column (in the 1column.phtml template)

I have a category list page which uses the 1column.phtml template. However, when the user navigates to a category where there are no subcategories - and only its products are displayed - I would like ...
6
votes
2answers
2k views

Magento 2.2.1 - how to give discount on payment methods?

I go to Magento 2.2.1 Admin > Marketing > Promotions > Cart Price Rules and create a new Rule: Conditions. Option "Payment Method" is not showing up in Conditions Tab. I want to give some ...
5
votes
4answers
25k views

Include phtml in magento CMS

I'm trying to make different page where i need PHP. thats why i use a phtml file. I don't want to make any changes to the other Magento layouts so I just want to include the phtml file via the CMS. I'...
4
votes
2answers
9k views

How to override product list page [duplicate]

I'm trying to override the list product page. My objective is add certain information on each product above the add to cart button for example. I already did with the single page product, just ...
4
votes
1answer
3k views

templates call other blocks method - Magento 2

We can define templates and block in layout file, after that we can call block methods in that template file. My question is Is there any way to call other block methods in phtml file(template file)...
4
votes
4answers
4k views

How to remove “Help us keep magento healthy” in Magento 2.1

Can anybody tell me where they moved this? Changed the footer.phtml in /html/vendor/magento/module-theme/view/frontend/templates/html But it is still being shown, so it must be somewhere else.
3
votes
1answer
6k views

Magento 2 How to get category tree (collection) on footer

I need to display magento 2 category tree on footer and on some other places. I think best practice is creating a module and call it on desired block (place). How to do that ? I already created a ...
3
votes
2answers
773 views

How to make a parent category show every 3 rows of subcategory which sorted by price asc

i have to make a parent category show every 3 rows of subcategory which sorted by price asc, for example cat1 cat-A cat-B cat-C if i click cat1 , the page will show cat-A-product1 ...
3
votes
6answers
16k views

Category Image / getImageUrl() is empty

In back end I can see the category has an image but if I try to show it in a template it is empty: $_category = Mage::registry('current_category'); $_imgUrl = $_category->getImageUrl(); Why ...
3
votes
3answers
6k views

Magento page.xml main content block have no template file

My page.xml file is located at "/app/design/frontend/default/templatefolder/layout/page.xml" and I am able to see all the blocks pointing to particular template(".phtml"). There is a block showing a ...
2
votes
3answers
3k views

Where is defined the Place Order button in default checkout payment step section?

I wanted to know where the button from the image is defined (The place order button in the payment step of checkout) And also where is the discount code section defined?
2
votes
2answers
2k views

How to override adminhtml phtml in Magento2?

How to override vendor/magento/module-shipping/view/adminhtml/templates/view/form.phtml file in magento2
2
votes
3answers
2k views

Change text $this->__('Choose an option…') in template

There are a number of changes that I would like to make to the theme but I give just one here as an example. Where the dropdown says 'Choose an Option', I like to be polite and ask users to 'Please ...
2
votes
1answer
9k views

How to move category title above products column in Magento 2

In Blank theme the category name is located to the left just above the layered navigation sidebar. I'd like to move the category name to the right, above the products column, so the side bar goes up.
2
votes
2answers
4k views

How to display simple product descriptions on a grouped product page?

When working with a grouped product on Magento (such as a furniture set), very little info is displayed by default about its simple products. The demo site example doesn't appear to allow the user to ...
1
vote
2answers
2k views

Remove label and value Tax from cart magento 2.1

i have a problem! Necessity to delete label and value tax in to cart and checkout. I not found the .phtml file to remove this.
1
vote
3answers
9k 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
124 views

Override template and block from a module?

I am developing a newsletter extension. I try to override the template /vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml and the block Magento\Customer\Block\...
1
vote
2answers
905 views

Override template for module: /vendor/magento/offline-payments/

I want to override a template located here: (magento_dir)/vendor/magento/module-offline-payments/view/frontend/web/template/payment/purchaseorder-form.html I have done the override path liks this, ...
1
vote
1answer
343 views

Catalogsearch encodes query string for sort/limit in toolbar

If my search contains special chars like ü, ä they are encoded to %C3%BC for example. The strange thing is, it does work correctly in one template, but not in another one. Template 1: simple links .....
0
votes
1answer
194 views

Cat banner call results in fatal error

I have the following code in a custom block that is referenced in my three column layout. To get the category banner to show at the very top of each category page. <?php $_helper = $this->...
16
votes
5answers
27k views

Magento2: Get Media URL In Template File (Without direct Calling Object Manager )

How to Get Media URL in Template file ? All the solution i found is calling Object Manager directly. My another concern, Can you ever call object manager directly as best practice ? (because in most ...
15
votes
5answers
12k views

Magento 2: How to set custom template for core block

I'm trying to override the register.phtml in my module, but it seems there are some config problem that make Magento unable to use my custom template to override the one in core module. I've checked ...
7
votes
2answers
996 views

Applied PATCH_SUPEE-6285 - Do I need to do anything else?

After being prompted to install the new patch I went ahead and did so straight away. But now I've gone back and looked at the .sh file I noticed there is changes being made to template files. I had ...