All Questions

Tagged with
0
votes
3answers
43 views

custom table left join with catalog/product

I have a custom table called flagged_products which lists flagged products like this: +-----------+------------+---------------------+ | entity_id | product_id | flagged_on | +-----------+---...
1
vote
0answers
59 views

How to redirect to 403 custom error page in magento2 from controller

I am trying to redirect to custom 403 error page. I have created plugin for controller as follow: etc\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
0
votes
0answers
47 views

Magento 2 - Apply filter on Product collection

Is there any common event or plugin to apply the filter to product collection which includes product list page, related products list as well as upsell and cross-sell product list? If no, then how ...
2
votes
1answer
121 views

Group Collection to Filter Unique Products Based on a Specific Attribute

Scenario: A store catalog is populated with configurable products each having several children with different sizes and colors. As the goal is to show the different color variations, only the ...
0
votes
1answer
156 views

Remove item from category collection in Magento 1.9

I have a category collection in Magento 1.9 This is my code :- $categories = Mage::getModel('catalog/category') ->getCollection() ->addAttributeToSelect('*') ->...
0
votes
1answer
405 views

Magento product collection override sort order with own order

I'm using Magento 1 and inside catalog/product/list.phtml I use the following code to add a custom sort order product_on_top: <?php $_productCollection=$this->getLoadedProductCollection(); $...
1
vote
0answers
41 views

Getting products in a category not under the current store's root

I would like to loop through a set of categories which are under a separate root, in order to generate a simple list of products. I put them under a separate root category because otherwise they end ...
0
votes
1answer
207 views

Clearing product collection in Product Listing without images - Magento 1.9

In our Magento project we have around 200 thousand skus and many of them are with incomplete information. So we made a filter to prevent products without images from appearing on the category pages. &...
0
votes
1answer
1k views

Configurable Product Collection and variants

Is there any way I can fetch all the variants of a configurable products from a product collection in Magento 2? Thanks! I would like to return the products including the attribute options and and ...
1
vote
1answer
600 views

Fetch details from catalog_product_flat_1 table

In catalog_product_flat_1 table, we created a custom column custom_uid & saving customer ids Assume below image is the catalog_product_flat_1 table. You can see the columns contain Product name ...
1
vote
1answer
583 views

rewrite ` Magento\Catalog\Model\ResourceModel\Product\Collection` showing error `Select' not found`

I am trying to override the class Magento\Catalog\Model\ResourceModel\Product\Collection On overwrite class, i got the error Fatal error: Class 'AmitBera\CoreRewrite\Model\Rewrite\Catalog\...
0
votes
2answers
2k views

Filter orders by specific product sku

I need to get order collection, Those orders have a specific product sku, Like I have a series of sku's "NT", So get all orders which are starting with "NT" $SKU = NP; $orders = array(); $collection =...
2
votes
1answer
603 views

Foreach loop taking long time in magento product collection with limit

I have following code in which I have join product collection with sales order item table. this query takes fraction of a seconds to execute but foreach loop after that takes around half minute while ...
1
vote
2answers
271 views

Custom Attribute no longer available in the TopMenu since Magento 2.1

In a Module I configured my custom attribute redirect_url for categories to be included in the collection using catalog_attributes.xml This seems to no longer work in Magento 2.1 My module defines ...
0
votes
1answer
158 views

Magento rewrite Mage_Adminhtml_Block_Catalog_Product_Grid

I'm doing a rewrite of: Mage_Adminhtml_Block_Catalog_Product_Grid I already done most of the job on my custom module. The function getStoreRestrictions() returns an array of all available stores view ...
1
vote
1answer
68 views

How to get all products that aren't in a specific category in Magento?

I'm having issue trying to get all the products that aren't in a specific category. Here's a code that works fine until I added the 'join-nin' query. $collection = Mage::getModel('catalog/product') ...
0
votes
3answers
597 views

Custom collection sort module returning collection but not sorting

I've created a module that is intended to allow me to add custom sort features to my catalog pages (my product collection). For whatever reason, it returns my collection no problem but fails to honor ...
1
vote
1answer
782 views

Sorting catalog page products by custom attributes programmatically

I am in the process of sorting products by attribute_set_id with the help of a custom module that extends Mage_Catalog_Model_Config. Here is my module's Model/Catalog/Config.php <?php class ...
17
votes
4answers
23k views

How can I fix “Item (Mage_Catalog_Model_Product) with the same id ”xxx“ already exist”?

I have been getting this error when trying to filter a products collection Item (Mage_Catalog_Model_Product) with the same id "6058" already exist and wanted to ask what could ne causing the error ...
1
vote
2answers
4k views

Linking back to specific current categories from the product view page

Current Scenario I'm trying to link back to a product's current category on the product pages themselves, something along the lines of 'View more Mira Showers from Showermania' (like the screenshot ...
1
vote
2answers
1k views

addFieldToFilter with like removing some characters in query

I have saved a url in the db. The url is: http://localhost/magento/index.php/electronics/cameras.html?cat=25&price=-100 $url = Mage::getSingleton('core/session')->getStateUrl(); $filterstate = Mage::...
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 ...
3
votes
3answers
10k views

Product image url as part of collection load

Is it possible to have the product image url loaded as part of the product collection? for examples: Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*'); This doesnt ...
1
vote
2answers
375 views

serious need of explanation with addSaleableFilterToCollection

I have spent days looking for a simple tutorial about adding filters to a product collection. If anyone has a link to a good tutorial or explantion I would really appreciate it. I found a Magento ...
3
votes
1answer
5k views

How do I get the minimal price of a grouped product from a product collection?

I'm loading all products using the product collection resource model. $_categoryId = $this->getCategoryId(); $_productCollection = Mage::getResourceModel('catalog/product_collection') -&...
4
votes
2answers
2k views

Add all flat-attributes to product collection?

How can I get a catalog/product collection with all attributes which are selected to be "used in product listing", i.e. are in the flat table?