Linked Questions

5 votes
3 answers

Save is deprecated when try to create attributes set

I try to create programmatically some attributes set. I find this code : $setup = $this->moduleDataSetup->getConnection(); $setup->startSetup(); $categorySetup = $this->...
Kozame's user avatar
  • 964
2 votes
3 answers

Difference between load() and get() methods

While going through the Magento code I have been seeing a lot of instances of: $objectName->load($foo) or $objectName->get($foo) and I was wondering, what is the difference between the 'load'...
Degnan's user avatar
  • 99
1 vote
2 answers

Saving a Quote Since Save() is Deprecated

I have created a new attribute for quotes and orders in Magento 2.1.5. I have an observer that sets the value for this attribute based on a session variable (indentOrder). The code I have is working:...
Wildcard27's user avatar
4 votes
2 answers

Magento 2 - what functions can I use?

Recently I've went through the "Fundamentals of Magento 2 development" course and there was such statement that we SHOULD NOT use functions from other modules that are not defined in the API ...
Sebastian's user avatar
  • 518
4 votes
5 answers

Magento 2 - Create product programmatically with different store view values

I have created this custom import module that will create products and set different values for each store view. The problem is, when I save a single attribute for the product on a store view, all the ...
Robban's user avatar
  • 781
19 votes
2 answers

Best Way to Load a Custom Model in Magento 2

Because it was hard for me to find the right way, below you could find the best practice I made mine. Enjoy, correct my English if needed and say me I'm wrong if I am. :) Edit : ... and I found out I ...
Nicolas PERNOT's user avatar
23 votes
2 answers

Magento 2.1.1 How to load Order with Increment ID using OrderRepository object

What would be the latest best practice to load Order using increment ID (instead of Order ID) using OrderRepository
frostshoxx's user avatar
2 votes
2 answers

How to save an EAV entity from controller?

I'm trying to build a custom module that contains an EAV entity in Magento 2 for learning purposes. I have troubles performing a proper save from an admin controller. I'm trying to avoid code like: $...
Marius's user avatar
  • 198k
0 votes
2 answers

how to use model in magento 2

<?php $price_rules = Mage::getModel('startupready_priceRules/quantitybreaks'); $price_rules->load($priceRuleList); $price_rules->getPricingTables(); ?> Is there any way to use ...
Yudi's user avatar
  • 616
20 votes
1 answer

Magento2 : Best way to load Customer by customer Id

What is the best way to load Customer by Id? using customer interface or customer factory or another way ? In most of solutions I found, it is done by directly using objectManager (which should be ...
Vishwas Bhatnagar's user avatar
4 votes
1 answer

Reference for Magento2 best practices

First of all this might not be the right place to ask this question, if this is the case please let me know where the right place is? Currently there is the module best practice reference on http://...
Martijn Schot's user avatar
28 votes
1 answer

Magento 2.1: using the entity manager

From 2.1 Magento has introduced Magento/Framework/Model/EntityManager I may be wrong here but from my understanding it is to replace Magento/Framework/Model/AbstractModel which was implementing the ...
Raphael at Digital Pianism's user avatar
0 votes
0 answers

Magento 2 : The proper way to read/save entities [duplicate]

I have been only for a few days in the Magento universe, starting with Magento 2, and I am currently a bit lost regarding the proper way to read and save entities (Model). At the very begginning, I ...
enrico69's user avatar
  • 515
32 votes
2 answers

Magento 2 - Why is Magento\Checkout\Model\Cart deprecated?

Since Magento 2.1, Cart has a @deprecated tag. Nevertheless, it is still used by Magento itself to store products when shopping. Is the deprecation intended, and if so, and what should we use instead?
Patrick van Bergen's user avatar
6 votes
1 answer

Annotating methods in API interfaces to work with DataObjectHelper::populateWithArray

I'm trying to build a proper CRUD module for Magento 2. My module contains for now an entity called Author. This module contains the main entity table and a many to many relations table with the store ...
Marius's user avatar
  • 198k

15 30 50 per page