Skip to content

phtml

Auto Added by WPeMatico

How to retrieve custom product attributes through product description or short description using phtml templates?

Using: Magento 2.4.5 Community Edition I currently have two custom phtml blocks {short_description.phtml, description.phtml} located in app/code/Vendor/Theme/view/frontend/templates. As an example, short_description.phtml contains: <div class=”container attribute-container”> <div class=”attribute-row”> <div class=”col-12″> <div class=”attribute-label”>Attribute Label<span style=”color #4361ee;”>Attribute Value</span> </div> <div class=”attribute-label”>Attribute Label<span style=”color:… Read More »How to retrieve custom product attributes through product description or short description using phtml templates?

Call phtml using block code

login to magento admin. Open any cms page and write block code in content section. {{block class=”MagentoFrameworkViewElementTemplate” name=”test_file” template=”Magento_Theme::test.phtml”}} After using the block code phtml file will be called on cms page but after Footer. How can we call before… Read More »Call phtml using block code

New to Magento phtml code doesn’t show

I’ve been trying to add phtml to my custom theme but it doesn’t show for example <block class=”MagentoCatalogBlockProductView” name=”product_view_custom_block” before=”-” template=”Magento_Catalog::product/view/custom_block.phtml”/> path for xml is <theme_name><theme>Magento_Cataloglayoutcatalog_category_view.xml path is <theme_name><theme>Magento_Catalogproductviewcustom_block.phtml the template=”” what should I put inside the double quotes? Did… Read More »New to Magento phtml code doesn’t show