Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
240 views

Unserialize large data not working in Magento 1.9

I've created a custom module on my Magento 1.9.4.0 website, which creates a CSV feed file with all products and you can add dynamically what product attributes to display in the file. Something like ...
0
votes
1answer
25 views

Sum of id element from n number of array inside array in PHP

I have an array like tree and i want to get sum of id element any idea how to get?? Thanks <?php $data=[ 0=>[ 'id'=>1, 'date'=>'3/3/...
0
votes
0answers
40 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 *...
1
vote
2answers
103 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(); ...
0
votes
2answers
124 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
553 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
93 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
66 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 ...
3
votes
5answers
1k views

Duplicate items in array from SOAP

Im trying to get a list of items from an order to display correctly on my webpage using the SOAP API. I have managed to display shipping, billing and general info, and i have also managed to display ...
0
votes
0answers
43 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
2answers
2k views

Delete multiple store views programmatically

I am trying to delete multiple store views using a php script that includes app/Mage.php in the root of my installation. I am able to get the list of websites and store views but I need to somehow ...
1
vote
0answers
30 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
137 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 ...
1
vote
1answer
93 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 ( ...
0
votes
1answer
236 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 ...
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] ...
3
votes
0answers
117 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
37 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 ...
2
votes
1answer
2k 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
0answers
24 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
91 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
218 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
94 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
314 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
139 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 ...
3
votes
3answers
320 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
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']), ...
1
vote
5answers
448 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" ...
1
vote
1answer
44 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 ...
3
votes
3answers
77 views

Need to get array values

Array ( [requestId] => 69a6#16a49c12847 [result] => Array ( [0] => Array ( [seq] => 0 [marketoGUID] =>...
1
vote
3answers
767 views

Multiple url name and field addcolumn action

I have this code: $grid->addColumn('action',array( 'header' => $this->__('Action'), 'type' => 'action', 'action' => array( ...
5
votes
2answers
1k 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
370 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
votes
1answer
503 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
204 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\...
0
votes
2answers
56 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
1answer
327 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
227 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
3answers
237 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('...
3
votes
2answers
57 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 "$...
0
votes
2answers
172 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
164 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 ...
2
votes
0answers
379 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
0answers
33 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
2answers
324 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
133 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 ...
3
votes
2answers
2k views

Custom API specify multidimensional parameter

I already created custom api where I am able to pass array item (for example $data = array('date'=>'2013-12-22','operation'=>'import','successful'=>'1', 'requeue'=>'0');) but I would ...
3
votes
1answer
3k 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! ...