Stack Exchange Network

Stack Exchange network consists of 174 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

1
vote
0answers
29 views

magento 2 in how to get the attributes values in products list page?

i will trying to get the attributes values but i can't do this values ? Please help me ....?
0
votes
0answers
7 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
47 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
14 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
21 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
29 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
30 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 = ...
0
votes
1answer
37 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
24 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
35 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
16 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
30 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
19 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
25 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
14 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
27 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
18 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
19 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
25 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
137 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
22 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
18 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
84 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
49 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
61 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
12 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
59 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
66 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?
2
votes
1answer
60 views

Add custom phtml file before the category filter in Magento2

I am trying to add custom file in left navigation before the filters. <referenceContainer name="sidebar.additional"> <block class="Magento\Framework\View\Element\Template" name="...
-1
votes
1answer
124 views

Magento 2 Knockout XML->PHTML->JS->HTML

I want to display static block in html login popup during checkout, but there is a problem. This is the html template which is called from js, this js is called from phtml, and this phtml template ...
2
votes
3answers
268 views

Change 'Choose an Option…' text Magento 2

On a configurable product I would like to change the text 'Choose an Option...' to 'Select an Option...' I have attempted to change the i18n translation file within my theme, and cleared cache - ...
1
vote
1answer
80 views

Magento 2 : Pass URL from Static block to PHTML

In my static block, Following is code {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/homepage-blocks.phtml" title="Scoring &amp;...
1
vote
1answer
68 views

Removing link from root category on topmenu

I am trying to make the topmenu root category not clickable using this method https://community.magento.com/t5/Magento-2-x-Programming/Remove-links-to-top-categories-in-menu/td-p/77072 but it ...
1
vote
1answer
21 views

Is it possible to display an XML Block based on an IF?

I use the below code in a module within catalog_product_view.xml to display a new Tab on the Product Page. <body> <referenceBlock name="product.info.details"> <block class="...
2
votes
3answers
50 views

How to display text if Product Type is Equal to?

I'm trying to display some text IF Product Type = General. This edit is being made within a phtml file. How'd I'd normally do it for a Product Attribute called Example <?php $_product = $block-&...
2
votes
4answers
114 views

Changes in phtml not visible in the browser

When I change a .phtml it is not reflected in the browser until after approximately 24 hours. I've tried everything, run php bin/magento cache:flush, check the permissions of magento_user. I'm using ...
1
vote
0answers
28 views

How to get collection from database in phtml not from cache when full cache enabled

I have created an extension which I have uploaded in the marketplace but marketplace rejected due to cacheable="false". <block class="Company\Module\Block\Hello" name="information" template="...
4
votes
4answers
75 views

How change texts in the Login and register pages

I am using Magento 2 and the Mr Bara template, I have managed to change the home and product view, but I can not find where to change the login and registration texts, I want to add an image as well ...
3
votes
3answers
246 views

How to call phtml file from custom theme to cms block

I have created a custom block using Magento 2 UI, I know that I can't have any PHP in the block so I have created a test.phtml file and added it to my custom theme on the server. Now, I want to call ...
2
votes
1answer
102 views

how to add phtml file in custom tab on product view page

I have created a custom tab on product view page , but i don't know how to call a phtml file into custom tab.
0
votes
0answers
84 views

Accordion not working Magento 2 after minify JS

I have minified JS and HTML and CSS in Magento 2. After that Accordion is not working. <?php $collectionTitle = $this->getCollectionFaqcat(); ?> <div class="shy-shadow-container row mrg0"...
3
votes
1answer
233 views

Magento2 not getting post data from ui component phtml file

I have implemented admin form using UI component. In that, I have 3 separate tabs. Among 3, I have displayed one tab using custom phtml file by using following code in ui component form xml file <...
0
votes
1answer
43 views

How to get the Terms and conditions content in phtml?

I need help, please. I created a cms page with id=terms I insert in the content of web page this code: {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::test/test....
0
votes
0answers
39 views

Product addto cart in view page

I have to initialize js for a form in view page, Its working perfect in desktop. But in the mobile theme when I tried to add-to cart for the product, I'm able to get the js for product addtocart . ...
0
votes
1answer
43 views

js file not loading in ajax returned phtml file magento2

I am returning phtml file content on ajax call in Magento2 its working fine, In the phtml file I am loading jquery and mine custom js file booking, using below code. A query function running fine, ...
1
vote
2answers
274 views

return phtml file content in ajax response in magento2

I am calling an controller function via Ajax and its calling and returning correct data. But how can I return Controller function respective phtml file content instead of some data from controller ...
0
votes
1answer
30 views

How can I use partial (code block) in multiple templates?

I have a specific block of code which is a newsletter subscription form with a script. I have to use this code on multiple templates. Currently I am using it on these two templates app\design\...
0
votes
0answers
44 views

Calling getCollection in phtml is empty

In Magento 2.2.5, I am setting the Block for phtml using below code: <?xml version="1.0" encoding="UTF-8"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" ...
1
vote
0answers
52 views

I want to delete database values from the tables as I delete the cart items. how can i do that

i want to delete the items from the table "ms_rental_products" as i click the delete button in cart. how can i do that?? <?php function delRental() //this is my ...
1
vote
1answer
93 views

Magento 2 | Override title.phtml in module

I want to override this file in my custom module: /var/www/magento2-dev/vendor/magento/module-theme/view/adminhtml/templates/title.phtml How can I achieve this? Thanks for any help!