Questions tagged [phtml]

Denotes questions related to template `.phtml` files

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

Override Extension (/vendor) in app/frontend

I'm trying to override a layout .phtml file for a 3rd party extension which is located in /var/vendor_name/extension. As I understand, I should not be modifying the /vendor files, but this extension ...
0
votes
0answers
16 views

Need to display subcategories and their products on parent category page?

I want to display subcategories and their products on parent category in bottom of the page using different phtml file with limitation of products like only need to show 4 products. can anyone please ...
0
votes
2answers
32 views

How to used same code in helper data in magento 2?

Here is my object manager code can any one guide me how can i used same code in my helper data $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customOptions = $objectManager ...
0
votes
3answers
25 views

Magento 2 - Get name of templates block from .phtml file

Is it possible to get the block name of the current template? For example I added a block to catalog_product_view.xml: <block class="Magento\Contact\Block\ContactForm" name="...
0
votes
1answer
25 views

Magento 2: How to insert a custom phtml file in a static block

I need to insert a phtml file in a static block. The Location of the file is app/design/frontend/Pearl/weltpixel_custom/edu/custom.phtml I use "weltpixel_custom" as my child theme This is ...
0
votes
2answers
31 views

How to override items.phtml in module ? (Magento 2)

I am trying to override module-sales/view/frontend/templates/email/creditmemo/items.phtml file but no changes appearing. Is their any way i can override it in my module ? Thankyou
0
votes
2answers
17 views

Add text under AddToCart Button in Product Description Page Frontend - Magento2.3.5-p2

I tried so many ways to add text under addtocart button in PDP page, but nothing works. My block and phtml not getting called. catalog_product_view.xml <?xml version="1.0"?> <page ...
1
vote
1answer
23 views

How to call a phtml file in all pages (frontend & backend) using custom magento module?

I am using magento 2.4.1 I have created a basic module, I am trying to call a phtml file in all pages. I am using default.xml file (Separate for each scope) & calling a phtml file. But there is ...
0
votes
1answer
83 views

Magento 2: Show whole HTML code(phtml file code) into PDF file and Download with the use of DOM PDF?

I have tried to do it with zend pdf but i am not able to show whole html content with the use of zend pdf. If i want to display content of cms block , then i am not able to do it with Zend PDF. I have ...
0
votes
0answers
12 views

Override shipping fee text Magento 1.9

On One Step Checkout, ive changed table rates for purchases over 1000 to charge 85 fee. Currently its only displaying "85", I want it to show ["Shipping fee" is 85] Copy Base/......
0
votes
1answer
26 views

How to override phtml / add a static image to .phtml file from the extension?

I'm try to add a banner image to the list.phtml, but it's not displaying. This is what i did: step 1: copied /public_html/vendor/mirasvit/module-rewards/src/RewardsCustomerAccount/view/frontend/...
1
vote
1answer
49 views

How to get image in PHTML file?

Image path -> app/design/frontend/Mycustom/Mytheme/web/image/one.png how to get image in PHTML (app/design/frontend/Mycustom/Mytheme/Magento_Search/templates/form.mini.phtml) file, <?php echo ...
0
votes
1answer
17 views

how to add phtml file in magento 1 homepage?

Which is the quickiest way to add/call a phtml file in homepage (only) in magento 1 (custom theme) ? I am not sure about magento 1, so any thoughts would be appreciated.
0
votes
1answer
30 views

How do I get the language code in the product price amount template file?

How can I get the current language code in Magento_Catalog::product/price/amount/default.phtml?
0
votes
1answer
10 views

Add a module in other module

good afternoon I have the MageWorx multifee module and Id like to add the multifee on the quotes of the Cart2Quote module (emails ect). How can I do this Thank you for the attention Malka Hakuk
0
votes
0answers
35 views

How to execute javascript code and pass to it some values after an event is triggered?

