Questions tagged [join]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
1answer
10k views

How to join custom table with product collection

I have created a custom vendor module. How can i get vendor name along with product collection?. Mine have a vendor attribute whose values comes from vendor module. I tried $collection = Mage::...
0
votes
1answer
11k views

catalog_product_collection_load_before and getLoadedProductCollection

I have a strange problem, which gives me the feeling i missed some concept: In an observer triggered via event dispatch <catalog_product_collection_load_before> i fetch the collection and do a ...
13
votes
1answer
29k views

How to use group by in magento collection with join query

In module's admin grid I am using this code to get collection and group them by customer id $collection = Mage::getModel('referafriend/statistics')->getCollection(); $collection->getSelect()-&...
3
votes
1answer
2k views

Cannot sorting joined column in Magento Grid

I have joined 2 columns to customer grid, I can make them filterable but I don't know how to make them sortable. Here is my _prepareCollection function: protected function _prepareCollection() { ...
4
votes
3answers
4k views

How to join a calculated column from a table to collection

I have a table name stat_customer look like this: I want to add a column page_view to customer collection to show at grid page. page_view is total page view of product page for each customer. My SQL ...
6
votes
1answer
4k views

Best sellers block from joining product collection with the monthly bestseller aggregation

So we're trying to implement a best sellers block on the Magento homepage using this example provided by Inchoo... Only problem is though, when I dissect the SQL select query, which is the below, the ...
3
votes
1answer
853 views

How to sort products by bestsellers (e.g. by sales) in Magento 2

these days I've faced a problem: I needed to to sort products by sales. So, first of all I decided to add this field to collection of products and the order it using method $collection->setOrder(). ...
1
vote
2answers
124 views

magento2 join query

I want to join the main table code with the product_options value giftcard_created_codes My query till now $this->getSelect()->joinLeft(['secondTable' => $this->getTable('...
0
votes
1answer
525 views

Remove the single quotes from join

I have this magento code : $subquery = new \Zend_Db_Expr('SELECT DISTINCT value from catalog_product_entity_int where row_id in (select row_id from catalog_product_entity_int where attribute_id = 97 ...
0
votes
1answer
2k views

How to join Sales order collection and order item collection

I want to join the sales order collection and sales order item collection How to join the two collection I have collections like order collection > $ordercollection=$this->orderCollection-...