Questions tagged [magento2]
General questions about Magento 2, not specific to a minor version. Use this tag to distinguish from Magento 1. If you have issues with a specific version, please use the appropriate 'Magento-2.x' tag instead. Functionalities between Magento 2 minor versions might differ.
19,730
questions with no upvoted or accepted answers
5
votes
1answer
271 views
magento2 add credit memo for invoice with items
I am trying to add partial credit memo programatically but it is consuming whole quantity in first credit memo, How can I pass specific items to credit memo?
public function createCreditMemo ($...
5
votes
1answer
196 views
How to Add customized error message in magento 2 admin form
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">My Custom Filed</item>
<item name="dataType" xsi:type="string">text</item&...
5
votes
1answer
693 views
Injecting and calling custom knockout component in another component
I am using 2 components for multi-select and select input fields.
Multiselect component -
define([
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/multiselect',
'Magento_Ui/...
5
votes
0answers
83 views
StoreRepository get($code) which does not exists
Till today all the code was okay, but after code review, I got that we use the method
load() on the store itself so I replaced it with
storeRepository->get($code)
Code what I'm talking about ...
5
votes
0answers
107 views
Magento 2 icon font position problem (navigation menu)
Magento2 - I am trying to put some icons in my navigation menu, I want them to be on top of the subcategory name but this is what I have until now:
This is my code for the first item, I have it in >...
5
votes
0answers
690 views
Undefined index: websites in ..module-config/App/Config/Type/System.php
After trying to update from 2.2.5 to 2.2.6 I ran into an error message that it could not write to one of my files and thus needing to do a rollback on some of my backups. For some reason, I cannot ...
5
votes
1answer
167 views
Problem with CLI
Hello i have an error of every command i press in CLI.
Following this Error
Deprecated Functionality: The each() function is deprecated. This
message will be suppressed on further calls in
/var/...
5
votes
0answers
395 views
Magento 2 : Display Loader While Ajax call on Column row action?
Grid xml column:
<column name="actions" class="My\Test\Ui\Component\Listing\Columns\Feeds\AdvancedActions>
<argument name="data" xsi:type="array>
...
5
votes
0answers
128 views
How to configure MFTF in Jenkins
In magento2 - Is it possible to configure continuous integration like Jenkins with Magento Functional Test Framework ?
We are using bitbucket for our private repositories and Allure for reporting. ...
5
votes
2answers
676 views
Magento 2: Get Admin User Details By Token Rest API
I want to get admin user details by providing a token via HTTP header. How could I retrieve admin user details of this on Rest API.
5
votes
0answers
314 views
Magento 2 Content Staging Dashboard
I am using Magento 2.2.3. As you know we can see the promotion rules status at Content -> Dashboard.
But when I delete some promotion rules it is still showing in the dashboard. I have cleared the ...
5
votes
0answers
1k views
How can I pass a URL parameter to admin grid data provider?
I have a custom admin grid, which lists only the orders that contain the product given as a URL parameter.
My URL is of form https://www.example.com/admin/mymodule/orders/index/product_id/123/
I ...
5
votes
0answers
234 views
Magento2 : How to set filter for an insert listing component while loading edit view form
I want to display all contacts of a supplier on the supplier edit page.
For this, I use an insert listing component and I include the contact grid in a field set.
How can I use the supplier_id to ...
5
votes
3answers
2k views
$block->getViewModel() returning NULL
I am overriding the layout and adding ViewModel in that layout but when I try to fetch the ViewModel getting below error
PHP Fatal error: Uncaught Error: Call to a member function getCodes() on ...
5
votes
0answers
1k views
How to create admin user for specific store in magento2?
I have a multi-store website which runs over different domains. I have also a multi-admin user. Now I need to set them for specific stores.
Basically I need admin user who can access data of only of ...
5
votes
0answers
532 views
Magento2 - Sale order grid column “Grand Total (Base)”,“Grand Total (Purchased)” display default website currency not store or website currency
I have a multi website store. Each website i have added a base currency and set display currency(both are same). But in the backend sales order grid view for all the orders "Grand total(base)" and "...
5
votes
1answer
675 views
Load Page Without Cache, Without Flushing The Cache in Magento 2
I am just curious to know if we can execute the page without cache, without flushing the actual cache like other framework do eg :
in Symfony if we add /app_dev.php in URL, it load the respective ...
5
votes
0answers
608 views
Multi-shipping depending on specific product attribute
I have been struggling hard from a few days to find out a way for multi shipping of products depending on product type (type is not magento's type where as it is custom attribute i.e type can be ...
5
votes
0answers
265 views
How to migrate WooCommerce to Magento 2?
I would like to migrate all data as possible to my Magento 2, I wish a module, code snippet or step-by-step tutorial.
It will be very useful, thank you!
5
votes
1answer
2k views
Magento 2 - Unable to resolve the source file for image
I have created an image and have uploaded this to my theme/web/images folder. I have then ran the following:
php bin/magento setup:static-content:deploy
However I cannot get the image to show on ...
5
votes
0answers
1k views
Magento 2 -Override tax functionality to calculate tax on cost instead of price
I have checked below mentioned files to override tax functionality:
\vendor\magento\module-tax\Model\Sales\Total\Quote\Tax.php
\vendor\magento\module-tax\Model\Sales\Total\Quote\CommonTaxCollector....
5
votes
0answers
402 views
Magento2 : How to set custom meta title & meta description by observer?
I want to set meta title , description by the help of observer.
But unable to set data here.
please see my code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_page_config = $...
5
votes
1answer
967 views
Pass data to child template in cart-items of checkout page
My site is a market place site where vendors(sellers can sell their product).
Now i want to customize the to group items in cart by each vendor like this:
http://prntscr.com/hmsam6
...
5
votes
1answer
1k views
how to display different description for each virtual product which was create with configurable products?
In Magento 2 , when we create configurable product its child product also created, we can provide different description for child products too.
> 1. How to access description of each child product ...
5
votes
2answers
2k views
Magento 2 Ajax pagination for grid on front end
On custom tab of product detail page on front end i have added a table and used Pager for pagination.
Magento\Theme\Block\Html\Pager
But this reloads the entire page when pagination is used. I don'...
5
votes
1answer
2k views
Adding products to cart programmatically with custom price in controller: Magento 2
I am having a module that is creating quotes using the Magento quote module.
It is using the \Magento\Quote\Model\QuoteFactory for creating the quotes.
Now I have added a button "Proceed to ...
5
votes
0answers
541 views
Magento 2: How to override cacheable=“false” in layout in your own theme
We use a third party extension wich lets us add bundles with specific discounts to product pages. The problem is that they added a default.xml with the following code:
<block class="Magedelight\...
5
votes
1answer
3k views
Magento 2.2.0 - Upgrade / Migrate from Magento 2.1.9 to Magento 2.2.0 with Sample Data
Followed below commands to upgrade Magento 2.1.9 to 2.2.0 using terminal
1.
composer require magento/product-community-edition 2.2.0 --no-update
2.
composer require \
magento/module-bundle-...
5
votes
0answers
1k views
How to show a category to a specific customer group magento 2?
Hi my question is how to show particular category products to particular customer group or Business customers. Actually I want to show additional products to only business customer when he gets logged ...
5
votes
1answer
429 views
Flat rate still showing after disabled
Magento 2.1.4 : Disabled flat rate via store > configuration > sales > shipping method like this:
I have already deleted the cache, upgrade, static content deploy but it keeps showing the flat rate ...
5
votes
1answer
1k views
I need to add a extra field in product rest api response - Magento 2
I want to add a field "slider" in /rest/V1/products/:sku
I created a custom module and in my di.xml i have added the following code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3....
5
votes
0answers
221 views
How to get custom table values into front-end checkout address section in Magento 2
For custom requirement, we are saving few values in our custom table with customer id and address id. We are trying to display those values in the checkout page address section based customer,address ...
5
votes
2answers
2k views
Magento2: How to add separate css file on each cms page?
Is it possible to add individual CSS file on each cms page? Upon researching, I can do it by adding code on Layout update XML.
Unfortunately, it isn't working. Here's my code:
<head>
<...
5
votes
0answers
778 views
Magento 2 : How can I add discount to a custom option
I have a product with custom options and a catalog price rule (that applies to a certain customer group). When your in this customer group (group X), you get a discount of 15%.
This works for the ...
5
votes
0answers
169 views
Add product stock information to product repository
When working with the ProductRepository in Magento 2 and the results of the getList method what is the "best" way to add extra information to the results?
For example in the default 2.1.7 setup you ...
5
votes
3answers
6k views
How to get item id from quote item collection in Magento 2?
I am trying to get all item ids currently added in cart.
Here is what I have done so far.
public function __construct(
\Magento\Checkout\Model\Cart $cart
) {
$this->_cart = $cart;
}
...
5
votes
0answers
282 views
what populates data in cataloginventory_stock_status table and from which table
In magento2 - I would like to understand what populates data in cataloginventory_stock_status table and from which table the data is transferred in this table. I tried searching in ...
5
votes
2answers
964 views
Cron error extension - Magento2
I have an error while trying to install Magento extension.
The Error:
Error from Setup Application Cron Script: Cron job has not been
configured yet Other checks will fail as a result (PHP ...
5
votes
1answer
581 views
Migration from Magento 1.x EE to Magento 2.1.x CE
I have a project on Magento 1.14.3.1 EE and meed to migrate it to Magento 2.1.5 CE to test out the performance improvement the Magento 2.1.x version has to offer.
I was hoping to use the Magento's ...
5
votes
0answers
599 views
Magento 2: Image upload in product review from Frontend
It would be very helpful if someone can guide me, How to achieve functionality of uploading image while product review on frontend.
I want to implement the functionality, the users can upload images ...
5
votes
1answer
1k views
Magento 2 offline payment method new order status
I've created a new offline payment module using this generator http://cedcommerce.com/magento-2-module-creator/payment-module
config.xml
....
<order_status>pending_payment</order_status&...
5
votes
1answer
206 views
Magento 2 :Admin Grid
In my custom module, I want two grids in admin side.I have added the follwing code in di.xml file
<?xml version="1.0"?>
<!--
/**
* @author Cartin24 Team
* @copyright Copyright (c) 2016 ...
5
votes
2answers
962 views
Magento MySQL Engine choice
Some of the tables in the Magento 2.1 DB have "MEMORY" as their engine. This is a problem for the DB cluster we are using (Percona-XtraDB-Cluster with pxc_strict_mode = ENFORCING).
Can I change the ...
5
votes
3answers
311 views
Fatal errors are coming after i run static-content:deploy with third party theme
I am facing some strange issues in Magento 2.1.3, i have configured third party theme and working fine, once i run setup:static-content:deploy, am getting fatal errors like i added below from core ...
5
votes
0answers
250 views
How to setup two PayPal Express Checkout in a store?
If the product is below a specific price, then use Paypal merchant account A, use PayPal merchant account B otherwise.
Is it possible to configure like these in Magento 2.x?
Or How could I achieve ...
5
votes
1answer
2k views
Magento 2 Unable to assign Product to category via API
There has been similar issues posted without an answer unfortunately but I am posting two ways in the API to set a category on a product both of which give different errors.
The first is using the ...
5
votes
1answer
1k views
Magento 2 : Display grouped product pictures in template
I am trying to display the grouped product images on my product page. So I extended the grouped.phtml file in my theme and modified it as follow:
<?php
/**
* Copyright © 2016 Magento. All rights ...
5
votes
1answer
2k views
Why shipping methods not updated on changing of checkout fields?
In the past when I fill one of the checkout fields then shipping method section under the checkout page refreshed and then updated like this:
But now shipping method not updated by calling ajax (or ...
5
votes
1answer
2k views
Magento2 search like searching using REST API
When using magento search REST API you can search with logical AND search
http://devdocs.magento.com/guides/v2.0/howdoi/webapi/search-criteria.html#logical-and-search
For example I want to search ...
5
votes
0answers
497 views
Magento 2 : Not able to save admin form after adding multiple tabs
I have created an admin form with 2 tabs. 2nd tab contains product grid. Before adding tabs save button works perfectly but now getting an error
TypeError: $.data(...) is undefined
and I'm not ...