Questions tagged [phtml]

Denotes questions related to template `.phtml` files

Filter by
Sorted by
Tagged with
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
0answers
30 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
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 ...
0
votes
1answer
1k views

Displaying all the Product of a Category in Magento 2

how to display all the products of a category in a phtml file using an external file in Magento 2
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 ...
3
votes
2answers
1k 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?
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
21 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("...
14
votes
4answers
19k views

Magento 2 - Override base view file

I'm currently developing a Magento 2.0 theme. I'm trying to change the behaviour of the Tax class on the frontend. The file I need to change is located in app/Code/Magento/Tax/view/base/templates/...
0
votes
1answer
18 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....
7
votes
2answers
23k views

Magento 2 : load order by id in customer account order view

In the customer account order view page, I added a Block and an associated phtml file. Inside this phtml, I would like to load the order to access some information. NB: the block is added dynamically ...
0
votes
0answers
23 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
104 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 ...
11
votes
4answers
18k views

Magento 2: Call phtml file in static block or cms page

I would like to call a Magento phtml file to a static block I have a custom theme! How to do it, please? here /public_html/vendor/magento/module-catalog-search/view/frontend/templates/advanced/form....
13
votes
2answers
28k views

Magento 2 How can we get product url with product collection?

I am able to load product collection by using [$objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')] in my phtml file.But in that collection product url is not there ...
0
votes
1answer
40 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 ...
3
votes
2answers
1k views

Magento2 not getting post data from ui component phtml file

I have implemented admin form using UI component. In that, I have 3 separate tabs. Among 3, I have displayed one tab using custom phtml file by using following code in ui component form xml file <...
0
votes
2answers
33 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
1k 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/...
2
votes
0answers
29 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
39 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
22 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
1answer
2k views

Override Order Shipment View Info phtml in Adminhtml

I tried to override phtml template for order_info block in Magento order shipment view layout like this: app/code/Namespace/Module/view/adminhtml/layout/adminhtml_order_shipment_view.xml <?xml ...
1
vote
0answers
12 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/...
2
votes
4answers
2k views

how to pass a variable from one phtml to another?

I have two phtml which have its own unique block file. I need to pass variable from one phtml to another. PHTML 1 <?php $option_id = 20; ?> <a href="<?php echo $baseUrl ?>/...
3
votes
2answers
4k views

How to override a phtml file from a custom module in magento 2?

I need to override /vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml. For this, in app/code/namespace/Customtab/view/frontend/layout/catalog_product_view.xml <?...
0
votes
0answers
23 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
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
84 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
1k views

Linking on button and open custom tab

Need to open custom tab on product view, from link. Magento 1.9.2.4 Custom theme. My tab, which is added just in one category by Custom Design <reference name="product.info.tabs"> <...
0
votes
1answer
30 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?
1
vote
0answers
336 views

Magento 2 : Firefox javascript update not working

I am trying to create buttons to either add or remove 1 item of a certain type from the shopping cart. In my search I found some code online that works great for Chrome but appears to not work on ...
2
votes
2answers
2k views

How to get selected Allowed country list in Magento 2..?

I need to get the the Selected Allowed Countries in a phtml file.. How can i get that ?
0
votes
2answers
28 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"}...
0
votes
3answers
93 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
36 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
30 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.
2
votes
1answer
113 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-&...
1
vote
1answer
48 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 ...
0
votes
0answers
10 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
195 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
53 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
159 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 <...
2
votes
1answer
886 views

Magento 2 get catalog rule product details in final_price.phtml

I will try keep simple and short. e.g I have set a rule in catalogrule table and I am interested in 2 fields value: simple_action: by_percent discount_amount: 40.0000 and in catalogrule_product ...
0
votes
1answer
42 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?

1
2
3 4 5
14