Hot answers tagged

23

You need to perfact solution please edit below function on line no 96 follow this- vendor\magento\framework\Image\Adapter\Gd2.php-- private function validateURLScheme(string $filename) : bool { $allowed_schemes = ['ftp', 'ftps', 'http', 'https']; $url = parse_url($filename); if ($url && isset($url['scheme']) && !in_array($...


7

Here is my answer, i hope it will help someone: First make sure that this package is installed via composer: cweagans/composer-patches Lets say you want to apply a patch from a third-party module installed via composer for a controller. Please make sure that you have this part in the composer.json file: "extra": { "magento-force": ...


7

The answer is yes.You can disable module Magento_Amqp. Magento have mechanism asynchronous that avoid many heavy task (export file, indexing table..) execute in same time. Just imagine in back-end,you have multiple admin user export products into csv file in the same time. It will really make your server stressful. So mechanism asynchronous allow when admin ...


5

I keep bumping in this so I read up a bit more and now feel there is a need for better answers Solutions that tell you to do cron_run = 'false" will disable other queues you do want, like bulk attribute update or export file generation. Option 1 disable package php bin/magento module:disable Magento_WebapiAsync php bin/magento module:disable ...


4

In this case, I was accessing the wrong route, rather than /adminurl/vendor_module/store/ which caused the error message about an invalid key, I needed to go to /adminurl/vendor_module/store/index/. I still think Magento should return a 404 or some other error message that would be much more helpful to debug but in this case that was all I did wrong.


4

IMHO, the way I see it is this: app/code wild-guess PROs: possibly a leaner/ easier learning curve for juniors. But wouldn't recommend this, even if the person learning Magento is a beginner, they should go from day 1 with learning what composer is, play with it, then go and write Magento code. possibly easier to find your code in the project - again for ...


3

remove the constructor method from your class. You don't need it if the only thing it does is to call the parent constructor.


3

By design, ScandiPWA uses GraphQL for communication with BE. This however, does not mean you MUST. It is 100% legit to reuse existing REST API available. Yes, it is bad for consistency. But when your going for something which will simply work - it okey. The frontend, however is required to be made in React. Yes, you can still use simple di.xml to bypass ...


3

Check This Steps Step-1 : First you need to check your module is enable or not. Step-2 : You need to check are you working on right magento url or not. Step-3 : Check your Route name in routes.xml app\code\VendoreName\ModuleName\etc\frontend <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...


3

Try this Add form key in your form <input name="form_key" type="hidden" value="<?php echo $block->getFormKey();?>"> To get the controller url. $this->getUrl(" ");


2

This error message is also shown if your app/etc/config.php is missing. If app/etc/env.php is present and you are still seeing this issue, check for app/etc/config.php. If it is not present, Magento can create it by running php bin/magento module:enable --all. This will recreate the file. Then, try running php bin/magento setup:upgrade again. And More ...


2

Did you already checked the Release Notes of 2.3.5? In the Known Issues section it is stating the following: Issue: Magento 2.3.5 does not support upgrading using the Web Setup Wizard from deployments running Magento 2.3.3 or earlier without first manually updating dependencies for magento/updater. You can upgrade using the Web Setup Wizard without ...


2

It is optional yes. Message queuing allows different components to communicate by sending messages to each other. The message queue provides temporary message storage when the destination component is busy or not responding. Although remove it via composer https://github.com/yireo/magento2-replace-core/blob/magento-2.3.2/composer.json "magento/module-...


2

Ok, take a look here: vendor/magento/module-shipping/Model/Rate/Result.php There is function sortRatesByPrice(); This foreach puts all in array for sorting: foreach ($this->_rates as $i => $rate) { $tmp[$i] = $rate->getPrice(); } If you change this $rate->getPrice() to $rate->getMethodTitle() it will sort by method title, ...


2

You can use the rest webservice: http://yoursite.com/index.php/rest/V1/orders On the body you just have to pass: { "entity": { "entity_id": your order id, "state": your state, "status": your status } } Don't forget to also include in the http header the following fields: Content-...


2

You can use this code in a phtml or php file and it will log the dump of $order->debug() in var/log/payment-method.log $logger = new \Zend\Log\Logger(); $logger->addWriter(new \Zend\Log\Writer\Stream(BP.'/var/log/payment-method.log')); $logger->debug(print_r($order->debug(),1));


2

Create Controller File at Vendor\Extension\Controller\Index\Index.php <?php namespace Vendor\Extension\Controller\Index; use Magento\Framework\App\Action\Context; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\Action\Action; class Index extends Action {     protected $resultPageFactory;          public function __construct(       ...


2

You can take help from here. Magento 2.2 - adding name field to newsletter module In this solution they are adding FirstName and LastName to newsletter form, you should replace them with "First Name" and "country" fields at every occurrence.


2

Fixed! I added this in installData.php protected $state; \Magento\Framework\App\State $appState in __construct params $this->state = $appState; And below code in start of install() function: try{ $this->state->getAreaCode(); } catch (\Magento\Framework\Exception\LocalizedException $ex) { $this->state->setAreaCode('...


2

You can display a discount price in minicart by setting customer group price from admin. Catalog -> Products -> Select and edit your product Click on Advanced Pricing and set customer group price as attached image. It will display the discount price of products in minicart. Hope it will help you!


1

You can put icon/images at: app/code/VENDOR/MODULE/view/frontend/web/images to access those image in template, You can use: <img src="<?php echo $this->getViewFileUrl('VENDOR_MODULE::images/icon.png'); ?>"> Hope above will help!


1

Magento_Amqp :- Magento_Amqp module provides functionality to publish/consume messages with the Advanced Message Queuing Protocol (AMQP). And more information read this link :- https://devdocs.magento.com/guides/v2.3/mrg/ce/Amqp.html If you don't want to use the Magento Message Queues, you can just disable it. php bin/magento module:disable ...


1

A bit of a stab in the dark but I have had strange issues in my installation until I started running composer starting with a call to a PHP executable and passing a memory limit. In my case: /usr/local/bin/ea-php72 -d memory_limit=3G [full path to your composer executable] Alas I haven't figured out how to edit the magento configs so the internal ...


1

Did you check you PHP Version ? (php -v). According to dev docs : Supported PHP versions: ~7.2.0 ~7.3.0 According to my experience, you should never use the last PHP version : the penultimate is always more stable than the last, so try PHP ~7.2.0.


1

The difference between modules and extensions is summarised well here: https://stackoverflow.com/a/2183909/7823264


1

the layout file will have name as format: {router_id}_{controller_name}_{action_name}.xml. You can understand the layout in detail in this Magento topic , and the instruction of a layout structure. When rendering page, Magento will check the layout file to find the handle for the page and then load Block and Template. We will create a layout handle file ...


1

Change the layout from mymodule_index_index.xml to myurl_index_index.xml.


1

Magento Inventory (MSI) documentation Source Management - https://docs.magento.com/m2/ce/user_guide/catalog/inventory-sources.html Stock to Source assignment - https://docs.magento.com/m2/ce/user_guide/catalog/inventory-about-sources-stocks.html Reservations - https://devdocs.magento.com/guides/v2.3/inventory/reservations.html https://docs.magento.com/m2/...


1

For that you will have to override customer_account_create.xml in your own module. So create "customer_account_create.xml" file in app\code\Your_module_vendor\Your_module_name\view\frontend\layout\customer_account_create.xml And add below code into it. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="...


1

File is checkout_cart_index.xml You Can place your custom image after page.main.title


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