Skip to main content
25 votes

How to add or remove header.links in magento2?

I Hope this is useful for you, if you want to remove top.links Add default.xml file in this path app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml <page xmlns:xsi="...
Rajkumar .E's user avatar
  • 3,570
19 votes
Accepted

How to override system.xml core file in magento2

Magento may load our custom system config and merge into the exist nodes. In our custom system config, we should try: Tested on Magento 2.0.2 and 2.1.2 Vendor/ModuleName/etc/adminhtml/system.xml <?...
Khoa TruongDinh's user avatar
17 votes

Passing Array in REST Api Magento2 (Post Method)

I also faced the same issue and got it fixed.Try this, /** * return placed order status * @api * @param mixed $vendor_data * @return array */ public function ...
saravanavelu's user avatar
  • 3,951
14 votes

How do you add translation for extensions in Magento2?

I assume you mean IWD OPC? If not you can ignore this answer. The checkout extension ships without translations. It should be fairly easy to generate those. First, you need to create i18n directory ...
Langley's user avatar
  • 940
13 votes
Accepted

How to call Owl Slider in Magento2

You have to created one requirejs-config.js file inside your theme like, First Add owlcarousel.js file inside, app/design/frontend/pakage_name/theme_name/Magento_Catalog/web/js Add your css inside, ...
Rakesh Jesadiya's user avatar
10 votes
Accepted

Magento 2: installation stuck at 65% "installing user configuration"

Thanks to @Nickool, I found out apache mod_rewrite was not enabled. So I ran: sudo a2enmod rewrite Added the following lines to my /etc/apache2/sites-available/my.host.com <Directory /var/...
Raphael at Digital Pianism's user avatar
10 votes

Error when saving configuration in Magento 2

I got the same error but my system.xml syntax was correct, so it was something else. Turns out it was the result of my cron_group being incorrectly configured, which caused errors when trying to save ...
Jacques's user avatar
  • 1,022
10 votes
Accepted

Magento 2 - It is possible to create a select with optgroup using \Magento\Framework\Data\Form\Element\::addField?

