Hot answers tagged

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 ...


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

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="...


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

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

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

No that will not work unless you rebuild the checkout to not use UI components, this is because UI component templates are rendered client side which does not support PHP as it runs on the server and not the client.


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

I think a ko tags must be closed, like: <!-- ko rvStorage() --><!-- /ko --> <!-- ko foreach: { data: recently(), as: 'productView' } --> <li class="product-item" > </li> <!-- /ko --> <!-- ko rvCarousel() --><!-- /ko --> and must look like <!-- ko --><!-- /ko --> From the ...


2

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


1

Referring to question - Magento 2 - Homepage is 404 See if there are any records missing value for request path using below query: SELECT * FROM `url_rewrite` WHERE request_path=''; Either remove those records or update with valid values.


1

You want to use the value KO binding. The value binding links the associated DOM element’s value with a property on your view model. This is typically useful with form elements such as , and . When the user edits the value in the associated form control, it updates the value on your view model. Likewise, when you update the value in your view model, ...


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, 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

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

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

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

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

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


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