Denotes questions related to Magento 2.x
0
votes
0answers
5 views
How to override Magento\Catalog\Model\ProductLink\CollectionProvider in magento 2.1.2
How is it possible to override Magento\Catalog\Model\ProductLink\CollectionProvider using custom module, I have to do some more stuff in below function,
public function getCollection(\Magento\Catalog\...
1
vote
1answer
23 views
Magento 2 : Replace a custom JS component
We are working on a module that requires JS overwrite for file Magento_Checkout/js/model/shipping-save-processor/default.
We are able to overwrite the JS using the steps provided in the magento guide....
0
votes
1answer
8 views
Magento2: How to limit maximum images per product?
I want to limit 5 images per product at backend. So admin won't be able to upload more than 5 images. How can I achieve this, any idea?
0
votes
0answers
19 views
Magento 2 - sales_order_shipment_save_after
I need to call some API on ship item from magento but nothing is working.
Following things I already tried:
1) Use event/observer: sales_order_shipment_save_after (As I thought It will work in ...
0
votes
1answer
26 views
Invalid Template File
I keep getting this error in system log:
Invalid template file:
'Inchoo_SocialConnect::inchoo/socialconnect/google/button.phtml' in
module: 'Inchoo_SocialConnect' block's name:
'...
0
votes
0answers
10 views
Collection provider is not registered Magento 2.1.2
While clicking on product in admin getting error like Collection provider is not registered
0
votes
0answers
16 views
Magento 2 configurable option problem
I am using magento 2.1 and need you help!
I have 3 product configurations ("stoff", "leder" and "kunstleder") they have to be differentiated visually.
First I summarized this three materials in one ...
0
votes
2answers
25 views
getChildHtml not working
I have a getChildHtml in my login.phtml for my module:
<?php echo $this->getChildHtml('inchoo_socialconnect_google_login_button'); ?>
but it doesn't appear to be getting the child html
...
2
votes
1answer
27 views
Can I override or extend a Magento 2 module?
My question is very simple but I couldn't find any answers so far.
Is it possible to properly override or extend a Magento 2 module ? (Without duplicating the module sources).
Here is an example:
...
1
vote
1answer
15 views
Magento 2 : What's the proper location to put repositories?
In Magento 2.1:
When I look at the customer module, I note that the customer repository is located in the folder for resource models:
Magento\Customer\Model\ResourceModel\CustomerRepository
But ...
2
votes
1answer
142 views
What does the $this->hasData() evaluate and do?
I've seen at several sites having the method $this->hasData('test'); in their Block classes (not template files).
As an example, here's an extract of a method in a Block class from a tutorial ...
0
votes
1answer
17 views
Magento2, remove gift options from cart page
I made below in my theme, but new xml does not remove the git option block.
/app/design/frontend/Mytheme/themename/Magento_GiftMessage/Magento_GiftMessage/view/frontend/layout/...
1
vote
1answer
26 views
Magento 2 - How to do get the product attribute code and value associated with product using product id?
Hi i want to show the products attribute code and it's value using the product id.
How can i do this? Any help would be appreciated.
0
votes
0answers
9 views
Browser Language Redirection For Multi Language Stores In Magento 2
Anybody knows how to use the following piece of code? I want detect visitors browser language and than redirect for the right multi language store. Want to use subfolders (www.domain.com/en/), not ...
0
votes
1answer
35 views
Magento2, echo product attribute in minicart
How can I access product attribute to echo it in minicart https://waybackassets.bk21.net/template/minicart/item/default.html Like below works for cart page templates/cart/item/default.phtml
<?php
$product = $_item->...
1
vote
2answers
25 views
Table is not created again when removed magento 2
I have a module that creates a table. I removed that table and also removed the entry of that module in "setup_module" too.And after doing all that on page refresh it is not creating the table again. ...
2
votes
0answers
25 views
How to Get Recently Viewed Products in Magento 2 Using Customer Entity Id
I want to display the recently viewed products name and products id of a particular customer using customer entity id.
How can I do that in Magento 2 programmatically?
1
vote
1answer
22 views
Invalid arguments supplied for foreach() in module-catalog/Model/ProductLink/CollectionProvider.php magento 2.1.2
I am trying to get a collection of custom link type called customtype along with related and upsell,In admin while click on a product it will throw an error like
Invalid arguments supplied for ...
0
votes
0answers
30 views
After upgrade bin/magento not working
After upgrading my local instance of magento 2.1 to 2.1.2 the bin/magento tools stopped working. I do not get an error or any output. For instance when I run php bin/magento setup:upgrade after ...
0
votes
0answers
14 views
worldpay-magento2 is not shown on checkout page
https://github.com/Worldpay/worldpay-magento2
I have use above extension on magento 2.0.9 but it never displays on frontend checkout page under payment method.
I've cleared cache, re deploy content , ...
0
votes
1answer
15 views
Magento 2 Install Module Fails
I have a completely fresh install of Magento 2.1.2 installed via Composer. I am attempting to install a module called "Advanced Content Manager 2" which is said to be compatible with Magento 2.1 and ...
0
votes
0answers
7 views
Architecture of modules adding some feature to view layer of store
For example, I have a store with custom theme.
I want to edit customer address by ajax, not by php (natively). What I would do is create new module, which would contain (apart mandatory files) ...
0
votes
1answer
22 views
Get value from custom column from customer_entity
I'm having an issue with getting data from custom column I added in customer_entity. I added a column typo3_password in UpdateSchema.php and now I need to get data from this column. Trying to do that ...
0
votes
1answer
19 views
How to configure Cron job in magento 2 to enable extensions through component manager?
Hello i have uploaded an extension through cpanel and now want to enable it, so whenever i enable it through component manager and start readiness check i get error msg - Error from Setup Application ...
0
votes
0answers
17 views
run php shell commands
I put my Magento website in a not dedicated server.
So, everytime I want to run some php shell commands I have to write an email to my WebHosting tutor and tell him wich commands he has to execute.
...
0
votes
1answer
23 views
Magento 2 - Error Messaging Text Change
I'm trying to change a couple error messaging strings on the frontend in 2 places. First in the regular customer login.
And also in the tooltip in the checkout login. I've tried editing ...
0
votes
2answers
19 views
Remove label and value Tax from cart magento 2.1
i have a problem!
Necessity to delete label and value tax in to cart and checkout.
I not found the .phtml file to remove this.
0
votes
0answers
22 views
Magento 2.1.2: How to delete element “minicart” from the website to make the print invoice (print.xml)
when I want to delete a block minicart I have the following error:
Uncaught TypeError: Cannot read property 'captcha' of undefined(…)
and
Uncaught TypeError: Cannot read property 'autocomplete' of ...
0
votes
1answer
19 views
Block with PHP methods only - preferable inheritance
I often create blocks containing PHP methods, not binded with any template by design. They are sometimes used only in one place, sometimes throughout an app. So far, I was making them inherit from \...
0
votes
0answers
11 views
Magento 2 modules directory [duplicate]
I have installed Magento 2 (Community Edition). Everywhere on the internet I search for the modules directory, they say custom modules sit in app/code, while in my installation, the app directory only ...
1
vote
3answers
25 views
How to deploy magento 1.9.X module to 2.X module
I need to deploy my custom modules from 1.9.X to 2.0.X,
Is there any way to deploy, or we will start from scratch.?
1
vote
2answers
20 views
Magento 2 : override resource model that is called by factory method
I am trying to override
\Magento\Sales\Model\ResourceModel\Report\Order\Createdat
by using
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
3
votes
1answer
23 views
Magento 2: How to validate the radio box and show required message?
I want to make the required radio box on submitting form. Validation works but it not showing the error message as "This is required field"
<div class="control">
<input type="radio" ...
1
vote
1answer
33 views
customer session does not work except customer page - Magento 2
Block
<?php
namespace Vendor\Module\Block;
class CustomerLink extends \Magento\Framework\View\Element\Template
{
protected $_customersession;
public function __construct(
\Magento\...
1
vote
0answers
20 views
Magento2: Remove Store Code URL only for default store
I am developing a Magento 2 store with two store views, one for each language(English and Italian). I turned on the "Add Store Code to Urls" option from backend, so my URLs looks like:
http://mystore....
0
votes
1answer
22 views
Exception: Invalid method Inchoo\SocialConnect\Block\Login::__
I keep getting this error:
Invalid method Inchoo\SocialConnect\Block\Login::__
method:
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\...
1
vote
1answer
34 views
Magento 2 : Update Order Summary Block On Checkout Page
I already look into this : how to add fee to order totals in magento2
I need to added additional fee based on shipping address, So I used this plugin
<type name="Magento\Checkout\Model\...
0
votes
2answers
35 views
Magento 2 : How to send data from controller to block and display on front end
I have used the following code
<?php
namespace Inchoo\Helloworld\Controller\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Inchoo\Helloworld\Model\...
0
votes
1answer
10 views
main.Critical: Invalid Method
I keep getting this error:
main.CRITICAL: Invalid method
Inchoo\SocialConnect\Block\Login::_getColSet [] []
method:
protected function _getColSet()
{
return 'col'.$this->numEnabled.'-set'...
1
vote
1answer
14 views
Custom controller reuses Magento front name
I've added custom controller under magento frontName and it works.
My routes.xml:
...
<router id="standard">
<route id="customer" frontName="customer">
...
0
votes
2answers
25 views
How to prevent browser caching for merged files?
I'm using magento 2.1.2 in production mode with merge/minify/bundle enabled. It works good and the created files like /static/_cache/merged/6c3c8136610cacb3de381ea2afc99190.min.js has header expires ...
0
votes
1answer
27 views
M2 - Cannot change deploy mode to Production
I am trying to set the deploy mode on an M2 instance to Production from Developer.
On my local environment however I keep getting the error message:
Command returned non-zero exit code:
'/...
0
votes
2answers
40 views
How can write below script in magento 2
How can i write below script in magento 2
class NameSpace_Notification_Model_App extends Mage_Core_Model_Config_Data
{
public function save(){ }
}
2
votes
2answers
61 views
Magento 2: How to set the radio option value programatically (by variable) in admin panel
I want to set the radio box option value from the variable as below example.
How can i achieve this.
$fieldset->addField(
'test',
'radios',
[
'...
1
vote
0answers
27 views
Magento 2 C.E. Admin Panel 500 Internal Error
I installed magento.
front end working fine but admin panel is not working.
I checked logs below.
How can I solve it?
0
votes
1answer
18 views
render minicart in custom layout - Magento 2
I am working on header customization, I completely remove luma header and make a new one. I can render minicart in custom layout like
<referenceContainer name="page.wrapper">
<block ...
0
votes
0answers
12 views
Magento 2: How to check Selling Fast Products?
Would like to check Selling Fast Products List.
It will be managed Product Wise.
Example:
For Product A, Qty: 50, Limit Qty: 5
For Product B, Qty: 100, Limit Qty: 2
If Product A reached Qty 5 then ...
0
votes
0answers
20 views
Magento 2: How to limit quantity for BackOrders per Product?
From Admin, we are able to set Product's Inventory for BackOrders.
How can I limit for BackOrders?
Example:
For Product A I want 50 Qty. BackOrders.
For Product B i want 100 Qty. BackOrders.
...
1
vote
1answer
18 views
How to add CMS directive {{block}} on custom module field in Magento 2
I have developed a custom slider for Magento 2. The fields for my slider in the backend are; Title, Image and Content. The Content is a Wysiwyg editor and I am trying to make it work like a CMS Page ...
2
votes
1answer
16 views
Elegant way of constructor dependency injection when extending abstract class?
I'm wondering what the best way is to add extra dependencies in the constructor of a class when extending another (abstract) class?
In follow up to this answer regarding dependency injection when ...