Questions tagged [magento2.2]

General questions about the Magento 2.2.x versions

Filter by
Sorted by
Tagged with
17 votes
6 answers
62k views

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

I am working in magento 2.2.2 and when I save product It will display this error. Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 184320 bytes) in /var/www/html/...
  • 16.7k
8 votes
6 answers
26k views

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

I'm using Magento 2.3.0, with php 7.2 version, on a ubuntu os. Everything looks working fine, but when I try to go into Magento backend, Content - Design/Configuration - Header, and I try to upload ...
  • 1,447
11 votes
6 answers
45k views

Magento 2 - Get Subcategories of Specific Parent Category

What I'd like to do is grab all of the child categories of a specific parent category. I'm assuming the best way to do this is by using the parent's ID and of those child categories that are returned, ...
  • 1,481
24 votes
3 answers
25k views

Magento 2: Implement UI Fileuploader

I recently implemented the FileUploader Ui Component in my form on Magento 2.1.7. The code for it is here (app/code/Vendor/Blog/view/adminhtml/ui_component/vendor_blog_form.xml): <field name="...
  • 355
8 votes
6 answers
24k views

How to change currency format in Magento 2?

Currently, the price shows like $2.999,00 I want the price to show like $2,999.00 for locale es_MX (Spanish, Mexico) in product pages, anywhere else the currency format is correct. I've tried all ...
  • 1,579
4 votes
4 answers
8k views

Magento 2.2 error: Unable to unserialize value

After upgrade to the version 2.2 my modules which has serialized values does not work any more. Here is some info from the Magento 2.2 release notes: Significant enhancements in platform security ...
6 votes
1 answer
7k views

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

This code not working in Magento 2.2, But it's working in Magento 2.1. I am facing this error Notice: unserialize(); Error at offset 0 of 168 bytes in /var/www/html/M2/app/code/Vendor/Module/Block/...
  • 729
2 votes
2 answers
4k views

Load Custom CSS After style-l.css For Home Page

I am using below code to include my custom CSS file in home page only: File: app/design/frontend/[Package]/[Theme]/Magento_Theme/layout/cms_index_index.xml <?xml version="1.0"?> <page xmlns:...
8 votes
1 answer
9k views

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

I am trying to make auto select first child product from the configurable product in product detail page. Is this possible?
  • 1,759
7 votes
1 answer
6k views

LiveReload configuration via Grunt

Edit : about the possible duplicate ! I would like to mention that this answer does not answer my question, if someone sees that it is the same thing, I invite him to answer me instead of saying that ...
  • 11.4k
1 vote
2 answers
179 views

How to add Sort options in back-end grid as shown in pictures?

I want to add extra sort options in backend these options are below All Sizes on top Minimum 1 sizes on top Top Discounted Product (discount percent) Recently bought on top and i have used this code ...
  • 342
10 votes
4 answers
9k views

Add rule to rules.js Magento2

