Hot answers tagged

4

i solve my marge issue as First Way: For CSS you need to do something similar to manually enable it. The following has worked for me: php bin/magento config:set dev/css/merge_css_files 1 php bin/magento config:set dev/css/minify_files 1 php bin/magento config:set dev/js/merge_files 1 php bin/magento config:set dev/js/minify_files 1 Another Way: ...


3

From Magento 2.3 you can use like following UPDATE admin_user SET password = CONCAT(SHA2('[salt]NewPassword', 256), ':[salt]:1') WHERE username = 'admin'; And for salt you can get it from the app/etc/env.php 'crypt' => [ 'key' => 'f6fcdcc54d85d8a2f2a87a2ae0a062e9' ], OR If you are emails are working use the forget password option in the admin ...


3

To enable a "payment method" only for admin can you please refer the below link Magento2: How to add a payment method to admin create order? https://blog.e-zest.com/making-payment-method-visible-only-for-admin-in-magento-2 It's worked for me, Try the below one app/code/Gta/AdminPay/registration.php <?php \Magento\Framework\Component\...


2

There are 2 possible causes of this error: PHP Max_input_vars value is not optimized for Magento 2 In most cases, we can solve the error by increase the value of PHP Max_input_vars to the value that Magento 2 requires. Open PHP.ini and change these values max_input_time : 3600 max_input_vars : 100000 memory_limit : 2G Base URL on Localhost not regconize by ...


2

There is a backend URL builder that backend controllers utilize. Excerpt from abstract backend controller: <?php namespace Magento\Backend\App; abstract class AbstractAction extends \Magento\Framework\App\Action\Action { /** * @param \Magento\Backend\App\Action\Context $context */ public function __construct(Action\Context $context) ...


2

After Magento 2.2 you can add a searchable dropdown using the below code. <field name="category" sortOrder="50" formElement="select"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">Namespace\Modulename\Model\Source\Category</...


2

You can create events.xml file here in your module app/code/Vendor\Module/etc/events.xml Content for this file is.. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="backend_auth_user_login_success"> &...


2

There are two cases of the cookie configuration that could be obstructing the session functionality. The domain of the cookie does not match, or the protocol (ssl or not) here is what it looks a request where the cookie is set as "secure" but its not using an http ssl url: to fix them both you just have to run following: DELETE FROM ...


2

If you do not have an active subscription to Business Intelligence service id recommend running the following in the CLI bin/magento config:set analytics/subscription/enabled 0 bin/magento cache:clean This should stop that error from happening again


2

If you need a payment option that is only available internally (admin area), we created an extension for that https://github.com/customgento/module-admin-payment-m2.


2

Please create one file named "user.php" in your root of magento and copy paste below code in your file <?php use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); ...


2

Magento uses the file called view.xml which is maintained at the theme level of the application. So for example, if you are using the default theme luma you should find the view.xml under vendor/magento/theme-frontend-luma/etc/view.xml In this file, you would see <images/> node inside the node. <view xmlns:xsi="http://www.w3.org/2001/XMLSchema-...


1

You need to enable it providing your key. Admin panel Store -> Configuration -> Advanced -> System Tab. Now Click on Adobe stock Integration Section, Enable Adobe Stock to Yes. Add API Key (Client ID) and Client Secret text field value from the Adobe Integration. Save Config to save changes. Reference here.


1

For making a call on product save you can create a plugin to call it on product save. For that, you have to add code in etc/adminhtml/di.xml <type name="Magento\Catalog\Controller\Adminhtml\Product\Save"> <plugin name="supplier_plugin_product_save_after" type="Vendor\Module\Plugin\Adminhtml\ProductSave" sortOrder=&...


1

There is no meaning to add required for the boolean typ. bcz if it is required then it's value always becomes 1. so is_required should be 0. Use the backend model: Magento\Customer\Model\Attribute\Backend\Data\Boolean Use the backend Type: static, or try with varchar. maybe this will help you to make your attribute workable.


1

