Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
518 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
471 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
386 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
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! ...
0
votes
1answer
537 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
65 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
431 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 ...
0
votes
1answer
110 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
97 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
314 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&...
0
votes
1answer
433 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":...
2
votes
0answers
386 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
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 = $...
0
votes
2answers
89 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
350 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
117 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
579 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
2k 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
154 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
25 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
36 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
662 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
657 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
44 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
649 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
71 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
50 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
58 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
108 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
184 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
58 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
177 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
51 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
50 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 ( [...
0
votes
3answers
1k views

How To Fetch And Display Last 4 Table Rows?

The following code currently outputs the first row matching the criteria is_read != 1', 'is_remove != 1'. I need to modify this code to output the last 4 table rows that matches said criteria. I tried ...
0
votes
3answers
4k views

Programatically get parent ids of products of array

I am working on module and want to fetch parent product ids of child product. If it exists. I am using following line of codes, $parentIds = Mage::getModel('catalog/product_type_configurable')->...
0
votes
1answer
2k views

How to append array value in magento session?

Just I want to append array value in magento session data Mage::getSingleton( 'core/session' )->setData( 'createArrayDefault', array(3)); Mage::getSingleton( 'core/session' )->setData( '...
3
votes
1answer
551 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 ...
1
vote
1answer
184 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 ...
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 ...
-1
votes
1answer
50 views

Convert response to readable form

I am posting request to paypal using curl. Please check following code $url = 'https://api-3t.sandbox.paypal.com/nvp'; $request = array(); $request['USER'] = 'username' ; --- sending other ...
1
vote
0answers
63 views

Get single dimensional php array from model getData [closed]

From my model collection I got the list of data, which is in format - array(0 => "first", "1" => "second", ...). Is it possible to get the data in a normal single dimensional php array like ...
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->...
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 ...
0
votes
1answer
131 views

Removing value from array

Need help trying to remove a array value (Customer ID) from a attribute array value in a collection //unfollowAction //Get Model to save data to. $model = Mage::getModel("userprofiles/userprofiles"...
0
votes
3answers
1k views

how to show array value label?

I have an array: $type = array( 0 => "Car", 1 => "SUV", 2 => "Truck", 3 => "Bike" ); When a user selects the options from a form, the associated value is stored in a ...
1
vote
0answers
223 views

Check Magento volume discount condition manually [closed]

i want to Check Magento volume discount condition manually for show notification message to customer shop $xx more to get Y% discount. see this post I want to show next best volume discount to ...