Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
38 views

Magento 2 Objects considered as Arrays

I'm working on a Magento module and I'm having trouble with objects. I declared the below method: use MyInterface; class Object implements MyInterface{ /** * @param MyInterface $object *...
0
votes
2answers
60 views

How to extract one of the properties from an object as an array in PHP?

I have an object that looks like below. I would like to pull out just the "DID" property as an array. How would I go about that in PHP? stdClass Object ( [t] => Array ( [0] => ...
1
vote
1answer
266 views

Magento 2 - How to print array values in custom html email template by looping?

I want to print multiple coupon/gift codes in the custom email template. I am getting a single code as: $templateVars = array( 'store' => $this->storeManager->getStore(), '...
2
votes
1answer
65 views

Magento 2.3 - How to pass array from controller to template

I am working on a custom module. I am getting array of attribute values in my custom controller and I want to pass these values in my template to list in a select dropdown. Please provide a solution - ...
0
votes
3answers
58 views

Custom module collection array not return

I have created a custom module and I have return collection array but it does not return foreach array in Magento 2.3.2. it returns the only foreach last value. Block Code <?php /** * @copyright ...
0
votes
0answers
32 views

Magento 2 WYSIWYG in repeater field

I am trying to make a (very simplified) page builder for just the homepage in Magento 2.3. I figured out how to build a repeating field from a serialized array, like this : <field ...
1
vote
0answers
25 views

Magento 2.2.9 question about foreach data into popup modal

I am trying to do a popup modal with this information I have in an array. I have ID, NAME and DESCRIPTION So in a function, I have done foreach to gather all the information and i am showing it on ...
1
vote
2answers
99 views

Passing array from one template to another in magento2

I have used two template for homepage(template inside another template) I am calling product template inside category template. Now my case scenario is 1. I am declaring one array in category ...
0
votes
1answer
139 views

remove BOM byte (“” /ufeff“”) from response

so im using m2e pro extension on magento 2.3 suddenly the synchronizing stopped from working. thats because that m2e pro uses their own cron job and they sends curl calls to the server, but my server ...
3
votes
0answers
92 views

How to show all data in array using jquery. Magento 2

I'm getting all the Data from Array in Jquery when I console.log() it then it shows me all the data of the array but when I append the data with <div> then it only returns me the last value I ...
0
votes
2answers
34 views

Remove a city from being able to purchase product

So in my explorations I've found that Magento only has the States stored in the back end, but I don't want to remove the entire state, just one city in that state. I've seen options to include a city ...
0
votes
0answers
23 views

Difference between Magento Collection ,object , array

Please clear the main difference between Magento Collection , object , array and arraylist also ?
0
votes
3answers
29 views

Sorting went fail for array

I am having the array of color attribute options... I would like to sort the array based on 'store0' key... I have used multisort and usort but its not working [821] => Array ( [...
2
votes
0answers
63 views

Why would you add the modules array in app/etc/config.php to source control?

As of Magento 2.2 it's recommended to add config.php to your source control to facilitate pipeline deployment. I have some questions and issues with this. I'm hoping somebody can share their ...
0
votes
1answer
144 views

Magento2: How can I access Zend\Stdlib\Parameters Object array?

I have below result: echo "<pre>"; print_r($data); die(); Result Zend\Stdlib\Parameters Object ( [storage:ArrayObject:private] => Array ( [success_url] => ...
-1
votes
1answer
61 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
184 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
1answer
29 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
269 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
57 views

How to get _data:protected on printing customer data in Magento 2.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
73 views

Need to get array values

Array ( [requestId] => 69a6#16a49c12847 [result] => Array ( [0] => Array ( [seq] => 0 [marketoGUID] =>...
0
votes
0answers
23 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
42 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 ...
5
votes
2answers
972 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
279 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
102 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
141 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
194 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
423 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....
1
vote
1answer
285 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
176 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); ...
3
votes
2answers
54 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
150 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
121 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
148 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
24 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
3answers
1k 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
31 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
112 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
1k 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
298 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
101 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
55 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
670 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
348 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
402 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" ...
4
votes
1answer
1k 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
268 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
430 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
472 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' =&...