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

1
vote
1answer
19 views

jQuery DataTables.js How to Apply It On Admin Grid

I'm very new to Magneto, I'm trying to add jQuery DataTables in Magento 2.3, in below image i get error in console: Here is my Code: Add file in /EC/Downloads/view/adminhtml/requirejs-config.js. ...
3
votes
1answer
39 views

Move block inside another block

I want to put the header.links into another block. this is the icon.phtml file: <div data-block="dropdown" class="minicart-wrapper"> <i class='fas fa-user-circle action' data-trigger='...
1
vote
1answer
15 views

Pass current sku number to the custom phtml form before submission ( data-bind, placeholder)

i'm trying to past the value of $current_sku to the end the $title text field input on the form. How can I achieve it? Correctly, it's showing in the text input hints.. <?php $objectManager = ...
4
votes
1answer
22 views

Magento 2 - Call different module block function in my custom phtml

I have custom module in which there is custom block and it's associated phtml which call my custom block functions using $block object. I want to call other module block function in my custom module ...
2
votes
0answers
24 views

Magento 2 - Call phtml in helper

I have found multiple threads related to calling helper function in .phtml. But I have a case where I need to call phtml file in helper and return HTML. I have used this code: //Where $this->...
2
votes
2answers
44 views

Magento 2 pass data from template html to phtml file

So far I have created file MyModule/ProductAlert/view/frontend/email/stock.html - <!--@subject {{trans "Products back in stock alert"}} @--> <!--@vars { "var alertGrid|raw":"Alert Data Grid"...
0
votes
0answers
11 views

Get delivery time for UPS on Magento 2 shipping methods

we have our custom UPS prices configured through the UPS api on our Magento 2 website. It is working well, but we would like to add the delivery time (in days?) for our clients. What are the files ...
0
votes
1answer
29 views

Need to change the `signin` name in header links in Magento 2

I am building a custom theme and I need to change the signin link name which is not contained in the layout file nor in the phtml file but only in the block class file. So should I build a module in ...
1
vote
1answer
25 views

Find the block class instantiated into a phtml file

I need to modify a block class called in a phtml file, this is the customer.phtml file: <?php // @codingStandardsIgnoreFile ?> <?php if($block->customerLoggedIn()): ?> <li ...
2
votes
0answers
19 views

How to pass variable value from phtml JS to block.php?

I have a phtml (system.phtml) with <script> in it and a variable like console.log(data). <?php $checkcustomer = $block->Customerlogin(); ?> <script src="https://d3js.org/d3.v3.min....
0
votes
1answer
16 views

Passing PHP Variables with requireJS in phtml

On my text.phtml template I'm trying to add js by requirejs but can't get the php variables to pass through with them coming up as undefined. Relevant text.phtml $_option = $block->getOption(); $...
2
votes
1answer
52 views

Magento 2 - Add meta detail on frontend page using Block

I have custom block in my custom module, which call my frontend custom phtml file. let's say file path: app\code\Vendor\Module\Block\Index\Index.php I need to figure out the way to set meta title, ...
1
vote
1answer
16 views

Magento 2.3: How to Echo From Controller On Button Click?

I'm very new to Magento, I have a custom module and some tabs and fields in it, i have an 'import' tab, in that their is 'Import' button, just want to know the workflow of that button, like on button ...
2
votes
2answers
32 views

Changing in PHTML in Vendor Folder does not affect frontend

I changed the subscribe.phtml in vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml. I just changed: <span><?= $block->escapeHtml(__('Subscribe')) ?></...
1
vote
1answer
26 views

Get block in phtml file not working - Please help me? [closed]

Get block in phtml file not working - Please help me ! When clicking on the button, it shows popup fancybox but does not show content in it. My phtml <div id="contact-popup"> <?php echo $...
1
vote
0answers
20 views

Module written in 2.1.3 does not work in Magento 2.3.1

I just upgraded my site from Magento 2.1 to 2.3 and while most of my site still works, I have a particular code which has partially failed to work. The code is supposed to get the "details" attribute ...
0
votes
0answers
13 views

Theme template files not applied after upgrading to Magento 2.3.1

I have updated my website to older Magento to Magento 2.3.1 and found on some of the place some sections are missing. Like Review and Rating, Additional info tab section on product page is missing not ...
1
vote
2answers
28 views

Magento 2 : Call Function From app/code to app/design

Is there any way to call function defined in the app/code/Custom/Module/helpers/HelperClass.php inside the app/design/frontend/Custom/Theme/Magento_Theme/template/html/View.phtml in Magento 2? I'm ...
0
votes
2answers
54 views

call phtml file in custom email template in magento2

I need to pass the phtml file into email template. but I'm getting error like Error Log : Error filtering template: Invalid template file: 'Vendor_Module::emailproducts.phtml' in module: '' ...
0
votes
1answer
22 views

how i can get the row values by clicking button in that table using jquery magento 2

<td data-th="<?php /* @escapeNotVerified */echo __("Quote Id")?>" class="col quoteid"> <span class="label"><?php /* @escapeNotVerified */...
1
vote
0answers
40 views

how to call phtml file in email template in magento2

I need to pass the phtml file into email template. but I'm getting error like Error filtering template: Invalid template file: 'Vendor_Module::emailproducts.phtml' in module: '' block's name: '...
1
vote
2answers
54 views

Magento 2 - Override Swatches renderer.phtml

I would like to override file : app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml In my own theme : app/design/frontend/[VendorName]/[theme]/Magento_Swatches/...
1
vote
2answers
39 views

How to override the adminhtml template in magento 2 for a specific website in mutiwebsite functionality?

I have created two website and need to override the adminhtml order view phtml only for the second website. Please suggest how can i achieve this. Please help. Thanks in advance. <?php namespace ...
1
vote
1answer
25 views

Magento 2 - How to get minimal price of associated simple price of Grouped Product in phtml

I made the custom phtml and I have custom product collection. I just need to show the minimal price of associated simple product of grouped product. Any help would be appreciated.
4
votes
2answers
171 views

Magento 2 Editing phtml files in Production Mode

I have a Magento 2 store in "production mode" My question is, If I want to change a phtml file, do I need to change to developer mode or is it enough to execute setup:static-content:deploy -f?
0
votes
0answers
12 views

How to get the attributes set using the all attributes in phtml page? in magento 2

How to get the attributes set using all attributes in phtml page? In need, the products view page in all attributes in particular attributes set related attributes?
0
votes
1answer
35 views

how to validate custom fields using variables in magento 2

here have two fields 1)Fields_1 2)Fileds_2 here i want to validate Field_2 < Filed_1 (less than ) how i do this in magenot 2??? Field_2 Tag <div class="field"> ...
0
votes
0answers
34 views

