Questions tagged [phtml]

Denotes questions related to template `.phtml` files

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

Magento 2 Add Anchor link in Notice, Error or Success Message

The link shows exactly how it is typed instead of an actual link. What am I missing? <div class="message notice"> <div> <?= $block->escapeHtml($block->getNoResultText(...
0
votes
4answers
39 views

How to get Magento 2 customer group ID

How to get Magento 2 customer group ID if user is logged in, in a .phtml file? I have already tried with: protected $_customerSession; public function __construct( \Magento\Customer\Model\...
0
votes
1answer
26 views

How to add button at top of Layered navigation Filter from custom module?

I have a phtml that contain button like this in my custom module : app/code/Vendor/Module/view/templates/button.phtml <button> <span> <?= __('New Button') ?> </span> </...
0
votes
1answer
12 views

How do I correctly move products and categories between stores in magento1?

I currently have a magento 1.9 installation which uses two stores. I'm at the moment trying to move a category (as well as the subcategories and products) from one store to the other but I'm running ...
0
votes
0answers
10 views

Add autocomplete=“on” to e-mail field at Checkout

For some reason, we need to add the tag autocomplete="off" to the e-mail field at checkout (/checkout/). So the current code: <input class="input-text mage-error" type="email" data-bind="...
0
votes
1answer
21 views

Magento 2: How to pass object as a argument from phtml

I want to pass object as a argument from phtml file how can I do this? As I've checked we can pass string using $block->setData('var','test') but didn't found for object.
0
votes
0answers
12 views

How to trigger an event that selects all the select attribute entries with the same value

magento 1.9 I want to do a function (maybe it is possible with js, but I'm not good at it yet) that after a customer selects an entry - IN THE FIRST MOMENT - in the select field "UNIDADE" all the ...
0
votes
1answer
23 views

Magento 2 override product list.phtml

I want to override product list.phtml and in my layout file catalog_category_veiw.xml i tried many methods but still not able to call my templates file <referenceBlock name="category.products.list"...
0
votes
0answers
19 views

In checkout page while I'm switching the address the shipping method is not get updated Is there any way to fix the issue?

In checkout page while I'm switching the address the shipping method is not get updated Is there any way to fix the issue ?
0
votes
0answers
9 views

Magento 2 Shipping Form Fields Column Layout

Default Porto Theme Magento Layout for Shipping Page We need to make it look like this: Make fields 3 column instead of 1 column. Bring Phone filed above and next to the Email field. I have tried ...
1
vote
0answers
23 views

Save product-attribute value

How to save attribute value into DB from a phtml ? ie, Phtml contains a custom input field which is rendered in the admin product edit page under a custom tab. The value entered in the input field ...
0
votes
0answers
30 views

Magento2 - Category filter is not working for all product list

Magento2 - Category filter is not working for all product list Issues page
0
votes
0answers
22 views

No output from catalog/view/frontend/templates/category/description.phtml in M 2.3.4

We don't get any category descriptions on category pages in Magento 2.3.4. The /vendor/magento/module-catalog/view/frontend/templates/category/description.phtml file is loading in frontend (see ...
0
votes
1answer
39 views

Error filtering template: Invalid template file in module

I have this issue and I don't know how to solve it. My phtml file is under: app/design/frontend/rwd/josefsteiner/template/home.phtml and i tried to include this phtml file into my CMS site like ...
1
vote
0answers
14 views

Template notations in magento

I was working with the Algolia search module in Magento 2 and foud something like below in the template files. Can anybody let me know what this notation is called and where can I learn more about ...
0
votes
0answers
23 views

Use Magento UI Form Component Outside Of Form? (Product Category Selector)

I need to use the Product Category Chooser: But not inside of a usual UI Component form. Is this possible? Basically I want to call it from a .phtml file for a custom admin page I'm building.
0
votes
1answer
34 views

Magento 2 How to call template file in block file

My block file form.php and I want to call phtml file in this block to display table in this custom admin form, I have no created a layout for this phtml file, if is there any other way to display the ...
0
votes
3answers
52 views

How can i get phtml file in helper magento 2?

I have tried this solution but it is not working $this->_layout->createBlock('Vendor\Module\Block\Productdesigner'); $response = $layout->setData(array("customer_data" => $result))...
0
votes
1answer
27 views

Modification to .phtml does not render

In content/page homepage I insert a widget from the porto theme: {{block class="Smartwave\Filterproducts\Block\Home\LatestList" name="latest_product" product_type="4" product_count="50" category_id="...
1
vote
1answer
94 views

How to get current page number from url in Magento 2

I want to check the page number which appears in a URL in a phtml file. For example, if the URL is: http://localhost/magento/index.php/shop.html?p=4 How can I get the value 4 in the .phtml file? ...
0
votes
1answer
37 views

Convert Magento 1 PHTML Code to Magento 2

I have a template from a customer's Magento 1 theme that I need to move to M2. The theme isn't the same but the template does what I need it to on M1 and I need this in Magento 2. <ul class="...
1
vote
0answers
79 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 ...
0
votes
1answer
35 views

Changing phtml file via /app

In a previous question i asked where to find items.phtml file. I found it and did the configuration and it worked. But when i did this it was via this path: vendor/magento/module-shipping/view/...
0
votes
1answer
38 views

magento 2.2.3 how to add a new cms block or new phtml to product page

I want to add a new cms block or PHTML to the product page. I have the following files composer.json, etc/module.xml, and registration.php I have view/frontend/layout/catalog_product_view.xml &...
1
vote
2answers
37 views

How can i translate custom elements in .phtml file according to store view

I have added a tag in form.phtml file which shows on view Cart Page. <h1>Custom Cart Information</h1> which effects as Hence my store is multi-lingual when i change store view to ...
3
votes
1answer
48 views

How to override .phtml file in module?

I am trying to change sign in or create an account message which is called by block named product.review.form in catalog_product_view.xml. /vendor/magento/module-review/view/frontend/layout/...
0
votes
1answer
70 views

Where to find Magento Configuration files

I'm trying to change a default setting in Magento, and I have found the solution how to change it. The issue is I can't find the file, I need to modify items.phtml. The path is app/design/adminhtml/...
0
votes
1answer
57 views

$block is not working in override phtml file

I override totals.phtml, but when I am calling my custom block in it, its not working. File path: Magento/vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml Override File ...
0
votes
0answers
20 views

How do I get the value of a property in my product on my phtml file?

Im looking at my theme/Magento_Catalog/templates/product/price/final_price.phtml and I am trying to set up a conditional so that when a custom field that another developer built in as a dropdown is ==...
0
votes
1answer
36 views

How not to use ObjectManager in phtml from template

First a bit of context, and at the end, my question I added an EAV attribute to my customer. It's an attribute with multiple values, and I want to add it to the account information (for reasons). I'...
0
votes
1answer
26 views

how to add custom js to end of footer on every page

I want to add a custom js file to all pages before the footer i want to pass script through phtml Is it possible to do this?
0
votes
3answers
42 views

i want to show a template before tabs

I want to show a template just before all tabs but it's not showing. my code on file catalog_product_view.xml : <referenceContainer name="product.info.detailed"> <block ...
0
votes
0answers
38 views

Display Product More Information In product Category Listing Page

i want to display product "More information" in catalog category page. I copy that code from /magento/module-catalog/view/frontend/templates/product/view/attributes.phtml <?php $...
0
votes
1answer
34 views

How to call displayProductStockStatus() method from a custom block?

in catalog_product_view.xml of my theme I have a block like this `<block class="Magento\Catalog\Block\Product\View" name="extra.product.info" template="product/view/extra-product-info.phtml" after=...
2
votes
1answer
32 views

How to access a variable declared in a phtml from another phtml?

I have inserted two blocks in the catalog_product_view.xml file: <block class="Magento\Catalog\Block\Product\View" name="product.info.custom-product-attributes" template="product/view/custom-...
1
vote
1answer
39 views

How to get the store code in a phtml file of Magento2?

In a custom phtml file I have to get the code associated to the store view (not the Id), any idea how to get this?
1
vote
0answers
16 views

How can I add a container div for each color of the swatch colors on the product page?

I am trying to add a container div for each color of the swatch colors to give it the look I need (configurable product, in PDP). I am adding the div in the following file that I inserted in my theme ....
1
vote
1answer
38 views

magento 2 how to add magestore slider in blog phtml file

Here I have a blog page there I wanted to display banner sliders. I configured the sliders they working fine in home page, but am unable to add in custom phtml(blog) page here is my blog Phtml file &...
1
vote
1answer
56 views

update message “ Your search returned no results. ” when no records found

I wanted to update message " Your search returned no results . " in magento2.But i am not getting directory file to change the message.I am new to magento2. Please let me know the exact file path ...
1
vote
2answers
78 views

Magento2.3: How to remove others in general at registration form?

In account registration form, we have a gender field, on that there are three options as Male, Female and Others. I want to remove Others in registration form. How can I remove that? Any help will ...
1
vote
1answer
134 views

How to add texts to payment step Onepage checkout page

Which file should i edit to add text underneath all the payment methods. ( I would like to add some return/refund policy). The URL is https://www.mywebsite.com/checkout/#payment
0
votes
0answers
29 views

Magento2.3: How to make a sticky header?

I have tried to make a sticky header but no success. I have followed many posts regarding this but none of them is working for my case. I have followed below link. Fixed Headers in Magento Any help ...
1
vote
0answers
32 views

How to Add an icon next to Payment Method for Amazon Pay?

I have looked up a few similar question but can't figure how. It's the default amazon pay module that came with Magento 2 I'm editing this file /var/www/html/vendor/amzn/amazon-pay-module/view/...
0
votes
1answer
98 views

Call store Switcher in phtml file directly in Magento 2

I want to call Store Switcher in phtml file directly. I tried to call directly but its not working. Kindly review. $this->getLayout() ->createBlock('Magento\Store\Block\Switcher') ...
0
votes
0answers
86 views

Magento 2.2 display brand logo product detail page

Please can someone provide step by step instructions or provide tutorial on how to display brand logo on product detail page above the add to cart button. Thanks
2
votes
2answers
103 views

Magento2.3: How to move the custom block in account navigation sidebar?

I want to show the customer profile pic and the name after he/she logged in on the account navigation sidebar. I have successfully got those details. Please see below. However, I want to show them ...
2
votes
1answer
110 views

Magento 2: How to get product by SKU in custom page?

I created a custom page, where users can input SKU of product and after they submit the button, its load product details, like name, image and a configurable option for configurable product. Here is ...
0
votes
0answers
68 views

Magento2.3: Cannot add a product to wish-list even after logged in

I'm facing an issue in adding the product to wish-list. I have logged-in the site but still can't add the product to wish-list. When checking the admin configuration, I see the wish-list is enabled ...
0
votes
2answers
155 views

Add custom row to Order View on Frontend Magento 2

I have my own custom discount, and on checkout I can use it. When I place the order, I see that grand total is changed, but me need to show discount. I want to paste it between subtotal and shipping.
1
vote
1answer
43 views

Can I change the extension from .HTML to .phtml?

I've got a custom payment module. I've .HTML checkout button page in this path. \app\code\vendorName\moduleName\view\frontend\web\template\payment\vendor.html Can i change .phtml instead of .HTML

1
2 3 4 5
13