Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
3
votes
1answer
1k views

Magento 1.9.2 Upgraded to magento 2 via admin panel

I was reading the upgrade guide - but had the idea to try the upgrade via Magento connect. but is there any chance to update via admin panel
2
votes
0answers
1k views

Magento 2 Add Image to product media gallery

I am using bacon-qr-code library to generate a png file containing the QR code of the product info, it is generated and i am using $product->addImageToMediaGallery() function, which creates a ...
10
votes
4answers
20k views

How to create Admin Grid in Magento2?

I am trying to create module in magento2, now i stuck creating grid page in admin side, let me know if any one already did
2
votes
1answer
90 views

Magento2 - Which namespaces to be used inside a class

This might be a novice question, but as when a developer starts to learn Magento2,how do i figure out which all namespaces must be used inside a Model,Block,Plugin or matter of fact any custom class ...
0
votes
1answer
6k views

AJAX request in backend template is redirecting to login page

I am working with Magento2. I've created some backend controllers, which are accessible in backend. In my backend template file, I want to call the controller function with jQuery like this: ...
0
votes
0answers
453 views

Magento2 attributes construct error in Entity

I have made a dummy module in Magento2 , just wanted to observer cart add event, but while making few files i am getting this error a:4:{i:0;s:168:"Warning: DOMDocument::loadXML(): attributes ...
0
votes
3answers
2k views

Magento 2 Form Field Array (Advance system configuration option)

Recently I worked on advance system config form field in Magento 2. I checked Braintree payment method for reference. When I saved a value, it showing following error: Something went wrong ...
0
votes
1answer
2k views

Magento2 Admin login is coming blank [duplicate]

Installation of Magento2 went fine, but when i try to access the admin page, it gives me blank login screen. pub/static has generated css,js correctly for frontend and adminhtml I see problem with ...
0
votes
0answers
503 views

Error while running php bin/magento setup:upgrade in magento 2

When i try to upgrade the setup from the magento root folder in cmd, using php bin/magento setup:upgrade i get below error Autoload error: An abstract factory could not create an instance of ...
21
votes
1answer
5k views

Block with Cachable=false not rendered on product view page

I am using magento2-1.0.0-beta4 I have copied the checkout.root block from app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml to the product page. Everything is working fine, ...
14
votes
3answers
21k views

I am getting Fatal error: Class 'IntlDateFormatter' not found in Magento2

I am getting the error Fatal error: Class 'IntlDateFormatter' not found in Magento2 after installation.
2
votes
2answers
64 views

Contributing to magento hackathon Github

I'm wanting to contribute to the magento hackathon github page https://github.com/magento-hackathon .Does it need to be during a hackathon or can anyone contribute at anytime? And Do they accept PR's?
2
votes
1answer
2k views

Magento 2 - custom model save triggers error - Fatal error: Call to a member function dispatch() on a non-object

I am creating a simple frontend magento 2 module to take input from user and save output in database. Here is what i have tried. Index.php -- (Index controller index action) namespace ...
52
votes
3answers
7k views

Run tests for a specific module in Magento2

Running the tests for Magento to using php bin/magento dev:tests:run takes a lot of time. Is there a way to run the tests for a specific module only? I'm a noob in (unit) testing so have mercy.
0
votes
2answers
3k views

How to override adminhtml phtml files in magento2

How to override adminhtml phtml files in magento2? I want to place a custom text in customer edit page welcome to magento2. For this I have created a theme and placed app\design\adminhtml\Vendor\...
7
votes
2answers
2k views

Add jQuery Datatables in magento 2

I am trying to use the jquery DataTables in magento-2 frontend using the requirejs. I can see the datables.min.js file in the net panel, but somehow it give the following error. My reuirejs-config....
1
vote
0answers
123 views

Detail page in Magento2 render empty

I have created my own new theme in Magento 2 clone from blank theme of Magento2. When I open up product view page, It's showing blank page (Body totally blank). I have re-checked all my settings ...
3
votes
1answer
3k views

How do add css, js in customview.phtml in view magento2?

I have custom view.phtml. I Want add my.css and my.js in <head></head> 2 file in app\code\Test\New\view\frontend\web\css. How do it?
15
votes
3answers
5k views

How to get events/observers in magento 2

In Magento 1 I can get list of events/observers by debugging dispatchEvent() method from Mage.php like below. /** * Dispatch event * * Calls all observer callbacks registered for this ...
49
votes
8answers
38k views

How to Override Core Block, Model and controller in Magento2

I'm stuck in overriding core model Blocks and controllers in Magento2. Can any one help on this? Let's take list toolbar as example where I need to add a new sort option called sort by most popular. ...
4
votes
1answer
2k views

How to Extend and initialize a JS Widget with Proper Custom Namespace / Replace Existing Widget

I want to modify the mage.catalogAddToCart JS widget of Magento 2. According to http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html I have to do a $.widget('foobar....
3
votes
1answer
6k views

Magento 2: How to add popup on button click in admin?

Can you explain how to add popup(modal window) on button click in the adminhtml? I already create some phtml <div id="messages"> <div class="messages"> <?php foreach ($this->...
2
votes
1answer
2k views

magento 2 override block using preference

I need help regarding block overriding. I have successfully overridden a block using preferences, but when I add core registry in the construct method it's showing the following error: Recoverable ...
1
vote
1answer
867 views

Magenot2: what is the use of `resource` paramerter in menu.xml

i created one testing module in magento2 and for backend added menu by this code: location of this file is Test/Seller/etc/adminhtml/menu.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
0answers
375 views

Magento2.0 used as backend and Wordpress used as frontend(magento2.0 Api) [closed]

I need solution with below requirement 1) All Magento data, inclusive of catalog/products, inventory, customer data, quotes, checkout process, etc., should be utilized from within WordPress by way ...
2
votes
1answer
540 views

Smarter way to continuously update the cart in Magento 2

I am developing a Magento 2 shop with a (bundle) product configurator and a side bar which should contain the current cart, including shipping cost and discount (for example 5% for orders > 100€). I ...
6
votes
2answers
8k views

Create Custom Rest Api in Magento2 and solution for “InvalidArgumentException” error

I started on Magento2 Custom rest API module creation for that i follow the below post API Module for Magneto2 url:- http://localhost/magento2a/rest/V1/calculator/add/1/2 app/code/AlanKent/...
16
votes
3answers
5k views

Product Tags feature is not included in Magento 2

First, I'm confused whether this question will fit the requirements of a question expected on this site, if that's the case, please indicate that. Just installed a fresh version of Magento 2 to get ...
5
votes
2answers
19k views

Add custom js in head in magento2?

I have custom module. I want add file my.js in folder app\code\Xanka\Slider\view\frontend\web\js\slider\my.js. I used code in app\code\Xanka\Slider\view\frontend\layout\default.xml <head> &...
2
votes
2answers
1k views

Magento 2 Blank Admin Page

I was able to install Magento 2 on "Windows environment" using "WAMP". After successful installation, when I'm trying to access admin panel, I'm seeing a blank page with a white popup as follows. I'...
6
votes
1answer
3k views

How do I render image in Adminhtml grids in magento2?

I have added renderer in Grid.php as below: $this->addColumn( 'image', array( 'header' => __('Image'), 'index' => 'image', 'renderer' => \YourVendor\...
0
votes
1answer
228 views

how do get custom block in magento2?

I magento 1 i can call {{block type="Xanka\Slider\Block\Slideshow" template="slideshow.phtml"}}. how do it in magento2?
52
votes
6answers
34k views

Magento 2: Changing a Block's Template

In Magento 1, as a module developer it's possible to change a block's template using layout XML code something like this <reference name="block_to_change"> <action method="setTemplate"&...
5
votes
1answer
1k views

How to add new theme name to grunt CLI command to run grunt tool in Magento 2?

When we clone new theme from existing parent theme in Magento 2. How we can execute less:newThemName command using grunt CLI ? As well as how grunt watch will look any changes into newly created ...
9
votes
2answers
2k views

Overriding template files in own theme, loaded through JS (Knockout.js)

Since the official Magento 2.0 forums aren't of any help, i'll post my question here as well. We're in the process of building our own theme based on the Magento Blank theme and we would like to ...
7
votes
4answers
20k views

Magento2 : Admin module Image upload code to display form

I have magento2 admin custom module with image upload functionality. I want to upload image from admin. what code should apply for display image field in from, upload image, also image display in edit ...
3
votes
2answers
1k views

What are the Magento2 code formating settings for PHPStorm?

When editing Magento2 .phtml files, it would be nice to use the code formating function of PhpStorm, but without changing the original layout (just format added stuff). So did anybody already set up ...
2
votes
1answer
967 views

How is Magento 2 RouterList Populated?

How does Magento2 populate its $routerList in : public function dispatch(RequestInterface $request) { \Magento\Framework\Profiler::start('routers_match'); $routingCycleCounter = 0; $...
29
votes
2answers
36k views

Magento2 : How to database schema upgrade

I am working on magento custom module, in module have Setup\InstallSchema.php file which is installed before. i have added some more database fields in InstallSchema.php so i want to update table ...
4
votes
1answer
732 views

How to composer-require Magento2 develop branch?

I am currently installing the Magento 2 modules via a "require": { "magento/product-community-edition": "*" }, "repositories": [ { "type": "composer", "url": "http://packages....
1
vote
1answer
66 views

How to Overwrite magento2 Controller [duplicate]

In magento2 how can we Overwrite Controller ? Any help will be appreciated Thank you
4
votes
2answers
122 views

Marshalling in Magento2

According to Magento2 Doc By default, when you install a package, Composer puts it into vendor/<package> directory, such as vendor/magento-module-catalog. However, the Magento framework requires ...
4
votes
4answers
8k views

How to call category collection on home page in magento 2?

I want to show all the category on the left sidebar on home page. Please let me know how to get all the categories by collection, or there is another way to call all the category. please let me know
9
votes
2answers
31k views

How to load custom module js file in magento 2?

I have created banner slider module for magento 2. I have called JS file using following ways and its working fine. In block class I created following function public function getBaseJs($fileName){ ...
5
votes
1answer
4k views

How to return Associative Array from API in Magento 2

I have created Custom Api which returns associativeArray. If I use associativeArray it's giving error If I use string[] it's working But I want to return associativeArray. Error: Class "array" ...
0
votes
1answer
658 views

Magento is creating duplicate invoice ids for the orders

When I checkout with paypal Express checkout , it shows error of duplicate invoice id. This is why we can not place order. Please help me.
2
votes
2answers
845 views

How to include the module name in magento2

Is anyone knows how to load the model in magento2? What we need to do in magento2 to translate the below line in Magento2 $order = $observer->getEvent()->getOrder(); $orders = Mage::...
28
votes
6answers
7k views

Magento 2 - Uninstallable set of packages when deploying magento-sample-data

I've followed this Magento DevDocs tutorial to install sample data after installing Magento 2. But after executing the last command ./bin/magento sampledata:deploy I get the following error: ./...
1
vote
1answer
3k views

How to import customers in magento-2 using csv?

Currently i am working on magento-2 .I have imported products successfully. Now i want to be import customers . I dont have any demo csv for import customers .
0
votes
1answer
68 views

How do import sample-data before setup new site magento2? [duplicate]

i tried setup magento2-1.0.0-beta branch Develop but get error relate to installing data. So i want import sample-data before setup new site magento2. How do it ?