Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [array]

The tag has no usage guidance.

-1
votes
1answer
26 views

Array Get Value in magento2

i want to get profile id from this array [2019-05-21 07:30:24] main.DEBUG: array ( 'url' => 'https://api-3t.sandbox.paypal.com/nvp', 'CreateRecurringPaymentsProfile' => array ( '...
0
votes
1answer
26 views

array convert into Magento 2 collection

I have 2 collection 1 is $bestsalecollection that show in dashboard . second is product collection. After filter collection when i return it generate error Call to a member function isLoaded() on ...
0
votes
0answers
5 views

Need to get unique values in array [migrated]

Array ( ) Array ( ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 ) Array ( [0] => 14 [1] => 12 ) ...
0
votes
1answer
18 views

Multiple For each loop value to Json string

$data= array(); foreach($itfdatas as $key=>$itfdata){ $checkemps = explode(',',$itfdata['employee_id']); $data[] = array( 'id'=>mysql_real_escape_string($itfdata['P_id']), ...
4
votes
3answers
32 views

How to Find out where it Is made Breadcrumb Array in Magento 2.3.1

where it Is made Breadcrumb Array in Magento 2.3.1? In Detail page has show Breadcrumb but i m not able to find where it Is made Breadcrumb Array Can somebody help me? Thanks
1
vote
1answer
19 views

How to get _data:protected on printing customer data in Magneto 2.6?

How to access this value from array [value] => 11113610 ? Array ( [is_saml] => Magento\Framework\Api\AttributeValue Object ( [_data:protected] => Array ( ...
3
votes
3answers
59 views

Need to get array values

Array ( [requestId] => 69a6#16a49c12847 [result] => Array ( [0] => Array ( [seq] => 0 [marketoGUID] =>...
0
votes
0answers
21 views

Magento 2 how to match one item from one collection to another item in another collection if both are same then add to an array

I'm trying to compare two values from collection to another two values from another collection if they both are same then add that row to a array. How to achieve it. Can I get help? Thank you in ...
1
vote
1answer
29 views

Custom report without using collection

I have a request which to make custom report, and data for the report need to calculate by helper function and will generate a data array with row and columns. Is there any solution to let data array ...
4
votes
2answers
109 views

How to resolve Exception #0 (Exception): Notice: Array to string conversion Mailchimp Error

Exception #0 (Exception): Notice: Array to string conversion in /public_html/vendor/magento/framework/View/Element/Html/Select.php on line 244 line 235-244 of the Select.php public function ...
3
votes
1answer
61 views

Magento2 : How to show button in admin for custom module page?

I want to show the button in my custom module (admin page) but I am getting an error I want to add a button and how I add action process for that button i already tried this answer : (https://...
1
vote
2answers
82 views

Magento Api request foreach error

I am trying to get attribute option Ids for a sku using this below api call. http://localhost/rest/V1/configurable-products/sh8/options/all I used this curl request: $curl = curl_init(); ...
1
vote
1answer
44 views

How to filter duplicate values in magento array?

I am trying to get attribute option values for specific products. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $baseUrl = $objectManager->get('Magento\...
2
votes
1answer
38 views

Unserialize large data not working in Magento 1.9

I've created a custom module on my Magento 1.4.0 website, which create a csv feed file with all products and you can add dynamically what product attributes to display in the file. Something like in ...
-1
votes
1answer
101 views

Warning: strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157

1 exception(s): Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table....
0
votes
1answer
83 views

How to add dynamic multi-select list drop-down in admin edit.php file

I have create Model/Source But I want to add this in admin multiselect dropdown list Like: $fieldset->addField( 'special', 'multiselect', [ 'label' => __(...
1
vote
1answer
55 views

How to implode a array object

Here my code: public function getTime(){ $store = $this->getStoreId(); $mapping_time = $this->scopeConfig->getValue(self::XPATH_HOURMAX, ScopeInterface::SCOPE_STORE, $store); ...
2
votes
2answers
48 views

How can Select arrays from associate array in php on the basis on element [closed]

I have an array "$arrItems['items']" in which 5 more arrays(associate array) and each array contain 5 element(f_name,l_name,contact,address,seller_id). Actually I want to get all those arrays(from "$...
2
votes
3answers
63 views

In Magento 2 how to unserialized the array to get a data?

my code: <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $data = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('...
0
votes
2answers
37 views

Accessing Array with space in key Value

I have an array in this format $dataArray = "array ( 0 => array ( 'Field Val' =>'val1', 'Field Val2' =>'val2', ), 1 => array ( 'Field Val' =>'val1', 'Field ...
0
votes
0answers
47 views

How to read data in CSV file and store it to database in Magento 2

$data = [ [ 'data_id' => 1, 'name' => 'Name1', 'bonus_points' => 123.45 ], [ 'data_id' =>...
-1
votes
1answer
22 views

How to display created dynamic attibute into the customer array?

We already created dynamic attribute and that attribute display on the admin side Account information tab of admin. But when we need to add some value on that feild at that time we find that, that ...
1
vote
2answers
219 views

How to convert this object data into array?

I have this Data Object value. Magento\Customer\Model\Data\AttributeMetadata Object ( [_data:protected] => Array ( [frontend_input] => boolean [input_filter] ...
1
vote
0answers
28 views

Forms not working with array fields

Don't know something has gone wrong. Suddenly on my magento (1.9) site forms which have array fields are not working. for example :- <input type="text" name="inputfield['first']" id="...
0
votes
1answer
51 views

Magento 2: my_variable is not defined in ArraySerialized

I'm trying to make a custom store configuration with ArraySerialized But at first, i try with 2 column and it working fine, i've successfully in created and get data from it, but then, i created 1 ...
1
vote
1answer
467 views

How can we return an array of search results in APIs Magento 2

I need to return array of search results and so far I did this. DashBoardInterface.php <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ ...
0
votes
2answers
162 views

Split array in ko template

I have a array with following structure in ko template styleBasedProductsDetails = {{ "image_url": "media/images/home-page/1.jpg", "link_url": "push-up-bra-online/" ...
0
votes
1answer
49 views

Magento 1.9.x Quantity Select Box Increments - How can i limit them?

We currently display product quantities in select box <select><option> type inputs and limit the select dropdown to a maximum Qty of 30. This has been working fine for us however we want ...
0
votes
2answers
46 views

Don't execute foreach loop if array is empty

I have the following code, if there are no orders older then $days_ago, I want that the foreach loop won't be executed. I don't know how to do this. $orders = Mage::getModel('sales/order')->...
1
vote
3answers
298 views

Multiple url name and field addcolumn action

I have this code: $grid->addColumn('action',array( 'header' => $this->__('Action'), 'type' => 'action', 'action' => array( ...
0
votes
2answers
137 views

addFieldtofilter array not reading

I am trying to filter product collection by ids if I use below code, the filter works ok and the product shows. $this->_productCollection ->addFieldToFilter('entity_id',array('in'=&...
1
vote
5answers
229 views

Magento 2.2: Weird $_files array after image upload

currently I'm trying to develop an image upload in the Magento admin area with ui components. My fieldset declarations looks like this: <fieldset name="slide"> <argument name="data" ...
3
votes
1answer
734 views

Array Manipulation

Is there any good example of array manipulation in magento 2 using Class Magento\Framework\Stdlib\ArrayManager and to use their function in my module like marge array, find any nodes etc. I just ...
0
votes
2answers
122 views

how to fetch all order items through loop from json data api ? magento2

Hi i have an array coming from json data of placed order items in my api in this form. let's suppose this example : [items] => Array ( [0] => stdClass Object ...
0
votes
2answers
214 views

Code to Display data on page coming in form of array?

Hi i have a data of table coming in form of array in function inside my block class : What i want basically is to display that array form data on my homepage : here's my code : protected function ...
1
vote
1answer
329 views

Magento 2 Short array syntax is not allowed while Module testing.

Magento 2 module testing tools gives error "short array syntax not allowed", we do code like following public function toOptionArray() { return [ ['value' => 0, 'label' =&...
0
votes
1answer
315 views

Get convert resultJsonFactory response to string in Magento2

I want to log the values of a resultJsonFactory object in php with in Magento 2: How do I get the values I set in the $response object ? $response = $this->resultJsonFactory->create(); $...
0
votes
2answers
285 views

Magento 2 How to fetch rest API array value

I got sales order details from Rest API. How to fetch this values(like When i call base_currency_code it will show USD). Thank you.
3
votes
1answer
2k views

Magento 2 Modal Popup - Buttons

I'm trying to add more than one button in my Magento 2 modal. I got it to pop up but I can't seem to get another button to appear. and I adding the second button correctly to the array? UPDATED CODE! ...
0
votes
1answer
411 views

Arry to string conversion Magento 2 webapi - with snippet

I have this code in a module to recalculate Magento 2 shipping rate public function getAddressHash($request) { $addressCondition = $this->objectManager->create('Magesales\...
1
vote
0answers
54 views

Can't able to set value for nested object param

Below one is my custom observer object, I need to get/set value of processor object { ["_quality":protected]=> int(10) /* 1st quality param.*/ ["_processor":protected]=> object(...
1
vote
1answer
301 views

Display an array of Jquery data in HTML

I make a request in ajax at the click of the button passing as parameter the id of a certain product to the controller. This controller directs the product id to a helper that adds the same to the ...
1
vote
1answer
62 views

Manipulating variables in jQuery to be displayed in html code

I make a request in Ajax at the click of the button passing the id of a product to a controller and it passes to the helper. In the helper, through this id of the product, I add it to the cart, but ...
0
votes
1answer
72 views

How to check if a value in array is already at the database

I have an array, and I need to check if one of his values are in my database. I tried with collections, but I wasn't successful. This is my array: $ab = Array ( [0] => Array ( ...
0
votes
1answer
92 views

Get Product Image Array - Email Order Confirmation

I'm developing a new order conformation page in magento 1.9.3 and I have everything working yet I can't seem to get the image from this here, 'imgUrl' => Mage::getModel('catalog/...
0
votes
1answer
266 views

Magento2: Products group by filterable attributes

Does anyone know how to get an array with the number of products grouped by attributes that can be filtered, in a controller o helper? For example: ["Activity" => [....], "GENDER" => ["MEN" =&...
0
votes
1answer
263 views

How to save key value pair of array from JSON in magento 1.9?

Here is my test code trying to save data what I am getting in request, but it is not saving in table. $json = '{ "isMobileConfirm":false, "cid":"85036", "managerid":"12345", "location":...
1
vote
0answers
277 views

AbstractFieldArray with Image Upload

I have an issue with getting the AbstractFieldArray class to work with an image upload for Magento Backend. Basically I have a settings grid with 4 columns. 1 of them contains a dropdown field, the ...
1
vote
1answer
181 views

something is wrong in the code. theows an error->getNodeChildrenData() must be an instance of Varien_Data_Tree_Node,on line 18 [duplicate]

<?php class Ab_CategoryObserver_Model_Observer{ public function updateTopMenuJson(Varien_Event_Observer $observer){ $_helper = Mage::helper('catalog/category'); $_categories = $...
0
votes
2answers
81 views

What to do exactly? my code throw an error -> 'Call to undefined function getNodeChildrenData()'

class Ab_CategoryObserver_Model_Observer{ public function updateTopMenuJson(Varien_Event_Observer $observer){ $_helper = Mage::helper('catalog/category'); $_categories = $_helper->...