Hot answers tagged

3

As I ran into the same problem and it's already the behavior observed in Magento 2.2.8, I decided to post this answer. In Magento 2.3.x this issue seems to be fixed. You can override the form.phtml template used in the cart and there change the order of the submit buttons. In Magento core it is as follows: <button type="submit" name="...


3

As I understood you want to add some HTML tags to Bank transfer Payment method. By default Magento escapeHtml when rendering Instruction for COD and Bank transfer Payment. We need to Create a small module which will override getInstructions function. let's create a module Pawan_Instructions. app/code/Pawan/Instructions/registration.php <?php \...


3

for the HTML, JS and CSS changes you can enable the merging and bundling the JS and CSS files, and then it will merge it to the client's browser too and reflect the changes, https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/js-bundling.html https://devdocs.magento.com/guides/v2.3/performance-best-practices/advanced-js-bundling.html Another ...


2

The cause of such errors is hidden in the template files. In the following commented code 1 <?php //echo "this is an unwanted php code";?> there is no space between the semicolon “;” and the closing tag of php i.e. “?>” which causes the error. For the above code, when the HTML file is minified, the closing tag of php is considered as a part of the ...


2

I was found the solution myself. Run this on your database: UPDATE `eav_attribute` SET `is_required` = 0 WHERE `attribute_code` = 'city'; And it will be done!


2

In browser console, if you see header it would look fine: But if you edit it's html you will see a special character here before header Remove this special character and this strange space will remove You need to look in your code something is printing that causing this


2

The link does not come from a template file. It is added via layout (view/frontend/layout/default.xml from the customer module) via these lines: <block class="Magento\Customer\Block\Account\RegisterLink" name="register-link"> <arguments> <argument name="label" xsi:type="string" translate="true">Create an ...


2

You need to make sure these points below are set up: Change type="text" to type="html" in email_templates.xml, otherwise you'll get plain HTML in your mails. Render the $content in the email using this format {{var content|raw}} Reference post: How to render data type html in template email magento2?


2

You can override from vendor/magento/module-checkout/view/frontend/web/template/shipping-address/address-renderer/default.html to app/design/frontend/Vendor/Module/Magento_Checkout/web/template/shipping-address/address-renderer/default.html <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --&...


2

You may try this $blockHtml = $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('identifier')->toHtml(); echo $block->escapeHtml($blockHtml);


1

template : It means path of the .html template of the particular type of field to generate field. elementTmpl : It means path of .html template of the particular type of field (select,text,textarea etc.) Reference


1

document.getElementById('poboxmessage').style.display='block'; document.getElementById('poboxmessage').innerHTML=$.mage.__(document.getElementById('poboxmessage').innerHTML); I was misinterpreting that my div returns a string in block inside mage functionality rather it needs to be converted to block first and then into plain text. $.mage returns ...


1

Please add this to the PHP file. $giftcods = ['VFDFRVXSW43VF', 'FFRFRFVSW43VF', 'VFDFGFGFXSW43VF']; $templateVars = [ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => implode("<br>",$giftcods) ]; And set in template as ->setTemplateVars($templateVars) Use variable in HTML as, <div ...


1

I've created custom module here for profile picture You can try to download and install module in your app/code directory and run below commands php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:clean php bin/magento cache:flush Hope this will help you!


1

Please try to install below module URL, which have provide to upload your profile pic... https://github.com/php-cuong/magento2-customer-avatar


1

Please, Use API endpoint customers/isEmailAvailable to check whether the email is available on your Magento instance, see the below link for how to use it: https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/customerAccountManagementV1IsEmailAvailablePost See the example below, if you decide to use the JS script (Jquery Ajax): $.ajax( {...


1

You need to inject these below classes in your construct. Add below code in your construct : /** * @var \Magento\Cms\Model\Template\FilterProvider */ protected $filterProvider; /** * @var \Magento\Store\Model\StoreManagerInterface */ protected $storeManager; /** * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider [description] * @...


1

I think there is some javascript issue thats why your link is not set


1

Override DefaultItem customer data Magento\Checkout\CustomerData\DefaultItem And you can call the additional to KOJS This should allow you to grab the config value protected function doGetItemData() { //add new here e.g. 'check_enabled' => $this->Helper->getNewPrice(), } In you html < !-- ko if: check_enabled ==1 --> //do h tag which does test < !-...


1

I'll give an example for checkout page, the idea is to load your config module in phtml, then you call that phtml in html We create our phtml: app/design/frontend/{Vendor}/{theme}/Magento_Checkout/templates/html/my-custom.phtml //you get your config module here then save it in $config <?php echo $config; ?> We instantiate our custom phtml: ...


1

In your Custom/Theme/Magento_Theme/layout/default.xml <move element="top.search" destination="header.panel" before="minicart" />


1

You can move header search bar using below xml element, app\design\frontend\YourVendor\YourCustomTheme\Magento_Theme\layout\default.xml <move element="top.search" destination="where you want to move" /> As per your current search my suggestion is that you can manage it via CSS


1

You should create frontend/active_theme/layout/local.xml in your theme. And should have this code: <?xml version="1.0"?> <layout version="0.1.0"> .......... ........ <checkout_onepage_success translate="label"> <reference name="head"> <block type="core/text" name="header_module" as="header_module"...


1

Often block will have default templates set in the block. In your example this is the case. If you look in the file Mage_Catalog_Block_Product_View_Additional you will see the setting of the template. public function __construct() { parent::__construct(); $this->setTemplate('catalog/product/view/additional.phtml'); } A great way of finding ...


1

Have you considered installing an extension such as this https://www.yireo.com/software/magento-extensions/emailtester


1

In particular case of the wishlist, the issues seems to be coming out of this little quirk which doesn't seem to care whether the directive is invoked inside subject or body of the email. To anyone struggling, this is quite an easy workaround: in a given template just add that |raw part at the end of the directive, like in the following: <!--@subject {...


Only top voted, non community-wiki answers of a minimum length are eligible