New answers tagged

0

If you want to add your block to a CMS page, you can add your block into HTML content like below. Otherwise, you know you can add the block XML to any layout file, as you did for the homepage. <div class="someclass">{{block class="Magento\Framework\View\Element\Template" name="homepage.category.thumbnail" template="Ktpl_CategoryCms::list.phtml" ...


0

remove any folder from <your Magento install dir>/var/cache/ remove **view_preprocessed** folder from <your Magento install dir>/var/ remove all folder (frontend) rom <your Magento install dir>/pub/static/ Now refresh the page, your changes will be there, otherwise there is some problem in your code.


0

add this file in your theme : app/design/frontend/Custom/Theme/Magento_Catalog/templates/product/list.phtml add your code after <?= /* @noEscape */ $block->getProductPrice($_product) ?>


0

you can add your data in below code One approach is to use the registry so in your controller class you put it in the registry, and then in your block you can retrieve it. <?php namespace Vendor\Module\Controller\Index; use Magento\Framework\App\Action\Action; class Index extends Action { protected $_coreRegistry; public function __construct( ...


0

call custom block and links in footer in magento 2 Create default.xml file app/code/Namespace/Module/view/frontend/layout/defaul.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <...


0

Override sales_order_print.xml file to your theme - app/design/frontend/[Vendore]/[Theme]/Magento_Sales/layout/sales_order_print.xml Update sales_order_print.xml file based on below code <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...


0

Just use$block->getPosition() at phtml and $this->getPosition() atr block class.


Top 50 recent answers are included