Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
63 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
84 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
278 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
300 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
300 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
190 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
81 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
285 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
102 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
507 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
105 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
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
608 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
570 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
39 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
553 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
64 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
57 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
100 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
157 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
51 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
168 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
47 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
42 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
839 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
498 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 ...
0
votes
1answer
172 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 ...
2
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
47 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
61 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
13k 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
1answer
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
127 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
217 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 ...
0
votes
1answer
304 views

How to intersect 2 collections in Magento

I have 2 lists of countries: the default directory/country list and another one from an extension. I want to display only the values from the Magento list that are common between the two values. The ...
-1
votes
2answers
229 views

shorthand array declaration causing error [closed]

This causes no error: $orders = array('position' => 'Position', 'name' => 'Name', 'price' => 'Price', 'sort_parent' => 'Featured', 'sort_child' => 'Product Group'); This does: ...
0
votes
2answers
2k views

How to get array value in post?

We have develop own module for wedding planner. We post multiple products with description on form submit. How to get the "wedding" array in the below values. Array ( [weeding] => Array ...
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
222 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->...
1
vote
1answer
1k 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\...
0
votes
1answer
334 views

Repeater Attributes

I am trying to create an attribute which can be repeated any number of times for a page. I am wondering how I can implement something like this with Magento attributes. For example on the page there ...