Not a complete answer but you might find useful. Use this snippet to find all extensions with cacheable="false" find vendor app -regextype 'egrep' -type f -regex '.*/layout/.*\.xml' -not -regex '.*(vendor/magento/|/checkout_|/catalogsearch_result_|/dotmailer).*' | xargs grep --color -n -e 'cacheable="false"' If you've got a lot of these ...


1

I have temporarily fixed it by changing in magento core Gd2.php file line no 96 by adding one more if condition private function validateURLScheme(string $filename) : bool { $allowed_schemes = ['ftp', 'ftps', 'http', 'https']; $url = parse_url($filename); if ($url && isset($url['scheme']) && !in_array($url['scheme'...


1

I have done this with the plugin and it is the easiest and fastest way to do this. Define Plugin in di.xml <!-- add admin name in comment --> <type name="Magento\Sales\Model\Order"> <plugin name="AddAdminNameToComment" type="Tecksky\Custom\Plugin\Sales\Model\Order" sortOrder="1" /> </type> ...


1

I met the same error and figured out that it lost the tab tag in app/code/CompanyName/ExtensionName/etc/adminhtml/system.xml. For example, you have to add <tab id="amasty" translate="label" sortOrder="999999" class="amasty-tab ambase-tab-container"> <label>Amasty Extensions</label> </tab> ...


1

in your block template, you may create a hidden field (see /vendor/magento/module-catalog/view/adminhtml/templates/catalog/category/edit/assign_products.phtml for an example of what I mean) then, very much like this template above shows, add a javascript snippet that may behave similarly to /vendor/magento/module-catalog/view/adminhtml/web/catalog/category/...


1

You need to do some changes and corrections. Edit view/adminhtml/ui_component/xigen_announce_group_form.xml file and put some extra code under announce_group_edit_tab_message as per below. <block class="Xigen\Announce\Block\Adminhtml\Group\Edit\Tab\Tab" name="announce_group_edit_tab_message" template="Xigen_Announce::tab/message.phtml"> &...


1

I got this problem as well, because of a missing category attribute in the eav_attribute table. Try to run the query below. And if you are missing this attribute, you might be missing other attributes as well. Please compare the eav_attribute table in a new Magento 2 installation with your own to see if you are missing something. INSERT INTO `eav_attribute` (...


1

I'm having a similar problem after updating from 2.3.4 to 2.3.4-p2, in my case, Custom Layout Update is empty. The patch_list table does not contain Magento \ Catalog \ Setup \ Patch \ Data \ UpdateCustomLayoutAttributes, so I ran setup: upgrade but the table has not been updated and Custom Layout Update is still empty. Any idea?


1

First of all, check if you have the sodium ext in your PHP using the command below. php -i | grep -i libsodium I had the same issue accessing the admin panel even with the Sodium extension installed, I solved it recreating the admin user using Magerun: wget https://files.magerun.net/n98-magerun2.phar && chmod +x ./n98-magerun2.phar && alias ...


1

I know this post is old, but decided to add my findings of a working solution, after spending hours looking at this. First off, I had to try and understand the concepts of Magento's UI components and find a simple way to achieve this, without writing additional classes and data models. Here is some good reading material if anyone is interested: https://...


1

You can override getMeta() function in your DataProvider class public function getMeta() { $meta = parent::getMeta(); $id = $this->request->getParam('entity_id'); if(isset($id)){ $meta['fieldset_name']['arguments']['data']['config']['visible'] = 1; } else{ $meta['fieldset_name']['...


1

I just fixed it by using mentioned below steps Store param value in session in controller public function execute() { $this->_catalogSession->setTokenId($this->request->getParam('entity_id')); $this->_view->loadLayout(); $this->_view->loadLayoutUpdates(); $this->_view->getPage()->getConfig()->getTitle()->set(__('Redeem ...


1

Try to change the search engine value in the admin configuration by following the below steps Choose Stores-> Configuration -> Catalog -> Catalog Search Choose MYSQL value in the Search Engine dropdown Save config and flush cache


1

tray this in your database INSERT INTO cataloginventory_stock(stock_id,website_id,stock_name) VALUES (1,0,'Default');


1

Just remove the generated folder. In the magento root directory run this rm -rf generated/*


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