Try this solution: $fieldset->addField( 'test', 'select', [ 'label' => __('Test'), 'name' => 'test', 'required' => true, 'values' => [ ...
Siarhey Uchukhlebau's user avatar
10 votes

Magento 2 : How can I get the sitemap in magento 2?

As of Magento version 2.1.8, the sitemap functionality is included in the admin by default. Define sitemap location: Marketing > SEO & Search > Site Map. You can also manually generate the ...
nshiff's user avatar
  • 574
9 votes

How to add or remove header.links in magento2?

You can add and remove top links by add this line in your in Magento_Theme/layout/default.xml <referenceBlock name="header.links"> <block class="Magento\Framework\View\Element\Html\...
Bilal Usean's user avatar
9 votes
Accepted

Passing Array in REST Api Magento2 (Post Method)

Magento 2 do not support mixed like array. You can use KayValue[] or string[] but do not array[] see http://devdocs.magento.com/guides/v2.1/extension-dev-guide/service-contracts/service-to-web-...
KAndy's user avatar
  • 20.9k
8 votes

How to call Owl Slider in Magento2

first you need to put slider at, Step1 themename/themename/Magento_Theme/web/js/owl.carousel.js Step2 Do mapping for the file in themename/themename/Magento_Theme/requirejs-config.js /** * ...
Rushvi's user avatar
  • 2,843
7 votes

Translation string, how to

When dealing with translations best way is to start with collecting translatable phrases, you can do so by issuing following command: bin/magento i18n:collect-phrases --output "app/i18n/Vendorname/...
Devtype's user avatar
  • 3,008
7 votes

How to override addtocart.phtml for all type of product in magento 2

Use following code in your module's catalog_product_view.xml file <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...
amitshree's user avatar
  • 7,036
7 votes
Accepted

Remove success message after show

[Update] After all, I found a solution for this problem. It's made me sweat too much. Message was inited at messages.phtml on Magento_Theme package(module-theme\view\frontend\templates\messages....
Henry Bui's user avatar
  • 471
6 votes
Accepted

Magento 2.0 vs 2.1: what are the major/breaking changes?

The CMS, Catalog and GiftCard modules received a major version bump because methods have been added to API interfaces: Magento\Cms\Api\Data\PageInterface Magento\Catalog\Api\...
Fabian Schmengler's user avatar
6 votes

Module created gives Error filtering template: {Classname} does not implement BlockInterface

The problem is caused by the fact that your block does not extend a Magento native block. You need to update your block code like this: <?php namespace {Company}\GetProductCollection\Block; ...
Raphael at Digital Pianism's user avatar
6 votes
Accepted

how to set default color configurable product

This code is working for color swatch attribute. Using below code, first swatch are automatically selected after page load in details page, you have to override file into your theme, app/design/...
Rakesh Jesadiya's user avatar
6 votes

how to set default color configurable product

A better answer is below. The other answer I couldn't get to work on 2.1.4, the JS was running but it didn't do anything, not sure why? The solution below works perfectly and runs right after the ...
Jason Diehl's user avatar
6 votes
Accepted

Magento 2 : How can I get the sitemap in magento 2?

Magento 2: By default not providing HTML Sitemap. Can use Free Extension: https://www.mageplaza.com/magento-2-seo-extension/ You have following options Use Plugin like http://www.mageworx.com/...
Jackson's user avatar
  • 9,939
6 votes

Magento 2 : How can I get the sitemap in magento 2?

Magento 2 doesn't have html sitemap url for category and products like in magento 1.xx . For this, you can create a CMS page like 'sitemap/' and call a phtml file which will include the custom ...
Abhinav Singh's user avatar
6 votes

How to call block method from Controller in magento 2

You can call directly in controller like this, In your controller file, public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\...
Rakesh Jesadiya's user avatar
5 votes

Magento2 Minicart showing blank count

Open your root directory and open minicar‌​t.phtml. The file path is: app/design/frontend/{Vendor}/{themename}/Magento_Checkout/te‌​mplates/cart/minicar‌​t.phtml You have to just replace span with ...
Rakesh Jesadiya's user avatar
5 votes

How to create custom tab in product admin section in Magento 2

Update: I apologize, this answer is working only for version 2.1 +. I won't delete it, perhaps it can helps somebody (who is using the version 2.1 or greater). Add the modifier in app/code/Vendor/...
Siarhey Uchukhlebau's user avatar
5 votes
Accepted

Area code not set

Take a look here: Magento\Framework\ObjectManager\ObjectManager->get() at /opt/bitnami/apps/magento/htdocs/app/code/J2t/Rewardpoints/Observer/ProcessSaveModel.php:21 Looks like this module is ...
circlesix's user avatar
  • 4,303
5 votes

How to check if customer is logged in and get customer Id in magento 2

Try with changing the session object protected $_session; protected $_context; public function __construct( \Magento\Customer\Model\Session $session, \Magento\Framework\View\Element\Template\...
Ashish Jagnani's user avatar
5 votes

Replace logo.svg in default.xml not working Magento2

Try to set a new argument in the xml for the logo block something like: <referenceBlock name="logo"> <arguments> <argument name="logo_img_width" xsi:type=...
Vlad Patru's user avatar
  • 1,200
5 votes
Accepted

List all products with special price

This is how I did it $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $visibleProducts = $objectManager->create('\Magento\Catalog\Model\Product\Visibility')->...
Anna's user avatar
  • 1,655
5 votes
Accepted

Add last 4 digits and type of card to Payment Information in admin view order

I created custom extension to achieve this etc/di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config....
Anna's user avatar
  • 1,655
5 votes
Accepted

override in cart page in the custom module in the magento 2 is not work?

You forgot the <body> tag. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance dc" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...
belfort1's user avatar
  • 462

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