Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
0
votes
0answers
9 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 = $...
0
votes
1answer
59 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.phtmlbut in xml file the phtml file was not mentioned at any ...
0
votes
0answers
11 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
15 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
38 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
65 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
35 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
22 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
23 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
11 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
25 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
15 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
18 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
6 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
16 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
18 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
50 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
27 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
25 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
19 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
37 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
20 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
22 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
11 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
22 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
56 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
6 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 ...
2
votes
1answer
56 views

Special Price Disable in Magento 2

How can i disable special price in everywhere. but without use css, is it possible ? please have a look attached image, thanks in advance
0
votes
1answer
27 views

Change display month on select box

I have a module and a select box for display month. In file download.phtml, I mentionn value month and I want display that are 01, 02, 03, ..., 12. How can I do that?
0
votes
2answers
27 views

How to add Slick Slider

I want to add slick slider on my home page in magento using static block and phtml with rotating images. if anyone have idea about that then please answer my question as soon as possible. Thank you ...
0
votes
0answers
23 views

Show Multiple Select Attribute in a CMS Block

I want to show Multiple Select Attributes in a CMS Block. In the Block I used this code: {{block type="core/template" name="ausgezeichnet" template="Magento_Theme/templates/html/auszeichnungen.phtml"}...
1
vote
1answer
31 views

call a vendor function in custom module

I'm trying to create a custom module which will have GoogleSheet Import functionality. So I want to call varienImport.postToFrame() this function works when we click on Check Data option in existing ...
0
votes
2answers
28 views

How to call Static content block

I want to create static block in Magento 2.3.5 and call that block in footer content. please anyone can have idea then please share with me. Thank you in Advance.
0
votes
3answers
35 views

How to add default head block in default.xml

I want to add default head block in default.xml file. so if anyone have idea about it then please send me the solution.
1
vote
1answer
42 views

Want to Learn magento 2.3.5

I am Working as PHP Developer and want to learn about magento 2.3.5 from scratch so can anyone having material related to magento 2.3.5 then please send me for self learning and any demo of modules as ...
2
votes
1answer
76 views

Magento 2: Shopping Cart quantity doesnt update after custom Add to cart form is submitted

I have a custom Add to Cart button for bundled products. This is on my phtml for the /test-page : <?php /** @var Magento\Checkout\Helper\Cart $_checkoutCartHelper */ $_checkoutCartHelper = $this-&...
0
votes
0answers
6 views

How to create admin form and action for edit and delete in magento 2

I am developing one module for post data to be displayed on front-end and all posts can be add,edit,delete by admin. I want to use UI Component for that, so can anyone can have idea about how to ...
0
votes
0answers
23 views

Show related products with list style on product page in Magento 2?

I was able to show the related products on the product page inside the 'related product' tab. However, it is in grid style. I'm wondering if there is a way to show them with "list style" ( like the ...
0
votes
3answers
116 views

How to use for loop in PHTML page

How to use for loop in phtml page i want to use the for loop in phtml page to complete my functionality <php? for(i=1;1<=3;i++): //My code endfor: ?> I used as above code.
0
votes
1answer
34 views

Magento 2.3: How do I retrieve the product price in form.phtml file and assign it to an HTML attribute data-purchase-amount?

How do I retrieve the product price in form.phtml and assign it to an HTML attribute data-purchase-amount ="" as code snippet meant for Klarna tagline placement as seen in the file below. <div ...
0
votes
1answer
38 views

Magento 2: How to add a new phtml(template) to a layout file so I can use it in the head section?

I am trying to add a phtml template file to the layout file so that I can use this template in the head section to insert contents from an JS file. Please tell me what is the best way to do this?
0
votes
1answer
56 views

Magento 2: How to insert a custom JS file in the header of custom theme. This custom JS file is placed in pub/media/pmm-custom directory?

I'm looking for a way to add a custom js file in the header.phtml file. I don't place custom JS file under theme_directory for a obvious reason. Could anyone please tell me how to override header ...
0
votes
1answer
86 views

Magento 2: Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Perfectmirrors\PmmLayout\Block\Head

I am really not sure how to create the block class Pmm\PmmLayout\Block\Head , function of which $block->getAllPagesJSContent() should be called inside my phtml file pmm_head.phtml <...
1
vote
1answer
30 views

Magento 2: Why do I see an extra IMG tag beside the actual IMG intended for logo on the home screen?

as seen in the image below, my Magento site displays an IMG tag before the IMG tag meant for displaying logo on the homepage. Please tell me how to eliminate the first unwanted IMG tag logo-white.svg. ...
0
votes
1answer
33 views

Magento 2: How to get only the file name of Home Page Logo?

is there a way to only get the filename of an Homepage logo in the logo.phtml template file? $block->getLogoSrc() in logo.phtml returns the URL to the logo, but I need only the filename like someimage....
0
votes
1answer
19 views

Magento 2.3.4 - Call phtml file within CMS block

I'm trying to call the following phtml file into a CMS block. Phtml file location app/design/frontend/{Package}/{theme}/Magento_Newsletter/templates/subscribe_footer.phtml I tried using {{block ...
1
vote
1answer
60 views

Calling ReferenceContainer or ReferenceBlock into phtml file

I am trying to call Template into list.phtml, this file is categories list file, here is the ReferenceBlock and ReferenceContainer code in xml file. <page xmlns:xsi="http://www.w3.org/2001/...
1
vote
2answers
235 views

Magento 2: Custom module to override the logo.phtml file of the custom theme

Naming the custom module to override the logo.phtml file found at the path seen in the screenshot below a bit confusing to me as the module name is too long to decide on the naming. The vendor of the ...
0
votes
0answers
16 views

Redirecting when submitting a Contact Form

I have a Contact page on Magento 2. After I try submitting the Contact Form, it redirects me to the page website.com/contact/index/index/ saying the Captcha is incorrect. Then when I submit it there, ...
0
votes
0answers
16 views

How to pass data from model file to phtml file?

I want to pass collection from model file and then, get HTML into model file. How to do that? Please help me. Thanks.

1
2 3 4 5
14