Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Script executar apenas para algum manufacture

I want to make javascript at the end of the file run only if the product is not from the "hello-kitty" manufacturer but for that I need to somehow take the manufacturer of the product to store in a ...
3
votes
2answers
72 views

Magento 2: Pass variable from phtml to js

here is my layout <referenceContainer name="minicart.addons"> <block class="Vendor\Mymodule\Block\Cart\Sidebar" name="shipping_bar" template="Vendor_Mymodule::cart/minicart.phtml"> ...
0
votes
0answers
25 views

Get page title from another magento module

I use weltpixel to integrate with Google Tag Manager, but I have to get the page title and store the information, I have a phtml but I need to check how to use the correct magento lib and get it ...
0
votes
2answers
20 views

Magento 2 .focus() not working in template

I have this template: CODE PHTML: <div> Content // this line is OK </div> <script type="text/javascript"> require(['jquery'],function($){ $(window).load(function()...
0
votes
0answers
21 views

Magento 2.2.9 question about foreach data into popup modal

I am trying to do a popup modal with this information I have in an array. I have ID, NAME and DESCRIPTION So in a function, I have done foreach to gather all the information and i am showing it on ...
0
votes
1answer
14 views

how to check an array with cart price rule ID magento 2

I am trying to get Cart_Price_Rule. public function test() { $ruleArray = $this->adventCollectionFactory->create()->getData(); $ruleArray = array_column($ruleArray,'promo_rule_id')...
1
vote
0answers
30 views

Magento 2: Use Zend_Pdf easily while making PDF file

How to make a dynamic PDF easily while sending an email with this PDF attachment using Zend_Pdf because of this type of code $page->drawText(__("Image"), $x + 60, $this->y-10, 'UTF-8'); $...
0
votes
2answers
29 views

Image is not showing in frontend when we call the phtml file in CMS page

My requirement is to create a slider without using extension. So I have created a phtml file with the html code and script for slider and called this phtml file in a cms page. But in the frontend the ...
0
votes
2answers
51 views

Magento 2: phtml page adding buttons and pop up models

Is it possible to add a few buttons and once the user clicks get pop up model which built by Magento 2? I want to allow the user to click a button and display a pop-up I was thinking to add 2/3 ...
0
votes
1answer
13 views

unexpected SyntaxError from Template/Ajax - Magento 2

I am a newby in Magento, so sorry if my question seem stupid. I have an error SyntaxError: JSON.parse: expected double-quoted property name at line 6 column 17 of the JSON data that I don't ...
0
votes
1answer
31 views

Send data from controller to phtml in Magento 1

Send data from controller to Phtml in Magento 1. I use ajax send data from phtml to controller and handle it. After processing, I want to send the data back to phtml. And put it on <option value ...
0
votes
2answers
38 views

I just want to be able to remove the “Filters” button from Catalog > Products page [closed]

I just have this button here in the Catalog > Products page I just want to be able to remove/hide it programmatically.
0
votes
0answers
29 views

How to get the Description after Tabs section on product page - Magento 2

We want to display description and attribute in addtional.phtml file after product tabs on the product detail page. vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml https://...
0
votes
1answer
21 views

Get link my account Magento 2 [closed]

This is the header of my website How to get my account to a file phtml
0
votes
0answers
19 views

add to compare doesn't work

When I want to add a product to compare list I get the error "page not found". The wishlist works fine, if I access the link from "mydomain/catalog/product_compare/add" it is redirected to "mydomain/...
0
votes
0answers
50 views

getIsResizeEnabled() is not working on Magento Backend

On Magento 2.3.2 version isResizeEnabled() is not working properly. It is throwing fetal error in the admin panel while I am going to the slider editing page. <div id="...
0
votes
1answer
37 views

In Magento 2 how to add phtml block after newsletter in footer.?

I want to add html content after newsletter in footer section in luma theme Please suggest me how can i do that?
0
votes
1answer
41 views

How to get value of customer custom attribute load by customer Id in phtml file in Magento2.3.0?

How to get the value of customer custom attribute load by customer Id in phtml file in Magento2.3.0? $customer = $this->customerRepositoryInterface->getById($customerId); $value = $customer-&...
0
votes
1answer
33 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
20 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
17 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
16 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
23 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
23 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
90 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
111 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
22 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
64 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
34 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
47 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
42 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
60 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
56 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
37 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
33 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
19 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
38 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
23 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
55 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
113 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
59 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
94 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
25 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
95 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
31 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
117 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
21 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
35 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
28 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 ...