How to Add PHTML template file with custom checkout step Magento 2?

I have seen that new step can be added with Knockout JS HTML file.Is there any way to attached PHTML Template file instead of HTML or JS? <item name="email-step" xsi:type="array"> ...
2
votes
1answer
37 views

How to create a default Magento 2 block (catalog/product_list) from a phtml file?

I'm trying to render a default block from a phtml file, without luck. After a lot of research, I learnt that I can use this code inside a page to render the block I want: {{block type=”catalog/...
0
votes
0answers
25 views

magento 2 : How to set custom template in block?

Good Morning Every Body, I tried to upload a custom template with module, but I think If first create a default.xml and add this template in <referenceContainer> block and put in attribute class ...
2
votes
1answer
24 views

Magento 2: How to set from admin to see all the routes of my web content?

I have seen people setting something in the Admin, to see all the files routes of all the content in the store, I just want to know how to do that set. If someone can help, I would appreciate it.
1
vote
1answer
59 views

pass array from php file to phtml?

i use observer on order place . sales_model_service_quote_submit_before when order is place i get order items and each item has a seller id . i get email from seller ids. and now send mail to those ...
0
votes
1answer
26 views

how to use geturl function to custom page in php value in magento 2

<a href="<?php /* @escapeNotVerified */ echo $block->getUrl( 'mpquotesystem/sellerquote/quoteedit/id/404/', ['...
0
votes
1answer
36 views

How to get product configrable id in cart in magento 2 using jquery

i have a custom module for shipping methods in magento 2 i need to get config product id in the cart list using jquery Date-block.html <script type="text/javascript"> require( ['...
1
vote
1answer
72 views

How do i get category ID in final_price.phtml and hide price accordingly in magento 2

this is my current final_price.phtml file. the line $category = $product->getCategoryIds(); is causing error I'm trying to get the category_id of the current product, and check if it's in $...
0
votes
0answers
61 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
7 views
0
votes
0answers
20 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
20 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
54 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
63 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
245 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
52 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
29 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
47 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
34 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
63 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
112 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
45 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
70 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 ...