Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Adding Minicart to custom header results in a empty cart in magento 2

I tried adding the mini cart phtml to my header like this <?php echo $this->getLayout()->createBlock('Magento\Checkout\Block\Cart\Sidebar')->setTemplate('Magento_Checkout::cart/minicart....
0
votes
0answers
18 views

block executing before modal click

I have a modal with 2 buttons that have a click function. Inside of each of these click functions is a block that's supposed to only be executed when clicked. However, the block seems to be executed ...
0
votes
1answer
16 views

How to place custom template (phtml) file in local module direcotry instead of default template directory

I am creating a new module for my Magento project where I have a few template files which get appended to >catalog_product_view catalog_category_default checkout_cart_index and few other pages. ...
0
votes
0answers
10 views

Magento 2.3.1 in multi shipping overview Post controller page not working go to Success page

Magento2.3.1 in multi shipping overview Post controller page not working go to Success page Page Redirect is not working how to solve this issues ? Payment id is not showing on this page ???? vendor/...
2
votes
0answers
20 views

I want to rewrite phtml file in module-grouped-product

I am trying to rewrite the phtml file but it's not working my code is : a main file path is public_html/vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml ...
0
votes
0answers
19 views

Magento2 Category Trees show on frontend in dropdown

<?php namespace Module_dir\Block\Customer; use Psr\Log\LoggerInterface; class Addproduct extends \Magento\Framework\View\Element\Template { protected $adminCategoryTree; protected $logger; ...
1
vote
1answer
51 views

How to add back to top button in Magento 2?

I want to add back to top button on our site. I referred the below link http://magentosource.blogspot.com/2013/10/add-back-to-top-button-in-magento.html But we have no footer.phtml. Could anyone ...
3
votes
1answer
43 views

How can I make my controller return JSON back to my template PHTML

Controller: <?php namespace MyCompany\ExampleAdminNewPage\Controller\Adminhtml\Product; use Magento\Framework\App\Action\Context; use Magento\Framework\Controller\ResultFactory; class Product ...
0
votes
1answer
15 views

magento 2 system configuration with a custom .phtml template?

in system.xml: <field id="custom_field" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Custom Field</label> <...
0
votes
2answers
53 views

Fatal error: Uncaught Error: Call to a member function getQuote() on null

I'm trying to get store information from Shopping cart page To do so I have created a module Following is my block file <? namespace Magento\History\Block; class ViewQuote extends \...
0
votes
1answer
31 views

Magento2.2.5 remove default product title and add custom phtml file on product detail page

in Magento2.2.5 I want to remove the product name and instead where it is load a custom phtml file that will call in a custom product attribute However my phtml file is not being called in here is ...
2
votes
3answers
38 views

Display data from Quote_item error

I have tried to display the data from Quote_item table in the database to file .phtml but it shows this error the code in Magento/MyHistory/Block/View.php <?php namespace Magento\History\Block;...
1
vote
0answers
26 views

How to display data from 2 tables that already have data on Magento 2.3

How to display data from two tables quote_item and sales_order_item from the database to .phtml file. Can anyone help me step by step, I am new to Magento, if someone can help me, it's very useful ...
1
vote
2answers
31 views

luma-theme .phtml file override in Custom Module

i want to override this file magento_dir/vendor/magento/module-theme/view/frontend/templates/html/collapsible.phtml And do not want to make custom theme like app\design\frontend\Magento_Theme\...
1
vote
4answers
30 views

How to get all category is active in magento 2

i tryed get all category in phtml by this code, but it not working, it get all category, not only category active. Please help me. Thanks all. $objectManager = \Magento\Framework\App\ObjectManager::...
0
votes
2answers
45 views

call contact form on phtml page

I called contact form in my .phmtl page using this code: <?php include ($block->getTemplateFile('Magento_Contact::form.phtml')) ?> The problem is when I click on submit, there's no success ...
0
votes
1answer
31 views

display product price with exclusive of tax in magento 2

I want to get product price (exclusive of tax) in catalog pages in Magento 2 vendor\magento\module-catalog\view\base\templates\product\price\amount\default.phtml I override this file for custom text ...
4
votes
1answer
28 views

Is it good practice to get product collections in helper function and calling in phtml file custom module Magento 2

Hi all, i wanted to know either is it good practice to get product collections in helper function and calling that function in phtml file within custom module Magento 2 Because in my case ...
3
votes
1answer
17 views

Magento2: Phtml file not visible on PDP

I have create a module which consists an extra button on the product description page . For this I have added a layout catalog_product_view.xml which is below. <?xml version="1.0"?> <page ...
1
vote
4answers
37 views

Help with overwriting .phtml file in Magento 2.2.7

I need some advice on how to overwrite category description 'block?' from file /app/design/frontend/Mgs/mgsblank/Magento_Catalog/templates/category/description.phtml I want to use my own module ...
3
votes
0answers
22 views

insert different block in the middle of block content

I have a phtml for a block like this : app/code/Vendor/Modul/view/frontend/templates/main.phtml <div class="business-container"> <nav class="mini-head"> </nav> <div class="...
0
votes
0answers
49 views

Magento 2.3: How To Initialize Js…?

I'm new to Magento 2.3, I was trying to apply jQuery DataTable and it's done, after that, I want to add it's Button Extention, for that i need to add two more js,so i initialize it, now i'm getting ...
1
vote
2answers
88 views

Magento 2: jQuery Datatables Button Extentions Not Working

============================UPDATED 1.1============================ I'm new to Magento 2.3, I'm trying to apply jQuery DataTable(DONE), after than, I want to add it's Button Extension, for that i ...
1
vote
1answer
46 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
59 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
2answers
24 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
40 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
30 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
73 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
14 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
32 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
25 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
19 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
60 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
29 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
35 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
27 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
21 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
15 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 ...
2
votes
2answers
35 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
83 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
24 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
108 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
1answer
166 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
40 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
90 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.
5
votes
2answers
226 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
14 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
38 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"> ...