Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [phtml]

Denotes questions related to template `.phtml` files

0
votes
0answers
9 views

How to override minicart html with custom phtml?

I override content.html using /app/design/frontend/Altius2/Jasani/Magento_Checkout/web/template/minicart/content.html When I change stuff in this it changes but I can't use PHP because it's an HTML ...
0
votes
0answers
6 views
0
votes
0answers
17 views

How to get custome token in PHTML magento 2

I need to add products in the cart using rest api in javascript. Code is below: var data = JSON.stringify({ "cartItem": { "sku": "240-LV08", "qty": 1, "quote_id": "4" } }); var xhr =...
0
votes
0answers
18 views

phtml template doesn't work properly

I having an phtml template that had dynamic content that's retrieved from cookie and displayed it when button clicked. Template appears in all pages, but the result after clicking button appears in ...
1
vote
1answer
26 views

Magento 2 in default newsletter subscribe not working?

I will attached the phtml and php block code but client side mail does not send? subscribe.phtml <div class="block newsletter"> <div class="title"><strong>Newsletter</...
2
votes
1answer
50 views

How to pass variable from phtml and how to get variable in require js file

How to pass parameter form .phtml to require js file Template file <script type="text/javascript"> require(['Namespace_Module/js/custom'], function () { }); </script> JS ...
2
votes
2answers
222 views

What is the meaning of triple curly braces {{{ }}} in phtml template files? When and how do we use them?

There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it. When is this notation used, What does it represent?
1
vote
2answers
29 views

Magento 2 : How to change the currency symbol wise price in list.phtml page?

