Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
18
votes
3answers
33k views

How to print array contents in log file?

How to print array contents into a log file in magento CE 1.7 without iterating through a loop?
9
votes
1answer
25k views

How to list all users

As part of an exercise I am trying to list all users email from my database on one page. So far the closest i've got is $user = mage::getModel('customer/customer')->getCollection()->getData(); ...
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 ...
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 ...
3
votes
2answers
2k views

Passing an array from block file to template file

I have a collection of Dealer Stores. I have implemented a function that calculates the distance of all stores from the location of the customer and i have an array of respective distances. I have ...
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! ...
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 ...
3
votes
1answer
542 views

iterate over array value not display in phtml

I´m trying to display Ebay GetSingleItem response (http://developer.ebay.com/devzone/shopping/docs/callref/GetSingleItem.html) and I´m having problems displaying array ["ItemSpecifics"]. The call is ...
3
votes
2answers
2k views

Getting all rows from database

i have an array string with id numbers example: $taxIds=array(9,13) how to fetch all record with this query?? $connection = Mage::getSingleton('core/resource')->getConnection('core_read'); $sql ...
3
votes
3answers
329 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
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
3answers
77 views

Need to get array values

Array ( [requestId] => 69a6#16a49c12847 [result] => Array ( [0] => Array ( [seq] => 0 [marketoGUID] =>...
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 "$...
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 ...
3
votes
1answer
376 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://...
2
votes
1answer
14k views

Get a list of media gallery image URL's from getMediaGalleryImages

I need to get a comma separated list of image URL's from a product's media gallery. I have successfully managed to load getMediaGalleryImages so that if I... var_dump ($product->...
2
votes
1answer
53 views

Strange arrays being output on front-end instead of website

Trying to setup version control on a pre-existing client's site. There have been a number of developers who have had their hands in this and I'm slowly modifying the .gitignore file in attempt to ...
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. */ ...
2
votes
1answer
224 views

Add asociated array to the Values retrieved before

I have this code, witch retrieves the values I need: <?php foreach($allProducts as $p): ?> <?php if(!$p->isSaleable()) continue; ?> <?php $out=$p->getAttributeText($pAtt->...
2
votes
3answers
244 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('...
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 ...
2
votes
1answer
2k views

Get category ID by category name

I have an array with 3 categories names: $arr = ['onecat','twocat','threecat']; How can I get the IDs from this categories? For example in other array.
2
votes
1answer
157 views

Exclude Parent category ids from array of category id's

Hi i'm having a product collection, i'm getting those categories by $item->getCategoryIds(); On print_r($categoryIds = $item->getCategoryIds()); i'm getting Array ( [0] => 12 [...
2
votes
1answer
98 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 - ...
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 ...
2
votes
1answer
246 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 ...
2
votes
0answers
382 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
2answers
533 views

Correct syntax for multiple category ID's in array

Trying to exclude the rendering of something based on category ID using the following... <?php if ($_category_id == 2) { ?> <?php //do nothing ?> <?php } else { ?> <?php /...
1
vote
2answers
222 views

Is there a way to split a customer text attribute in Magento?

I am trying to find a way to split a customer text attribute in order to display it on the frontend. I have added a new text field to the customer address and would like to display this value on the ...
1
vote
5answers
454 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
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
1answer
230 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); ...
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
1answer
507 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' =&...
1
vote
1answer
214 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 = $...
1
vote
1answer
183 views

Convert value to array label throughout frontend and admin?

So i have a form that saves customer vehicle info in the database with values representing each vehicle. I also have this array code in my model folder which should be used to display said numbers as ...
1
vote
1answer
1k views

How to load an address by street attribute

I can load an address using the following code: $addresses = $addressObj->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('firstname', $addressData['...
1
vote
1answer
566 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(), '...
1
vote
2answers
139 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
2answers
104 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
207 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\...
1
vote
1answer
329 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
3answers
773 views

Multiple url name and field addcolumn action

I have this code: $grid->addColumn('action',array( 'header' => $this->__('Action'), 'type' => 'action', 'action' => array( ...
1
vote
1answer
424 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
65 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 ...
1
vote
2answers
147 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(); ...
1
vote
1answer
50 views

Magento 1.7 Help with pulling values from array

I am trying to get some values from an array. my code below i need to get a comma separated values the values from the sku KEY, i am just not sure how to do it. Example output I need: sku,sku,sku $...
1
vote
1answer
1k views

How to pass dynamic values into an array

I'm creating a list of products, which is filtered to only show products within certain categories in Magento. I'm using the AddAttributeToFilter which is working fine: $products->...
1
vote
1answer
2k views

Magento CE 1.9.0.1 Array to string conversion Zend DB Adapter Pdo Abstract.php

I get this Error in Magento... /var/log/system.log since a few weeks, - CE 1.9.0.1 with Firegento, german localisation Mage_Setup ERR (3): Notice: Array to string conversion in ...\htdocs\magento\...
1
vote
1answer
59 views

Array is duplicating the results?

I am trying to insert multiple items on Db. It inserts successfully but when it comes to multiple items it duplicates it looks like am replacing on this array. Here is the code: $orderitems=$order-&...