Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
2answers
33 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
24 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
23 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
103 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
43 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
28 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
43 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
167 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
83 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
138 views
+50

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
419 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
91 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
116 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
260 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
267 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
229 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
362 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
264 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
60 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
63 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
89 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
228 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
231 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
229 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
153 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
78 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
249 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
91 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
428 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
86 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
534 views

Get array of all active category ID's

How do I get an array containing the ID's of all active categories?
0
votes
1answer
522 views

Magento 2 add array to collection in Admin Block Grid

I am trying to add an array to collection in Block Admin Grid but i want able to do that, protected function _prepareCollection() { //echo "preparecollection function"; exit; $...
1
vote
0answers
37 views

Output Array with Matching IDs

I have 2 collection (customer and subinfo) that pull info from 2 separate database table. both table information are related and i needed to join/merge the info, which i have done. but unfortunately ...
0
votes
1answer
500 views

Working with collections, should I use function getData()

As in subject - while I am working with collections should I (after filtering etc.) get data with function getData()? I've heard an opinion that is rather for debugging, not real coding. If I use ...
0
votes
2answers
59 views

Undefined index on template file

I am attempting to echo out a message associated with a specific key in an array. I am getting undefined index and I cannot figure out why. My code is below: <h1>RocketSnail Dynamic Template ...
0
votes
1answer
49 views

adding new custom attribute product into cart remove the other cart products

I have an issue by adding custom attribute product into cart remove the other already added cart items. I have checked by applying base theme, disabling install module replace the fresh core files of ...
0
votes
1answer
56 views

loop only showing first value when using variable

I am trying to show products that are added in a custom attribute in the backend but it is only showing the first item <?php $bundle_products = $_product->getbundle_products(); if ($_product-&...
0
votes
3answers
98 views

arrange the array in table format [closed]

This is my array $_tierPrices = Array ( Array ( "price_qty" => "4", "price" => "143.00", "savePercent" => "8" ), ...
1
vote
0answers
146 views

Push an array of all sku's on a category page into my $data = array();

I want to list all sku's on a category page in a data array. Currently if i'm on a product detail page i can push the sku into my data array like this: if ($module === 'catalog' && $...
0
votes
1answer
44 views

On product import/cron my tax class field in admin is not being updated

I have this method inside of: parser/product.php These fields are what i'm targeting in the admin panel. Everything updates properly, if a product gets imported with a different price matching the ...
0
votes
1answer
156 views

How to get cart info using user_id or mail_id in magento custom coding?

I try user_id throw get cart detail my code is below but get o/p only array() not display array value give me suggestion error_reporting(0); include("../app/Mage.php"); umask(0); // Initialize ...
1
vote
1answer
43 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 $...
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.
0
votes
2answers
40 views

How to change the array values?

My data is in this format. I want it without wishlist_id, means simple values. How to change the array values? Array ( [0] => Array ( [wishlist_id] => 35 ) [1] => Array ( [...