Skip to main content
19 votes

Magento2: How to convert JSON to Array of nested objects

\Magento\Framework\Json\Helper\Data is deprecated since Magento 100.2.0 You could use \Magento\Framework\Serialize\Serializer\Json instead. Ie. public function __construct( \Magento\...
diazwatson's user avatar
  • 2,470
3 votes
Accepted

Magento2: How to convert JSON to Array of nested objects

Found how to achieve this: Use the following to convert the JSON into an array: \Magento\Framework\Webapi\Rest\Request\Deserializer\Json\Deserializer::deserialize('jsonString') Use the following to ...
BAF's user avatar
  • 719
3 votes
Accepted

Magento2: Toggle button yes/no to enable/disable module function in shipment method/

Replace your below files with these content Shipme/Block/Adminhtml/System/Config/Advanced.php <?php namespace Packt\Shipme\Block\Adminhtml\System\Config; class Advanced extends \Magento\...
Kishan Savaliya's user avatar
2 votes

What is the use of "mapping" node in di.xml in Magento 2?

The object manager injects the Magento\Core\Model\Url implementation class wherever there is a request for the Magento\Core\Model\UrlInterface in the global scope. Multiple validation for ...
Aditya Shah's user avatar
  • 7,647
2 votes
Accepted

What is the use of "mapping" node in di.xml in Magento 2?

When you check Magento\Payment\Model\Checks\SpecificationFactory of the construt public function __construct(\Magento\Payment\Model\Checks\CompositeFactory $compositeFactory, array $mapping) { ...
Keyur Shah's user avatar
  • 18.1k
1 vote
Accepted

Join array values and keys between two php arrays

You can do this using array_walk with closure see example below : $keyArray = [ "key1" => "map1", "key2" => "map1", "key3" => "map2"...
Mohamed23gharbi's user avatar

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