51 votes
Accepted

Magento 2.2.2 : Allowed memory size of 792723456 bytes exhausted (tried to allocate 184320 bytes)

Try following commands: php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento setup:di:compile php bin/magento cache:flush php bin/magento cache:clean //To run ...
user avatar
  • 3,764
48 votes
Accepted

Magento 2 customer-data.js:90:23 [object Object]

I have literally wasted a few days trying to debug this issue and finally got a definite solution or work around I would call it. Hopefully it can save a few other people the headache I currently have!...
user avatar
  • 863
46 votes
Accepted

Magento 2: Implement UI Fileuploader

I follow this steps to add UI fileuploader component in admin form I use UI fileuploader component to upload an icon for my FAQ extension. You can take reference from here: https://github.com/...
user avatar
  • 21.7k
37 votes

UI form validation in Magento 2

Read More: https://mageprince.com/blog/how-to-validate-forms-in-magento-2/ You can use validate-digits for validating number <item name="validation" xsi:type="array"> <item name="...
user avatar
  • 21.7k
37 votes
Accepted

Magento 2.2 Incompatible argument type

$connection need to be an instance of \Magento\Framework\DB\Adapter\AdapterInterface, so update your __contruct() like this public function __construct( ... \Magento\Framework\DB\Adapter\...
user avatar
  • 1,688
33 votes
Accepted

Magento 2.3.0 "A technical problem with the server created an error." When uploading the logo image

This is the bug in the Magento 2.3 version, but you can fix the issue by the change in the below code. Go to this file: /vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml ...
user avatar
  • 5,244
30 votes
Accepted

Magento2.1 ui grid, remove or clear filter issue (after removing filter, result row apply to whole collection)

Just to add to the previous solution by Tony Bartiloro. The specific fix is to add the 'storageConfig' item. If this is missing you will see the issue where row data is duplicated. <item name="...
user avatar
  • 984
25 votes

Notice: unserialize(); Error at offset in Magento 2.2

Read More: blog.mageprince.com Inject \Magento\Framework\Serialize\Serializer\Json class for serialize and unserialize values. protected $serialize; public function __construct( ... \Magento\...
user avatar
  • 21.7k
25 votes
Accepted

Add rule to rules.js Magento2

Here is a full and real working example to add a custom rule to checkout input field for checking minimum age: Create a requirejs-config.js in your module to add a mixing to the validator object to ...
user avatar
25 votes
Accepted

How to display Yes/No values in admin grid (Magento2)?

Method 1: If you have boolean value 0 and 1 use default option class Magento\Config\Model\Config\Source\Yesno app/code/Vendor/Theme/view/adminhtml/ui_component/your_ui_grid.xml <column name="...
user avatar
  • 21.7k
24 votes
Accepted

How to make auto select first child product of configurable product in magento2?

For Dropdown: Override this file to your theme: vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js your theme file location will be: app/design/frontend/[vendor]/[...
user avatar
22 votes
Accepted

Sales orders is not displayed in admin panel in grid of Magento2.2.0?

Disable Asynchronous indexing under Store > Configuration > Advance > Developer > Grid Settings Clear cache (optional reindexing) or set up a cron job.
user avatar
  • 742
21 votes
Accepted

How to change listing per page option?

Go to admin Store > Configuration > Catalog > Storefront Now there are two things Products per Page on Grid Allowed Values Enter your desired no here with comma like 12,24,48,96 Products ...
user avatar
  • 5,719
21 votes
Accepted

When it is good to use viewModel ? What is difference between viewModel and Block?

Magento veteran Jessie has a well famous blog on viewModel which you can find it here. It answers your question at the end. It says: When to use ViewModels? When would you want to use ...
user avatar
20 votes

Magento 2 - Get Subcategories of Specific Parent Category

Check below example to list of all subcategories of specific parent category using parent category ID using the repository. First of all add CategoryRepository in construct: <?php protected $...
user avatar
  • 5,244
19 votes
Accepted

Magento 2: Get Customer data after login with observer

Use customer_login event observer for customer login action 1) Create events.xml app/code/Vendor/Module/etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
user avatar
  • 21.7k
19 votes
Accepted

Magento 2 form field toggled type

This is checkbox form field. Which is included in UI Component library. You cannot use this toggle in $fieldset->addField(). You need to create a form with UI component to create this type of ...
user avatar
  • 21.7k
18 votes

Magento2.1 ui grid, remove or clear filter issue (after removing filter, result row apply to whole collection)

i had same issue and I resolve with this code in ui_component xml: <dataSource name="storelocator_store_listing_data_source"> <argument name="dataProvider" xsi:type="configurableObject"&...
user avatar
18 votes

Magento 2 - Get Subcategories of Specific Parent Category

You need to add a dependency to your class \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory. Like this: protected $categoryCollectionFactory; public function __construct( ... \...
user avatar
  • 196k
18 votes
Accepted

LiveReload configuration via Grunt

It's been two days since the post is open and no one has found the answer to my question, and working hard on this topic I finally found the solution. So I decided to publish the complete solution, ...
user avatar
  • 11.4k
18 votes
Accepted

Hide Configurable product images from details page when color swatch is selected

Try to use etc/view.xml file in your theme, with this configuration: <vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">replace</var> </vars> ...
user avatar
  • 681
18 votes
Accepted

Magento 2.2.x cache disabled automatically

This looks like a known issue: This does happen from time to time on the project I'm working on, but I wasn't able to find the steps to reproduce. All I can say is that it happens during a deployment ...
user avatar
  • 196k
17 votes

order confirmation email not send in magento 2

If you have properly configured Magento 2 mailing systems, you may need to check below point: Got to Stores -> Configuration -> Advanced -> System Under Mail Sending Settings make sure ...
user avatar
17 votes
Accepted

How to change currency format in Magento 2?

create just simple module and overrider default *Format.php** file, app/code/Package/Modulename/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
user avatar
17 votes
Accepted

What does "canRestore" attribute mean in system.xml?

You can show Use system value check-box to system configuration by canRestore="1" property in system.xml
user avatar
16 votes
Accepted

Magento 2: How to get current language of store?

You can use \Magento\Store\Api\Data\StoreInterface or Magento\Framework\Locale\Resolver class to get store language. BY USING \Magento\Store\Api\Data\StoreInterface CLASS With Dependency Injection ...
user avatar
  • 21.7k
16 votes

Magento 2: setdata() is not saving the values into the database

Hi guys thanks for the support. Finally i found the solution after searching many sites. In default Magento will try to update the database not insertion when we trying to save the data with the ...
user avatar
15 votes

How to solve indexer status "suspended" (n in backlog)

I found out, that the status is set in \Magento\Framework\Mview\View::suspend() and removed in \Magento\Framework\Mview\View::resume(). These methods are only called in \Magento\Indexer\Model\Indexer:...
user avatar
14 votes
Accepted

Magento2: What is the difference between Magento 2.2 and 2.3?

Feature wise difference between Magento 2.2 and Magento 2.3 Declarative DB Schema Magento 2.3 introduces a new approach – declarative database schema, allowing developers to define database ...
user avatar
13 votes
Accepted

Magento 2.2 is not working in PHP 7.2.0

Unfortunately no, PHP 7.2 is not officially supported yet. You can see below list and information from Magento dev docs about the system requirements. 1. Magento 2.2.x supports PHP Versions below: 7....
user avatar
  • 5,245

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