I will trying but its not working ? <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of Object Manager $currencyModel = $objectManager->create('...
0
votes
1answer
14 views

How to remove the inner HTML of my H1 Page title tag?

For SEO purpose, I would like to remove the span tag of my pages Catalog and Product View. You can see the default render below: How could I do that?
2
votes
2answers
30 views

Magento 2 : How to override a custom module which install via composer?

I have installed one custom module using composer as usually that module was installed in vendor directory is there any way to override phtml file in the same module like name but on app/code module ...
1
vote
0answers
30 views

Magento 2 - display custom product details tab conditionally & as an URL

I want to create a custom product detail tab "Q&A" and only display the tab when there is an Q&A questions exist for the product, and the tab will be the hyperlink to the FAQ page ( for ...
2
votes
2answers
43 views

Extend tier_price.phtml in child theme of a custom theme Magento 2

From: /vendor/magento/module-configurable-product/view/base/templates/product/price/tier_price.phtml To: /app/design/frontend/Mgs/claue_child/Magento_Catalog/templates/product/tier_price....
1
vote
2answers
26 views

How can I manage admin form via template in Magento2?

I have a phtml file having an HTML form, I want to use it as an admin form. To manage admin form magento2 either uses "UI Component" or "_prepareForm()" block method. I've created a module using ...
1
vote
1answer
24 views

Help with adding script codes between <head></head> in success.phtml

Hope someone can help me with this. It's very easy to do I bet, I'm just not used to magento yet. I'm adding Google Ads to my magento (1.9).. I need to add this script code: <!-- Event snippet ...
0
votes
1answer
37 views

How to create phtml file to edit home page?

I have phtml file at app/code/Vendor/Module/view/frontend/template/content.phtml How can I make it to change homepage? I have module.xml file and registration.php file as well. Module is ...
1
vote
1answer
25 views

Which block file calls for My Account page when it loads

I have written some helper functions, which does some database inserts The problem is I am calling all these functions from my phtml which gets loaded first time when My account is loaded for the ...
1
vote
1answer
71 views

remove amazon pay icon from shipping step

How do I remove the "amazon pay" icon from the shipping step? If i set "Configuration"->"Payment Method"=>"Amazon Pay"=>"Advanced"->"Display Amazon Pay Method" to "No", then it'll be removed, but it ...
0
votes
0answers
30 views

Multi website languages switcher, how to show flags?

How to show flags in this code? <?php $stores = Mage::getModel('core/store')->getCollection()->addFieldToFilter('is_active', 1)->addFieldToFilter('store_id', array('neq'=>0));?> <...
1
vote
1answer
25 views

Magento2 can't call custom phtml fail in CMS Static Block

I have tried many ways to call the custom phtml file in Static Block but none of them seems to work. My file is located - app/design/frontend/Magento/MyTheme/Magento_Theme/extra/test_view.phtml How ...
1
vote
1answer
59 views

Magento 2 Templates: How `$block` is assign in template?

Can you please tell me where the assignment of the $block variable to the template occurs? \Magento\Framework\View\TemplateEngine\Php::render() I found : $tmpBlock = $this->_currentBlock; $...
0
votes
3answers
42 views

How to call phtml file in admin block magento 2?

I have created custom theme and I want to call copyright.phtml file in a block I have created on admin side. I added this {{block class="Magento\Framework\View\Element\Template"template="...
0
votes
3answers
43 views

how to pass a variable from one phtml to another?

I have two phtml which have its own unique block file. I need to pass variable from one phtml to another. PHTML 1 <?php $option_id = 20; ?> <a href="<?php echo $baseUrl ?>/...
1
vote
2answers
48 views

Magento2 : How to get the attributes values for products list page?

I will trying to get the attributes values but i can't do this values ?
0
votes
0answers
8 views

DropDownListFor in magento2

I am trying to convert one of my cshtml files to phtml. In cshtml we can use html helper library DropDownListFor to create a dropdown and assign a model to get the values from,how do we do the same in ...
0
votes
1answer
113 views

Magento 2.3.0 Get Country Name

I'm trying to insert the current store country name through a CMS Page/Block by following this article. I've created a Block file countryname.php in app/code/Vendor/Countryname/Block with the ...
0
votes
0answers
18 views

Magento 2 How to add the text attributes values to be included in navigation?

I am trying but it's not working How to add the text attributes without drop-down and text swatches and visual swatches and multi select. only add the text. please help me ???.
0
votes
1answer
23 views

how to change the sku id in search un url not do be come?

how to change the url key in sku id not be come? how to remove product name to add the sku id? pls help me?
0
votes
1answer
56 views

Magento 2 in how to remove the duplicate attributes?

I will Try to remove that but its not Working? How to solve this ?
0
votes
1answer
39 views

How to get Review for products collection magento 2?

Actually i want to get Review Rating and summary count.Please check below code <?php error_reporting(0); use \Magento\Framework\App\Bootstrap; include('../app/bootstrap.php'); $bootstrap = ...
1
vote
1answer
60 views

How to use session data in view (phtml) magento 2

i can access session data in my controller using \Magento\Framework\Session\SessionManagerInterface public function __construct( Context $context, PageFactory $resultPageFactory, ...
0
votes
2answers
26 views

How to call static block by xml to phtml without refrence

I want to call a static navigation block in topmenu.phtml I defined that in default.xml <block class="Magento\Cms\Block\Block" name="top_links"> <arguments> &...
1
vote
1answer
59 views

Magento 2 in how to add all products website id in main website?

i will try to database table values in website id in main website but not working.? how to bulk change the all products website id change?
1
vote
1answer
22 views

not able to render phtml file magento 1.7

this is my config file <?xml version="1.0"?> <config> <modules> <Ilogix_Regionbased> <version>0.1.0</version> </...
0
votes
3answers
34 views

Magento 1.9 header ISSUE

Have some strange header.phtml error. Problem is non my index page everything is ok, and on any other page have some weird problem my header and menu change places. code for my current header.phtml ...
0
votes
0answers
29 views

magento 2 in update password to hash in save to database not working?

I will try to change password but its not working! <form method="POST"> <label>Old Password : <input name="old_password" id="old_password" type="password" /> </label> <...
1
vote
1answer
26 views

How to write that layout XML in a template file?

This is my layout XML: <block type="amazonpayments/pay_button" name="product.info.addtocart.amazonpayments" template="creativestyle/amazonpayments/pay/product/button.phtml" before="-"> ...
0
votes
0answers
15 views

Magento 2 in how to change the password in direct in database link to connect using Seller without hash method?

i have try to change direct connect in database but its not working? <input type="password" placeholder="New Password" id="password" required> <input type="password"...
0
votes
1answer
28 views

magento 2 : How to render background images in phtml pages

How do you render a background image from a phtml page. I have tried this: <div class="home-slider--bg-slide" style="background-image: url('@{baseDir}images/home-slider/slide-1.jpg');"></...
0
votes
0answers
30 views

Magento 2 in How to change password in programmatically without hash method in password? [duplicate]

I am trying below code but it is not working $customer = $this->_CustomerRepositoryInterface->getById($id); $customerSecure = $this->_customerRegistry->retrieveSecureData($customer->...
0
votes
0answers
23 views

Error: Using Duplicate Id (.phtml file)

i declare a div in a .phtml file for a slider <div id="page-header-sliders" class="page-header-sliders template-1 full-width"> and this phtml file is create 5 slider in a same cms page, so id ...
0
votes
0answers
32 views

Parsing html code with html error problem

I am getting this kind of exceptions in my exception.log . i have no idea where it comes from. main.CRITICAL: DOMDocument::loadHTML(): Unexpected end tag : br in Entity, line: 1 {"exception":"[...
0
votes
2answers
147 views

Unable to get CMS page identifier

I am trying to get CMS page identifier with Mage::getSingleton('cms/page')->getIdentifier(); in a footer.phtml but for some reason I am getting no-route on all the pages. It used to work before ...
0
votes
1answer
24 views

cant run code on cms page within <a> tag

I wanted to link from a cms block within a product page to its corresponding amazon product which can be identified via an custom attribute called "asin". So I have put the link like <a href="...
0
votes
1answer
19 views

Magento 2 - language override phtml

Is there a way to override a .phtml file on language level? I have 4 stores (language dependency) and i want to make some changes in the code for these different countries. I this possible through, ...
0
votes
1answer
152 views

How to show embedded google map in magento 2 in phtml file

I am trying to add google map in the frontend. I added embedded google map in phtml. here is my code <?php $contacts_config = $this->getConfig('porto_settings/contacts'); $_enable = $...
0
votes
1answer
91 views

Magento 2 Tooltip not working in phtml file

<?php $_content = '<img src=\"' . $block->escapeUrl($block->getViewFileUrl('Magento_Checkout::cvv.png')) . '\" alt=\"' . $block->escapeQuote(__('Card Verification Number Visual ...
0
votes
3answers
138 views

how to call phtml file in static block?

I have created phtml file, app/design/frontend/Smartwave/porto/Magento_Contact/templates/inquiry.phtml <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license ...
0
votes
0answers
16 views

magento2 not loading custom css file that is in head.phtml on category page

My Magento2.2.5 has a custom css file that I have listed in the bottom of the head.phtml in my child theme. I list it there instead of in the default_head xml file because i need the css file to load ...
0
votes
1answer
107 views

Magento 2.2: How can I override “checkout.item.price.unit” and “checkout.item.price.row” in the cart?

My goal is to switch out the .phtml files: magento_module-wee::item/price/unit.phtml as well as magento_module-wee::item/price/row.phtml with my own custom ones and change how the prices are displayed ...
0
votes
3answers
156 views

Is it possible to include a phtml file from another module in my template in Magento 2?

I'm making a Megamenu Module, where I want to include the phtml of a file in my MailChimp module (Signup Form). Is there a way I can call on this template from within another module?