How to add new rule to rules.js? I have created extra-rules.js define( [ 'jquery', 'Magento_Ui/js/lib/validation/validator' ], function ($, validator) { "use strict"; return ...
9 votes
3 answers
42k views

order confirmation email not send in magento 2

I Installed magento 2 on my vps server and configured store email like this but order confitmation email will not send to the customers what should I do , should I setup cron as some link ...
  • 731
4 votes
3 answers
8k views

Magento 2: Apache mod version not enabled/installed/allowed by host, causes 500 error on all pages due to failing .htaccess files

I created a fresh install of Magento 2.2.2 on a debian server using php7.1 and mysql 5.7. Once files were extracted, I was unable to access the setup wizard and received 500 errors from all pages. ...
  • 653
7 votes
3 answers
20k views

Magento 2: Get Customer data after login with observer

I need to detect in frontend section for my custom module if customer has just successfully logged in, and i need to run some function before it redirect to another page, is there any way to do this?
  • 1,484
1 vote
2 answers
183 views

Magento2.4: How to Sort Product by " Best Selling " and " Best reviewed " Product?

I want to add custom sort options like " Best Selling " and " Best reviewed " in Catalog/Category sort order options Below is the picture. and i am trying this approach in below ...
  • 342
1 vote
1 answer
689 views

Magento1 to Magento2 data migration

I am new to Magento2, I need some guidance from magento geeks for migrating data from magento1 to magento2. Quick Overview I received a system that was built in magento2 from scratch. So I think ...
9 votes
2 answers
3k views

Magento 2 .2 - How to add Static Product Prefix to Product Url?

I would like to add a Product Prefix (Static Path) to product URLs. Something like www.test.com/product-prefix/product1.html So all products url of the website follows the same structure - www.test....
  • 9,660
6 votes
6 answers
14k views

Magento 2.2 Cant find how to disable module from back end

I am using Magento 2.2 I can't find a way to disable module. It was use to be under configuration > Admin but it's not there anymore.. Can someone please help me out.thanks
6 votes
1 answer
2k views

How to uncheck "My billing and shipping address are the same" checkbox during checkout? One Page/Magento2

I am having an issue where the box is being marked automatically. I want to unmark it.
  • 496
2 votes
2 answers
2k views

Magento 2: Creating dynamic matrix in new/edit product page

I need to create a custom matrix for every product on Magento 2 product add/edit page. I need to have both the rows and columns to be dynamic so when someone click add button for either row or column ...
  • 458
0 votes
1 answer
55 views

Magento2.4.2: How to display only those payment method options in filter in sales order grid which are enabled on store front?

I want to display only those in this payment method filter drop down which are enabled on store front. if i had 4 payment methos enables on store front then only four options should be shown in this ...
  • 342
11 votes
6 answers
26k views

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

I'm using Magento 2.2 with Porto theme and getting an [object Object] javascript error at customer-data.js line 90 in the console after logging into the store and refreshing the page or switching to ...
  • 2,737
5 votes
1 answer
7k views

Magento 2.2 - adding name field to newsletter module [closed]

I'm using magento 2.2 and I want to add name field for newsletter module, so there has to be input box in front-end, and also it needs to show in backend, how to achieve this? There is a lot of posts ...
8 votes
4 answers
6k views

How to update customer address using custom Api in magento2?

I have created custom API to update customer address using customer id or address id. Below code I used to implement it. [Vendor]/[Module]/etc/webapi.xml <route url="/V1/address/createUpdate" ...
  • 1,759
4 votes
4 answers
2k views

Shipping address custom attribute value not getting in RateRequest object in Carrier Model in magento2.x

I have added the drop-down custom field on checkout page with custom values. InstallSchema.php $connection->addColumn( $installer->getTable('quote_address'), '...
16 votes
2 answers
5k views

Magento 2.2.x cache disabled automatically

First of all, I couldn't find any info about this kind of issue anywhere on the web. We have a production environment with git integration. We pull our changes to it only via git (git pull). The ...
  • 489
6 votes
1 answer
1k views

Upgrade Magento from 2.1 to 2.2.1 with sample data using composer

What steps do I need to follow to upgrade a demo installation with sample data from Magento 2.1 to the latest 2.2 version? Instructions that work for Magento Commerce (Enterprise Edition) as well as ...
3 votes
3 answers
2k views

How to disable a swatch, once it is been selected in Magento2.2?

I am trying to disable a swatch, once after it has been selected. So it should not be deselected... How to do it in Magento2.2.x ?
3 votes
1 answer
1k views

Magento 2.2.0 Upgrade error

When I am trying to upgrade my Magento version from 2.1.7 CE to 2.2.0 CE, through composer update, I am getting the following error. Problem 1 - magento/module-wishlist-sample-data 100.1.0-rc1 ...
  • 1,479
12 votes
2 answers
28k views

Magento 2: How to get current language of store?

I'm trying to show a custom block for each store view / language. Therefore I want to create switch statement like: $lang = // Get language code or store view code here; switch ($lang) { case '...
  • 442
4 votes
1 answer
3k views

Confirmation popup before removing item from cart

When i remove item from cart i get a poup confirmation: require([ 'jquery' ], function($) { $('.action-delete').off('click'); $('.action-delete').click(...
  • 43
3 votes
3 answers
5k views

Sales : Orders :How to add custom order status programmatically

I need to add custom status for an order programatically I have below controller file to save order status. I need to add custom status as cancel initiated.Provide me a solution... Controller file ...
  • 2,418
2 votes
2 answers
323 views

Magento 2.2.3 - Add custom required validation for company

I want to add validation only for billing address on the checkout page. By default in the backend, the company name is optional. But if when I go to the checkout page and click on the Place Order ...
7 votes
3 answers
7k views

How to change City field to a dropdown in Checkout step Magento 2

I tried multiple solutions found in here, but none seem to fit, the closest one was this one Magento 2 : How to change UI field(s) dynamically, here is my implementation of it: My\Module\view\...
4 votes
3 answers
5k views

Add placeholder and remove all labels in Magento 2 Checkout

Searched a lot but didn't found anything removing the Lables like "First Name, Last Name, City, Address, Email, Phone etc" Add Placeholders in all "shipping fields" and "sign In" places. After ...
  • 433
3 votes
2 answers
2k views

Magento 2: Uncaught TypeError: Cannot read property 'items' of null for restricted permission user

Note: This is not a duplicate of any similar error I have found a strange bug in Magento 2. It shows the following error in the browser's console for only restricted admin user (the user which has ...
3 votes
2 answers
3k views

Change the background color of the catalog product view page?

Which file should I edit in my custom theme to change the background color and any other CSS of the catalog product view page?
2 votes
3 answers
5k views

Get recently viewed products programmatically in Magento 2.2.2

I am trying to fetch recently viewed products. I tried to implement the provided code from here but did not get any success.
  • 837
2 votes
1 answer
2k views

Magento 2: how to hide ''price' of custom option in configurable product

Using Magento 2, Front, Configuration Product. I need to hide price from custom option of configuration product. Front -> Product Option
16 votes
4 answers
12k views

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

One of the indexers that are configured to be updated on schedule is locked in the state "suspended" and does not get updated anymore. Output of bin/magento indexer:status +-------------------------...
8 votes
1 answer
2k views

Run static tests for a specific module

I am running php bin/magento dev:tests:run static to check my code quality but it takes a really long time. Is there a way I can run them for one module and/or one theme?
  • 196k
8 votes
2 answers
10k views

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

I have created a InStock column in admin grid and table. In table, Instock column values are 0 (or) 1 based on productstock. In admin grid, the Instock column values are dispalyed 0 (or)1 . But i ...
  • 2,510
9 votes
5 answers
11k views

app:config:dump locks everything in configuration

I am using pipeline deployment. As suggested in Magento 2.2 documentation, to use pipeline deployment process use below code: app:config:dump and add config.php to source control. But when i ...
2 votes
2 answers
2k views

Hide price for guest users

How to hide price for guest user with plugin functionality in product pages and category pages?
4 votes
3 answers
5k views

How to add custom block in admin order create form in magento 2.2.5

I need to add custom block after order comment section in admin order create form using version(magento2.2.5)
  • 2,510
4 votes
6 answers
6k views

How to get customer custom attribute value in observer in magento 2.2.X?

I have created a customer custom attribute like(gst_no). In my Observer where I get my customer data I want to get the value of this attribute too. $order = $observer->getEvent()->getOrder(); $...
  • 3,161
3 votes
2 answers
6k views

Php max_input_vars prevents attribute options saving in M2

Magento 2.2.1. PHP 7.0.26 Nginx After 2 days struggling around with attribute options in M2, I found out where the problem was. I have several custom dropdown attributes with hundreds of options. I ...
  • 504
3 votes
2 answers
4k views

Magento 2 - How to get the simple product Sku from the option selected of a configurable product

As I asked in the question I want to get the SKU of a simple product selected by the option in configurable product details page. How can I capture the SKU? Tried in this way, but not possible to ...
  • 2,609
3 votes
3 answers
3k views

I want to override vendor\magento\module-email\Model\AbstractTemplate.php

I want to override method setForcedArea() because I'm using Magento 2.2.4 & whenever I tried to save Content->Configration->Design Configuration->Edit I'm getting following error:- ...

1
2 3 4 5