Questions tagged [phtml]
Denotes questions related to template `.phtml` files
741 questions
0 votes
1 answer
24 views
Problem when modifying inherited theme
/home/pedromontesi/Documentos/magento/src/vendor/magento/theme-frontend-luma/Magento_Theme/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/...
0 votes
0 answers
30 views
How to remove 'All' from category menu in Magento 2.4?
Magento Version: Magento 2.4.6 Issue: I want to remove the "All" prefix from category menu items in Magento 2. For example, currently, it shows: All Why Choose Us I want it to display: ...
0 votes
0 answers
77 views
How to change the placement of categories filter in Magento 2.4.7 from sidebar to top of catalogue page
I'm working with Magento 2.4.7 and using the Minimog theme from Bluesky. Currently, the categories filter is part of the layered navigation on the left side of the catalog pages. I want to move this ...
0 votes
1 answer
46 views
Tie dynamic fields from custom phtml block to Product Edit Save request
I have created a custom block on my Product Edit admin page by adding this to product_form.xml: <fieldset name="my_custom_fields"> <argument name="data" xsi:type="...
1 vote
2 answers
56 views
Place DIV or SPAN class inside stock available
How can I place a div or span class inside stock available with custom xml. Would like custom block next to INSTOCK. <body> <referenceBlock name="product.info.stock.sku"> ...
1 vote
1 answer
409 views
Using if statement in phtml
Would like to put an if statement in the below code as follows. If saleable qty <=0 (equals 0 or under), add CSS. Otherwise, add different CSS <div class="left-stock"> <...
0 votes
1 answer
127 views
how to remove out of stock product price (final_price.phtml - magento 2.4.3p1)
I tried using isSaleable(), getSaleableItem(), is_in_stock, without success. I'm new to Magento and I don't have much knowledge.
0 votes
2 answers
83 views
How to get current category name when having only the product ID
I want to get the current category name in a .phtml file, having only the product ID. The product ID is fetched from reviews. Note: I'm not running this on product page. This is what I have now: <?...
0 votes
2 answers
156 views
Form submit is not working post mode in the magento 2.4.5
I have phtml file which has submit. I am going to submit with post mode. But get mode is working continuously. Why is the reason? <form id="publication_reg_frm" method="POST" ...
1 vote
1 answer
461 views
Magento 2. Change the price format .0000 to .00
In abandoned cart email I have <?= $item->getPriceInclTax() ?> and it looks like this 29.0000 Is it possible to change to 29.00
0 votes
1 answer
582 views
How to call a block function from another block or template
At the moment I am trying to call a function that is in another block that I am writing from. I have tried through the __constructor() to pass the other block but this has not worked and using the ...
1 vote
1 answer
263 views
Magento 2 : How To Get Configurable Product's Child Product Id Using Text-Swatch-option?
I want to get the product id on selecting the text-swatch option. for that, I have used the code given below. I am getting the error of "Cannot read properties of undefined (reading 'options')&...
0 votes
1 answer
690 views
Magento Checkout, Check if the user is logged-in
I have to redirect the user to our SSO login page ifhe is not logged-in during the checkout. As suggested here, I added this check into my phtml file that overrides this vendor/magento/module-checkout/...
0 votes
2 answers
276 views
Calling magento block returning false
This probably easy and I'm forgetting something but... product.price.final is a default xml block of magento why does it always returns false when I call it on my custom phtml. <div> <?= $...
1 vote
2 answers
165 views
Where to add business logic for phtml template files that reside under modules in design dir?
I have a template file that resides under app/design/frontend//theme/Magento_Sales/templates/order/email_invoice_totals.phtml As I understand, the business logic should not reside in those template ...