I'm trying to execute some javascript code and pass to it some values after an event (e.g. Add to Cart event) is triggered. To be more specific I'd like to pass: All logged customer details (...
0
votes
2answers
26 views

create custom .phtml

HI I want to ask if I create a custom template phtml file. inside the coding do I need to include below 2 tags? <html></html> and <body></body>
0
votes
0answers
21 views

How can i retrieve order info (sku's of products, price of products, total, etc) from success page in a phtml file to put in a script in <head>

I need to retrive data from an order, on success page, this info is dynamic and i need to create a script for Dynamic Re-marketing Implementation. This is the script that has to be put after tag in ...
0
votes
1answer
30 views

How to extend newcustomer.phtml in Magento 2.3?

I want to change the default text -- Creating an account has many benefits: check out faster, keep more than one address, track orders and more. So how would i extend the path vendor/magento/module-...
0
votes
1answer
24 views

Is it officially reccomened to add a totally new phtml template file in a theme, one which doesn't override an existing template?

Magento's documentation (https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-walkthrough.html#template-customization-walkthrough) describes how to customise an existing ...
0
votes
2answers
92 views

Get Page Title In PHTML? CE 2.4

I'm struggling with something simple. I'm trying to print the Page Title in the custom block from my custom.phtml and I'm getting nothing. I've removed the Magento original page title block from all ...
0
votes
0answers
23 views

How to call gallery.phtml file in my custom phtml?

I have created a custom widget and now, I am trying to display product images Something like in the Product view page. On catalog_product_view.xml it calls /vagrant/www/vendor/magento/module-catalog/...
0
votes
0answers
25 views

How to call .phtml file in my CMS page? [duplicate]

In my CMS page, I want to call a few phtml files that are similar to product view page. Basically, I want to create something like this: After enabling template hint, I was able to see the .phtml ...
0
votes
2answers
101 views

Make Google reCaptcha field mandatory on a custom form (works fine on contact us and login form but not on a custom form)

I have a custom form and need to make recaptcha a mandatory field. It works just fine on a login and contact us page but not a separate custom form. code for a .phtml file is below- <?php $url = $...
2
votes
1answer
154 views

How to override the Catalog Widget PHTML file into custom module?

I need to override the widget template file /vendor/magento/module-catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml but in xml file the phtml file was not mentioned at any ...
0
votes
0answers
21 views

How to show the static block only for logged in customers globally?

I have created static block in admin panel and want to show that block only for logged in customers. I have tried it via creating the module and in template file I have written a condition to show the ...
1
vote
1answer
134 views

How to open new tab on button click and send post data?

I've been trying to make my button open a new tab, the same way my form is doing but I've discovered that window.open() doesn't work on POST requests. SO, is there any other way I can make my button ...
0
votes
0answers
40 views

Receiving checkbox status as Yes or No on a custom form to an email template

I am new to php and html and trying my hands on the below code where I have a custom form as shown in below SS and once customer submits the form I need to get the checkbox status as 'Yes' if the ...
1
vote
1answer
69 views

M2: Using small PHP script in .html file (or) Changing .html file to .phtml

We are running into an issue where we need to run a little php script within a .html file in Magento 2, namely; /app/design/frontend/CleverSoft/core/Magento_Checkout/web/template/minicart/content.html ...
1
vote
2answers
545 views

PHTML Uncaught TypeError: $(…).lazy is not a function

After installing this module I get an error sometimes: Images won't load and the next error will show on console: Uncaught TypeError: $(...).lazy is not a function With a link to this section of code ...
0
votes
0answers
37 views

How to pass data as parameter with block function in <script type=“text/x-magento-template”>?

How to pass data as parameter with block function in below script: <div class="col-sm-7 col-md-8 col-xs-9 col-lg-9 tag-content"> <h4><a target="_blank&...
0
votes
1answer
26 views

Add a custom input from phtml in admin form

I'm using custom phtml to display some data in an admin Ui form tab, and I want to be able to have a custom input that would get sent to the controller when I hit 'save' ui_form.xml <fieldset name=...
0
votes
1answer
13 views

How to get Html post request value in Controller?

I've been trying to send the SKU of the product from the product page to another page so I can integrate it with an API. Here's my code phtml code: Here's my Controller code: For some reason I can't ...
1
vote
0answers
28 views

Magento Checkout updateCart.phtml

Can anyone explain how the product qty in the input field in view/frontend/templates/cart/item/configure/updatecart.phtml is being pulled. This phtml file is used when you're trying to edit a product ...
0
votes
1answer
16 views

Block in reference root not loaded but loaded in reference header

Magento CE 1.9.4.5 I created a module and successfully had it loaded. The xml is below: <?xml version="1.0" encoding="UTF-8"?> <layout> <default> <...
0
votes
1answer
22 views

Override phtml template file

Simple issue : This is one of magento template core file : vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml How can I overide it ? I tried to create this one but it failed app/...
0
votes
0answers
9 views

pager isLastPage not correct

I have modified Magento_Catalog/templates/product/list.phtml. I added this code: /** @var $pagerBlock Magento\Theme\Block\Html\Pager */ $pagerBlock = $this->getLayout()->createBlock("...
0
votes
1answer
20 views

show all products in one page on magento 2

I want to show all products in one page from a custom cms block. This is the code I tried: {{block class="\Magento\Catalog\Block\Product\ListProduct" template="Magento_Catalog::list....
0
votes
0answers
28 views

Magento 2 - Display Configurable Product Option Value with Quantity on Product View Page

I'm working on a module where I'm attempting to display the configurable product's option values and quantity on the product page in a clean table with two options per table row. However, I'm not sure ...
0
votes
1answer
161 views

Sign In/Sign out issue in Magento 2.4

I have a Sign in Link that successfully changes to sign out when a user is logged in, and successfully logs the user out when I click sign out. However, I ran into a bug. When Signed in, if I go to ...
0
votes
1answer
74 views

Magento 2 - Call to a member function addAttributeToFilter() on null

I am working on a module for a customer that is designed to generate a category link to the main artist page for the product. I've created a module that's designed to get the category IDs of the ...
0
votes
2answers
66 views

How to load PHTML file last after page is fully loaded

I have a script in my phtml file but I want to only load this ones the page is fully loaded. I am doing a check if my custom module is enabled show the < script > Adding script like this : You ...
2
votes
0answers
40 views

Add reply field to Review Form - Magento 2 (current version 2.3.5p1)

I have created the following: registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_NewField', ...
0
votes
1answer
47 views

I have created a custom module for backed to add menu and submenu but it shows me on phtml file in Magento 2

I have created a custom module for back end Menu and sub menu but it shows me an error for phtml file. 1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template ...
0
votes
1answer
25 views

How to override magento_sale module phtml file?

I am unable to override this file in adminhtml of magento_sale module here is the path vendor\magento\module-sales\view\adminhtml\templates\order\create\totals\shipping.phtml The issue is that file ...
0
votes
1answer
23 views

Use phtml in stead of html for emails in magento 2

Im overwriting the template vendor/theme/Magento_Email/email/header.html I want to add php in this template. Is there a way to include a template in header.phtml? I currently have this which doesn't ...
1
vote
0answers
13 views

Calling minicart in phtml not showing dropdown on click

I'm calling minicart in my phtml like below <?php echo $this->getLayout() ->createBlock('Magento\Checkout\Block\Cart\Sidebar') ->setTemplate('Magento_Checkout::cart/...
0
votes
0answers
24 views

How to separate cents from price?

I was wondering how to split cents from price so I can style them differently . I am new to magento so I cannot really understand where and how to find the file that creates this html -> I want to ...
0
votes
1answer
58 views

magento 2.3 call customer group Name

i am using magnto 2.3.x, how can i call the customer group Name in phtml not a customer group ID. Thanks for help
0
votes
0answers
7 views

Unread jQuery script in custom phtml file included with ajax in Magento 2

I have included in the product page a custom external phtml file from a module which is called with ajax on click. The html and php code is read correctly, only the jQuery code is not read and is not ...

1
2 3 4 5
14