New answers tagged

1

a) Yes, it is bad practice b) Yes, it is purely to maintain backward compatibility :)


0

Is the website using a BasicAuth, is the website public, are you using a CDN wiht basic Auth or is you SSL certificate expired? I encountered a similar situation in an UAT environment where the certificate was expired and the emails in gmail weren't showing the images. You can also check the source of the images by viewing the origin email. In gmail is ...


0

Yes, it's a Valet+ issue, to fix it you have to change your Magento 2 admin option. You can use this command below to enable the URL Rewrites via CLI. php bin/magento config:set web/seo/use_rewrites 1


0

You can use this content in your default.xml here app/design/frontend/Vendor/Theme/Magento_Theme/layout/default.xml Content for this file is : <?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

app/design/frontend/[Package]/[Theme]/Magento_Theme/layout/default.xml <referenceContainer name="header.panel"> <block class="Magento\Cms\Block\Block" name="header.promotion.message"> <arguments> <argument name="block_id" xsi:type="string">header_promotion_message</argument> </arguments> ...


0

Try this: For Admin Route <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="unlock" frontName="unlock"> <module name="Vendor_Module" /&...


0

Register your theme in below path dev/tools/grunt/configs/themes.js Like I did for my porto theme, porto: { area: 'frontend', name: 'Smartwave/porto', locale: 'en_US', files: [ 'css/styles-m', 'css/styles-l' ], dsl: 'less' },


0

routes.xml file in /app/code/Vendor/Module/etc/adminhtml <?xml version="1.0"?> <!-- ~ Copyright © BrainActs Commerce OÜ. All rights reserved. ~ See LICENSE.txt for license details. --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router ...


0

Magento updated the AbstractExtensibleObject::_getExtensionAttributes method to generate a empty object if it has no extension attributes https://github.com/magento/magento2/commit/375132a81b95fafa4a03a17b72dbacdc90afa745#diff-56d044692f579051647a8284ff39cc0eR165 so it will never return null. They do still need to update the API annotation though, e.g. in ...


1

You can add below line in your csv file here app/design/frontend/Vendor/Theme/i18n/en_US.csv "You submitted your review for moderation.","Thanks, you submitted your review." If any spell mistake is there in your text then your translation will not work. In your case, Can you please check spelling of moderation ? You've added moderdation that may be ...


1

"Running schema recurring.Unique constraint violation found" this occurs if there is duplicate entry in any table of project db and high probability to occur this problem is when you export db and then import,if db is not export completely or correctly. so the solution is just export db again correctly and import and if you created tables then define at ...


0

You can add your favicon.ico image here in your adminhtml theme app/design/adminhtml/Vendor/Theme/Magento_Theme/web/favicon.ico Because in default Magento Backend theme that icon available here. vendor/magento/module-theme/view/adminhtml/web/favicon.ico If you will add that icon with same name favicon.ico then that will work for you. Then you do not ...


1

I have searched over the web and didn't find something that can solve your problem, but I think such kind of feature will be very useful, so I've written my own solution for this problem: module-translation-helper you can install it by composer: composer require underser/module-translation-helper:v0.2.3-beta *don't forget update your composer.json ...


0

