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.

3
votes
2answers
43 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
50 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
61 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
33 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
22 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
46 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
21 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
39 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
46 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 "$...
1
vote
3answers
59 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
28 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
28 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
20 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
100 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
27 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
0answers
40 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
256 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
90 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
42 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')->...
0
votes
2answers
232 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
98 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
4answers
175 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
588 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
108 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
162 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
292 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
298 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
253 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
1k 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
381 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
53 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
286 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
61 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
66 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
251 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
253 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
265 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
167 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
80 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->...
2
votes
1answer
1k views

class [] does not exist for custom extension_attributes over webapi

I created a custom module to store the details of discount per items. I have a custom tables to store informations (quote items, order items, invoice items), and I use a extension attributes to link ...
0
votes
0answers
262 views

How to add , another model collection data to an array. : magento 1.9

I have response collection $customerData, i have to add referral code of selected customers in the same array, model and field of referral code is : $referCustomer = Mage::getModel('...
0
votes
1answer
95 views

If multiple items are ordered they should have their own line item section

Here is my Code:- $orderIncrementId = "1000001"; $orderCollection = Mage::getModel('sales/order'); $orderCollection->loadByIncrementId($orderIncrementId); $order_data = $...
1
vote
0answers
456 views

Passing array between phtml files returns warning in system.log

I've been searching and reading about passing data between phtml files in the last couple of hours but I haven't find a solution to my problem. I'm passing an array with a product object and a ...
0
votes
1answer
1k views

Magento : how to get certain element value from array - object

below you can see the value genrate through print_r when i am trying get value of $post->PostContent() - return value is "post 1111111111111111Read More" but i want to get second value that is - "...
1
vote
2answers
89 views

Checking if an attribute exists within an array of loaded attributes

I have an array of makes and values printed as following: $name='makemagento'; $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem(); ...
0
votes
1answer
24 views

Extract higher and lower price list products

I need to extract the higher and lower price in category page. My script: <?php if($_product->isConfigurable()) { //get associative (child) products $childProducts = Mage:...
1
vote
1answer
35 views

If I add a product to my cart, is there a way to track that sku on all pages?

I have been trying this to retrieve them and it works fine on Product detail pages. $data = array(); // PDP if ($module === 'catalog' && $controller === 'product' && $action === 'view'...
0
votes
1answer
569 views

Get array of all active category ID's

How do I get an array containing the ID's of all active categories?