Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

I edited the layout file: <referenceContainer name="header-wrapper"> <block class="Magento\Framework\View\Element\Template" name="icon_account" as="icon_account" template="Magento_Customer::/icon/icon.phtml"/> <block class="Magento\Framework\View\Element\Template" name="links-menu" as="links-menu" template="...


0

As i was somewhere else maybe mentally :P... Their were too many typo in my code: In /EC/Downloads/view/adminhtml/requirejs-config.js. var config = { map: { '*': { dataTables: 'EC_Downloads/js/datatables.min' } } }; In /EC/Downloads/view/adminhtml/layout/downloads_index_reports.xml <page xmlns:xsi="http://www.w3.org/2001/...


0

Add Value Property in yout Textarea :- <div class="control"> <textarea name="title" id="amfaq-title" value = "<?php echo $current_sku ?>" title="<?= $block->escapeHtml(__('Question')); ?>" class="required-entry input-text" cols="5" ...


2

You Can Call Another Module Block Like This :- $block = $this->getLayout()->createBlock('\Vendor\Module\Block\File')->yourFunction();


1

You have to create a layout handle for it. MyModule/ProductAlert/view/frontend/email/stock.html <tr class="email-information"> <td> {{layout handle="product_alert_email_stock" items=$items area="frontend"}} </td> </tr> In the above code, I have declared variable items=$items create block file for a layout handle....


1

You can create a method in MyModule\ProductAlert\Block\Email\Stock You need to inject \Magento\Customer\Model\Session $customerSession, class to get customer Email. protected $customerSession; public function __construct( ... \Magento\Customer\Model\Session $customerSession, ... ) { ... $this->customerSession = $customerSession; ....


2

override vendor/magento/module-customer/i18n/en_US.csv In your theme and put "Sign In","test in" What you need if above not working then override authorization.phtml in your theme like this and put code as below: app/design/frontend/Test/testnew/Magento_Customer/templates/account/link/authorization.phtml <?php /** * Copyright © Magento, ...


0

You can check the Customer Block Class in: Magento\Customer\Block\Account\Customer.php


0

Looks like you need to wrap your JS in a return function: return function (config) { ... } Try this: define(['jquery'], function($) { 'use strict'; return function (config) { console.log('#engraving' + config.lineId + '_' + config.id); console.log(config.id); console.log(config.maxChar); console.log(config....


2

To Get exact idea how to set page meta data via block refer vendor/magento/module-cms/Block/Page.php In this magento have a function protected function _prepareLayout() { // ... $this->pageConfig->getTitle()->set(__('Custom Page title')); $this->pageConfig->setKeywords(__('Custom Page keywords')); $this->pageConfig->...


1

I solved it by doing make an ajax request and sent in to controller. app\code{Vendor_Name}{Module_Name}\view\adminhtml\templates\form\Import.phtml <div class="pp-buttons-container"> <button class="import" id="<?php echo $block->getId() ?>" onclick="return false;"> <span><span><span><?php echo 'Import'; ?...


0

Maybe subscribe.phtml is override by theme or other modules. First, enable template hint and check from where subscribe.phtml Calling. https://www.mageplaza.com/kb/how-to-enable-template-path-hints-magento-2.html According to template hint modify the template file. But you don't work directly at the vendor folder. Override via Theme or Module You can ...


0

Please try this solution. 1) Magento way $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $escaper = $objectManager->create('Magento\Framework\Escaper')->escapeHtml(__('Subscribe')); 2) Core Php way htmlspecialchars(__('Subscribe'), ENT_COMPAT, 'UTF-8', false);


0

Following this way.. <div id="contact-popup"> <?php echo $block->getLayout()->createBlock('Magento\Contact\Block\ContactForm') ->setTemplate("Magento_Contact::form.phtml")->toHtml(); ?> to <div id="contact-popup"> <?php echo $this->getLayout()->createBlock('Magento\Contact\Block\ContactForm') ->...


1

To call the helper function into phtml file, you can use this code. <?php $helper = $this->helper('Custom\Module\Helper\HelperClass');?> $helper->Yourfunction(); ?>


1

You should not call helper directly in phtml. You should provide helper instance dependency to the block that will renders the phtml and create a function in your block class that calls the helper and call that function in the phtml. You should define it like below: protected $helperData; public function __construct( .... \{VendorName}\{...


0

Thanks @ARUNPRABAKARAN-M, I think this is the good solution cause now I've an error on product page. Please see below : 1 exception(s): Exception #0 (Exception): Warning: Invalid argument supplied for foreach() in /var/www/jkcmage/app/design/frontend/Smartwave/porto_child/Magento_Swatches/templates/product/view/renderer.phtml on line 16 Exception #0 (...


0

There is an issue in your Email template file. Your given template file is not found in an assigned block(Magento\Framework\View\Element\Template). so you need to create a custom block and have to assign that block to the phtml file. And extend your custom block to Magento\Framework\View\Element\Template Check below detail description example. app/code/...


0

You need to pass something like below in your email.html file. <td> {{layout handle="product_stock_alert_items"}} </td> Create layout file as product_stock_alert_items.xml in layout folder. Add content in it like below. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


1

<script type="text/javascript"> require([ 'jquery', 'jquery/ui'], function($){ $(document).on("click","#acceptnow", function(e) { var currentRow=$(this).closest("tr"); var col1=currentRow.find(".quoteid").text().toString().trim(); var col2=currentRow.find("td:eq(3)").text().toString().trim(); var col3=...


0

If you want to customize in product listing page. Kindly override in the following path app/design/frontend/[VendorName]/[theme]/Magento_Swatches/templates/product/listing/renderer.phtml If you want to customize in product detail page. Kindly override in the following path app/design/frontend/[VendorName]/[theme]/Magento_Swatches/templates/product/...


Top 50 recent answers are included