Try this: define([ 'ko', 'uiComponent' ], function (ko, Component) { 'use strict'; return Component.extend({ initialize: function () { //initialize parent Component var self = this; this._super(); }, testfunctionout: function() { console.log('in testfunctionout'); ...


0

Please go through this URL. It will help you to clear your doubts https://docs.magento.com/m2/ce/user_guide/system/encryption-key.html


0

use magento2 Sections with knockout js MAGENTO2 SECTIONS


0

use self under initailize function dont declare it under testfunctionOut initialize: function () { self = this; } testfunctionout: function() { console.log(' in testfunctionout'); self.testfunctionin(); }, testfunctionin: function() { console.log(' in testfunctionin'); }


0

you can try this if doesn't work please provide link .catalog-product-view .modals-overlay { top: unset; bottom: unset; left: unset; right: unset; background: unset; z-index: unset !important; } or .catalog-product-view .modals-overlay { display:none; }


0

Alternatively add the image via css. system.xml: <tab id="mytab" translate="label" sortOrder="1000"> <label>My Label Here</label> <class>my-tab</class> </tab> your adminhtml.css .config-nav .my-tab .admin__page-nav-title::before { content: ''; background-image: url("../images/your_logo.png"); ...


0

if you want to remove it from header from checkout page use CSS .checkout-index-index .authentication-wrapper{ display:none; }


0

You can override that file using different ways : 1. Override template and xml file in your custom module : You can add this XML file in your custom module and you can change path like.. app/code/Vendor/Module/view/frontend/layout/sales_email_order_shipment_track.xml Content for this file is : <?xml version="1.0"?> <page xmlns:xsi="http://www....


1

1. Create XML Layout file checkout_index_index.xml in your theme path like below your-theme/Magento_checkout/view/frontend/layout/checkout_index_index.xml 2.Add Below Code in file checkout_index_index.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:...


1

<direct_document_copy>0</direct_document_copy> No any specific reason to set 1 its already worked when set 0 by default is 0 when you set 1 so its perform better <direct_document_copy>1</direct_document_copy> Set 1 it will direct copy data from database, like 'source' and 'destination' databases should be same placed. Database ...


0

The command 'del' or 'rmdir' will remove the recursive directories based on your OS edition. Ref: https://superuser.com/questions/179660/how-to-recursively-delete-directory-from-command-line-in-windows


1

I solved it by override TransportBuilder. It has many private methods that's why I override whole class. You need only this one file. app/code/vendor/module/etc/di.xml <preference for="\Magento\Framework\Mail\Template\TransportBuilder" type="Vendor\Module\Model\Mail\Template\TransportBuilder" /> app/code/vendor/module/model/mail/template/...


0

$porductIds=array(2,6,7); $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection'); $collectionByIds = $productCollection->addAttributeToSelect('*'); $collectionByIds->addFieldToFilter('entity_id', array('in' => $data)); ...


0

app\code\Vendor\Extension\Controller\Index\Sendmail.php <?php use Vendor\Extension\Model\Mail\TransportBuilder; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; class Sendmail extends Action { protected $transportBuilder; public function __construct( Context $context, ...


0

update getSubcategories() function with below <?php namespace Butterfly\Megamenu\Block; class Categorylist extends \Magento\Framework\View\Element\Template { protected $_categoryHelper; protected $categoryFactory; protected $_catalogLayer; protected $_categoryRepository; public function __construct( \Magento\Catalog\Block\...


0

In Magento, $this->sftp->open(); returns null. you can php function is_null() function in the condition. public function execute() { $connection = $this->sftp->open( array( 'host' => 'myhostname', 'username' => 'myusername', 'password' => '...


0

Add xml file in your theme layout customer_account.xml and add that code in xml file <referenceBlock name="customer_account_navigation"> <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-custom-link" after="-" > <arguments> <argument name="label" xsi:type="string" ...


0

You can use below content for you customer_account.xml to add new link there in My Account sidebar section <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" ...


0

Please re-check the store_website table to see whether the website with id 1 exists


0

@Speedingorange - Did you got answer for your query ? I am looking for the same . Kindly share if you have any info about this


0

Static content signing is one of those Magento feature which solve the problem of browser cache on client side, for example if you have changed the css/image on a web page with same url, normally browser will cache it and in order for user to have the updated css/image, they need to clear their browser cache untill it expires. Magento solve this problem by ...


0

@Mohit Kumar Arora Sir, I am using Magento 2.3.0 and I want to add some custom link and want to remove as well but I am unable to do that. Would you please help me??


0

$porductIds=array(2,6,7); $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection'); $collectionByIds = $productCollection->addAttributeToSelect('*'); $collectionByIds->addFieldToFilter('entity_id', array('in' => $data)); ...


1

You can follow this steps - php bin/magento maintenance:enable - cp composer.json composer.json.bak - composer create-project --repository=https://repo.magento.com magento/project-community-edition=2.3.3 temp_dir --no-install - rm -rf update - mv temp_dir/update . - rm -rf temp_dir - composer update - php bin/magento cache:clean - rm -rf var/cache/* - rm -...


1

For Upgrade Magento 2.3.1 to 2.3.3 please follow all below steps. php bin/magento maintenance:enable composer require magento/product-community-edition 2.3.3 --no-update composer update rm -rf var/di var/generation php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento indexer:reindex php bin/...


2

You can update your magento version using following command composer require magento/product-community-edition=2.3.3 --no-update and then composer update after composer update finished run setup:upgrade Ref: Dev docs


0

It is render from vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php there is a function prepareTemplate $transport = [ 'order' => $order, 'billing' => $order->getBillingAddress(), 'payment_html' => $this->getPaymentHtml($order), 'store' => $order->getStore(), '...


0

You can use Magento\Framework\View\Element\Template class to call phtml files if you do not have any Block class otherwise you can use your Block instead of using this default Template element which is highlighted. You can use this in your phtml files to call another phtml file <?php echo $block->getLayout()->createBlock('Magento\Framework\View\...


0

Create a Block in Admin site (like: Identifier is 'table') add HTML tags what u want. Create a file, name is table.phtml app/design/frontend/vendor/Theme/Magento_Catalog/templates/product/view/table.phtml <?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('table')->toHtml(); ?> Then call the file in ...


0

can you try this code it's works for me $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $CategoryLinkRepository = $objectManager->get('\Magento\Catalog\Model\CategoryLinkRepository'); $categoryId = 4; $sku = 'Jacket'; $CategoryLinkRepository->deleteByIds($categoryId,$sku); $categoryIds = [3]; // your category ids Array like [...


0

SELECT entity_id AS "CATEGORY ID", ccev1.value as "CATEGORY NAME", CONCAT(ccev2.value, ".html") AS "CATEGORY PATH" FROM catalog_category_entity AS cce JOIN catalog_category_entity_varchar AS ccev1 USING (entity_id) JOIN catalog_category_entity_varchar AS ccev2 USING (entity_id) JOIN eav_attribute AS ea1 ON ea1.attribute_id = ccev1.attribute_id JOIN ...


1

You are running into CORS issues..This issue is not due to Magento for this you need to make changes in Apache or nginx configuration file. You can contact your server provider for this. Or check below Links which will help you: https://crunchify.com/how-to-fix-access-control-allow-origin-issue-for-your-https-enabled-wordpress-site-and-maxcdn/ https://www....


1

You can use Magento\Framework\View\Element\Template class to call phtml files {{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}} To call advanced form use Magento\CatalogSearch\Block\Advanced\Form block class. {{block class="Magento\CatalogSearch\Block\Advanced\Form" name="block_name" template="...


0

Magento is checking Request safety that can be used to identify if current application request is safe (does not modify state) or not. Magento prevent saving Visitor for safe methods, e.g. GET request It means that for GET request magento is not setting visitor_id in that table. You can check this function in below file. vendor/magento/framework/App/...


0

Change The Deploy mode from Developer To Production using Command php bin/magento deploy:mode:set production


0

The reason your custom-validation.js file was not loading is due to your XML configuration. C:\xampp\htdocs\magento\app\code\Aht\MagentoCheckoutCustom\view\frontend\layout\checkout_index_index.xml In this file you have named your value incorrectly here: <item name="custom-validator" xsi:type="array"> <item name="component" xsi:type="string"&...


0

You can get Category Image using this function $category->getImageUrl() You can use this in your code like.. <?php namespace Butterfly\Megamenu\Block; class Categorylist extends \Magento\Framework\View\Element\Template { protected $_categoryHelper; protected $categoryFactory; protected $_catalogLayer; protected $_categoryRepository; ...


Top 50 recent answers are included