Questions tagged [phtml]

Denotes questions related to template `.phtml` files

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

Magento Module - PHTML

I need some help with a problem I have with a module, I know this is a newbie question but here i go. <div class="field company <?= $block->isrequiered() ? 'required' : '' ?>">...
0
votes
0answers
16 views

How to get current category name in catalog view page(catalog_category_view.xml)?

I have a view model with a method for returning the category names from the current_product (Works in product view page). However it returns null when being used in the catalog view page (...
0
votes
3answers
29 views

How to add block for Specific category's products in Magento 2 by layout/catalog_product_view_attribute_set_id_[id]?

I am trying to the make block visible only in Category 3. The block renders fine in catalog_product_view.xml. However when I change the file to catalog_product_view_attribute_set_id_3.xml, it doesn't ...
0
votes
1answer
25 views

Unable to retrieve value from Block

I am using Magento 2.3.5-p2 I am adding a Google Tag Manager integration code at the Catalog Search, thus this requires me to modify the catalogsearch_result_index.xml and add a new .phtml file which ...
0
votes
1answer
28 views

How to change a phtml file in the vendor/ folder?

I am trying to make changes to the code in a phtml file at vendor/magento/module-newsletter/view/frontend/templates. I have made a new directory and placed the new phtml file to the app/design/...
0
votes
2answers
40 views

Magento 2 Passing parameters to Content Blocks

I'm new to Magento I want to create a block in the admin panel (Content > Elements > Blocks) which contains HTML code, CSS style, and some dynamic parameters under its content box. Example: <...
0
votes
1answer
37 views

Magento2.4 How to add product to cart with a customizable option?

I am trying to add a product to cart with a customizable option. I can add simple products, but I have not successfully been able to add a product with an option. The product will eventually be added ...
0
votes
2answers
30 views

Magento 2, How to call Controller custom function?

I have a controller with custom function getPost(). I want to call this function from my phtml My phtml code: <form id="my-form" method="POST" action="<?php echo $block-...
0
votes
0answers
47 views

How do I pass in a viewModel to a core block that has been overridden?

I am rewritting the /vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml file. The file MyCompany_MyApp::product/default.phtml works fine, but I want to pass a ...
0
votes
3answers
73 views

Magento 2: Log Error message on phtml

how can I print the log error message in the phtml file? the error can be shown to the user on the page
0
votes
1answer
42 views

Magento 2.4 How to get category of current product from within ViewModel without using objectManager?

This works but uses objectManager namespace Myvendor\Myprogram\ViewModel; class CatLogic extends \Magento\Framework\View\Element\Template implements \Magento\Framework\View\Element\Block\...
0
votes
0answers
22 views

How To Add Product Tab For Specific Product Type In Your Custom Module Magento 2.4?

I create my custom product type name "rental" that create successfully now I need to add a custom tab in that specific product type I create catalog_product_rental.xml but the /run/user/1005/...
0
votes
0answers
18 views

How can I use Magento2 GraphQL in pure JavaScript?

I see that Magento GraphQL was used to build Progressive Web App. Can I use GraphQL for my simple web application? For example, I need to get all items of the user wishlist on the user dashboard page. ...
0
votes
1answer
19 views

Pass variable from template (phtml) to CMS page

I have this code, which is rendering a static block in a template file (phtml). $_html = $this->getLayout() ->createBlock('Magento\Cms\Block\Block') ->setBlockId('test-block') ...
0
votes
0answers
6 views

i added a blog widget in homepage and i want to find the file that have the widget HTML code

I added a widget in my home page content and I want to find the files and HTML code of this widget where is placed in my Magento 2.3.6 files, because I want to edit on it
0
votes
1answer
40 views

Magento 2 : How to Override Core Template Magento_Review::helper/summary.phtml

How to change the template in a custom module. Original path = vendor/magento/module-review/view/frontend/templates/helper/summary.phtml I want to change this template to my own when my module is ...
0
votes
1answer
20 views

What function do I use to replace the depreciated escapeJs()?

I am using Magento2.4. In my phtml template, I am trying to escape an a argument that is being passed into a javascript file via requireJS, but PhpStorm is warning me that escapeJs() is depreciated. ...
0
votes
1answer
23 views

Can't get file in Post-Controller from input in Phtml

I have a file-input field in my pthml and would like to use it to upload picture files. [...] <div class="field file"> <label class="label&...
0
votes
2answers
37 views

.phtml file changes won't show, even though my static files and cache are cleared

So this is driving me a little nuts, I'm working on a child theme of Luma and the design requires me to modify some of the catalog blocks, so I've copied over a .phtml file into my theme folder. The ...
0
votes
0answers
19 views

How to add view model to existing phtml and block

Is there any possibility to add ViewModel to the existing block and PHTMl file? I'm trying to add ViewModel to the file below. sales_email_order_renderers Code: <?xml version="1.0"?> &...
-1
votes
2answers
45 views

How can i override module_backend file in app/design folder in magento 2?

i need to need to change admin copyright content they comes from this vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml so how can i override this in my app/design folder ...
1
vote
1answer
53 views

How to call php block function with parameters from a js file?

I'm new to Magento, and I'm not sure how to make this work. I tried searching a lot but could not find anything related. I have a block function in my custom module which takes 2 parameter public ...
0
votes
1answer
62 views

Error: Call to a member function getCategoryId() on null when trying to get Category from \Magento\Catalog\Block\Product\View

so I'm trying to check if the category ID is 6 to change the text that appears in delivery time, but when I try to call the $_product, it says that it's null, and I can't figure out why. Any help ...
0
votes
0answers
25 views

Importing Magento\Catalog\Block\Product\View to theme phtml file

so I'm trying to overwrite the title.phtml in my Magento_Theme file, and its working, but now I want to get product data from Magento\Catalog\Block\Product\View, but it says that the variable in ...
0
votes
0answers
17 views

Magento 2 extend errorPlacement in knockout

I need to extend errorPlacement from validation.js in Magento_Checkout/web/.../email.html I want to append error's (in checkout login section) in a custom div created by me in email.html. I tried 2 ...
0
votes
3answers
72 views

I want to delete marker from my html, css. Its showing on store view

I have marker showing in my slider on store view how can I remove it, I can't find this code in html. [
0
votes
0answers
16 views

Success screen stuck in luma theme Magento 2.3.5 Community Edition

everything good? I'm trying a problem that I've never caught in these 2 years of magento, I would like to know if you've been through this for tips on how to get out. On the success screen, the layout ...
0
votes
2answers
46 views

I want to call phtml file from Magento_Theme to static block. but it is giving some error

PHTML file is located in Magento_Theme/templates/html/breadcrumbs.phtml. I tried with the code {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html\...
0
votes
0answers
15 views

I want to add swatch images from product page to home page product list

I want to add swatch images from product page to home page product list. swatch images from here to to here, replace the text"THIS is a custom" to swatch images How can I do this.
0
votes
1answer
74 views

How to display CMS static blocks based on store in Magento 2

I have created two stores english and german and created static blocks with different contents based on the store in admin.Block Id(test) for both stores are the same but both blocks assigned to ...
0
votes
0answers
29 views

How to call javascript function in magento 2

<div class="block social-login-authentication-channel account-social-login"> <div class="block-content"> <div class="actions-...
0
votes
1answer
41 views

Override product bundle select.phtml file in Magento 2

I'm trying to override the select.phtml used on the bundle product view page I've put it here: app/design/frontend/[vendor]/[theme]/Magento_Bundle/templates/catalog/product/view/type/bundle/option/...
0
votes
1answer
47 views

Get order product item count in order success page - Magento 2

I want get number of product order in order success page. This found solution magento 1.9 visit Get ordered product count in magento <?php $_order = $this->getOrder() ?> <?php echo $_order-...
0
votes
2answers
66 views

Magento 2 Can i call two phtml file into one?

I have two phtml files, I want to use one for just the heading title and content. then the second phtml file I want to use it to call a table with a simple form submission. is this possible, if anyone ...
0
votes
1answer
34 views

How to share one phtml file variable output to another phtml file

In custom modules, I want to share my module A output variable $value = "one" to module B, print like $value How to share this?
0
votes
0answers
147 views

Magento 2: Review Form Star Rating Field Validation Not Working

I'm using Magento 2.4.0, In my product review form, all fields validation works as I expected except the Star Rating field. The client is using a custom theme with no parent theme, Once I change the ...
0
votes
1answer
35 views

Magento 2 Override admin phtml

I've made a new module and I would like to override the vendor/magento/module-config/view/adminhtml/templates/system/config/form/field/array.phtml I've copied the file in app/code/myVendor/myModule/...
0
votes
1answer
41 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
17 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
34 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
182 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
30 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
170 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
97 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
583 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
16 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
37 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
59 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
31 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.

1
2 3 4 5
15