The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [collection]

Questions related to Magento collections

Filter by
Sorted by
Tagged with
0
votes
1answer
3k views

Product Collection for Default Category

I'm attempting to get a list of products that are only assigned to the default category and not assigned to any other categories. I tried the following: // default category id $categoryId = 2; $...
0
votes
1answer
695 views

Filter Collection with result of previous collection

I have doubts about what is more optimal or if there are better ways to filter collections with the result of a previous collection. I can do this: $orders_id = Mage::getModel("custom/custom_order"...
0
votes
1answer
36 views

Clean certain entries in DB through collection

I searched for a way to clean rows in DB, where something, through a resource collection call, but could not find relevant information. I.e., I have table with fields store_id , path , value and 400 ...
0
votes
1answer
333 views

Making a custom collection support pagination [duplicate]

I have the following collection. Basically, it returns a collection of customer entities joined with an attribute joined with the number of reward points which are going to expire for this month. $...
0
votes
1answer
277 views

Join on a collection

I'm working on a store that only has downloadable products in it. I need to get each customer's downloadable products and be able to sort them by product name and sku. My current code works in ...
0
votes
1answer
2k views

Filter on product listing using addAttributeToFilter

I've been asked to help upgrading a Magento shop from version 1.5.1 to Magento 1.8.1 I'm not a Magento developer, but have much experience with PHP. The previous developer added a way to filter ...
0
votes
1answer
130 views

using data from a collection to find link values

In, what feels like a never ending quest to teach myself Magento and use it at a practical level I have finally decided that I should dive into the code and learn how individual components are ...
0
votes
1answer
662 views

Filter simple products by price

In my project, I have a requirement where I need to filter simple products based on price. In default Magento, the filtering of price is based on configurable products. Some important points related ...
0
votes
1answer
1k views

How get collection of entities from eav_entity by custom type?

I created custom eav type: /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer = $this; $installer->startSetup(); $installer->addEntityType('av_photo_type', array( 'entity_model' ...
0
votes
2answers
28 views

Product collection retrieval N at a time (paginated)

I want to retrieve all the products. But would like to limit it to say 100 at a time to avoid too much memory usage. I have the collection factory injected in the constructor as \Magento\Catalog\...
0
votes
1answer
35 views

getCitiesAsOptions() [closed]

I try to get from collection, City ID and City Name, to put in module Meanbee/Shippingrules as new condition All it's good but on multtiple select filed I get city iD-s, I supose to get name as Label ...
0
votes
1answer
370 views

Display only selected record in magento form grid

I want to display only those record that is selected or match with db record on load. Untill i reset filter when reset filter it should show all record. This is my grid.php code. I tried with ...
0
votes
2answers
324 views

Catalog indexing semantically broken

I'm working on a site that has 3 root categories, one per store in the Magento installation. On the categories page (Catalog > Manage Categories) I can see the category ids and the number of products ...
-1
votes
1answer
720 views

$this->getProductCollection() returns only 15 items

I am using the following code for getting products in the beforeToHtml() function of a block, but when I get the products in the template file using $this->getProductCollection() it returns only 15 ...
-1
votes
1answer
20 views

Magento 1.x addFieldToFilter using AND instead of OR (how can I join search using AND)

I am trying to use AND and OR based on user input. OR = success But I an unable to setup AND queries for addFieldToFilter question: how can I add the second (looped filter) using AND to join $...
-1
votes
1answer
21 views

How can I equivalent the same sql by collection addFilter

My Sql is Below : SELECT `main_table`.* FROM `tab` AS `main_table` WHERE (`main_table`.`list_id` = '36') AND (`active` = '1') AND (`start_datetime` <= '2017-02-14 09:13:58') OR main_table.debug = ...
-1
votes
1answer
1k views

How to get WishList Product sku's or id's in phtml in Magento 2?

How can I get a customer wishlist product id's or sku's collection in phtml file in magento 2.
-1
votes
3answers
4k views

Change default category sort order by “in stock” [duplicate]

I'm trying to change the way my default "Best Value" view works for a category (both list/grid views) so that items which are "in stock" appear first and then out of stock items last. I have ...