Questions tagged [join-table]

The tag has no usage guidance.

26 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
1k views

Join table for grid Magento 2 not working

I tried to create a join to select data for my grid table in Magento 2 but the problem I am always getting is an empty record for alias that I wanted to use in my grid. Please refer the below image: ...
simple guy's user avatar
  • 2,474
5 votes
1 answer
744 views

How do I make this custom expression column I have developed for the customer grid display sortable?

I'm trying to add an expression column to collection in customer grid. But it not sortable. I'm not sure that using addExpressionAttributeToSelect or addExpressionFieldToSelect function can solve this ...
HungDQ's user avatar
  • 792
2 votes
0 answers
112 views

Join customer_entity snd catalog_product_entity by custom attribute

I use Magento 2 I need to display some data from customer and product in admin grid panel and I wonder how to join catalog_product_entity table with customer_entity. I added custom attribute to ...
Dominik Adamski's user avatar
2 votes
2 answers
2k views

Create Admin grid from join table collection

I'm new to magento 2, I have a query to join multiple table, only 1 custom table I've made and the rest is from Magento 2, the query looks like this: SELECT marketplace_orders.entity_id as id, ...
mileven's user avatar
  • 419
2 votes
1 answer
1k views

Relationship between catalog_product_entity and cataloginventory_stock_item

I am trying to join these 2 tables together to get all the attributes I need from the group of Product Entity tables and join them with the remaining quantity in stock from the Stock Item table. ...
13579246813579's user avatar
1 vote
0 answers
424 views

Magento 2 Custom grid join with product table filter is not working

I've created a custom grid using Ui Component, In my custom table I have a product_id, So instead of showing the product_id, I like to show the product name in my grid so that I have added the below ...
senthil's user avatar
  • 1,707
1 vote
0 answers
273 views

Magento 2 : Join customer collection with custom collection

\Block\Account\Message\Message.php public function getAffiliateCustomerCollection() { $customerId = $this->customerSession->getCustomer()->getId(); $...
ashanr's user avatar
  • 115
1 vote
0 answers
100 views

Magento 2: join 2 table join issue

When 'm trying to join two tables in Magento 2, I get an empty result. This is the initial function that returns data from single table customer_entity without any error. \Block\Account\Message\...
ashanr's user avatar
  • 115
1 vote
1 answer
604 views

M2.1.9 - How to add company column from `sales_order_address` into Sales/Order grid when it comes to joining tables

I was trying to add company column from sales_order_address into Sales/Order grid when it comes to joining tables. But it doesn't work well. Could you review my code? And i referred to this post : How ...
3CE's user avatar
  • 594
1 vote
0 answers
419 views

how to join Query for particular customer group and custom customer_entity_varchar attribute?

Here in my collection -> Table structure is : 1,id, mydb,table_name,INT UNSIGNED,,10,3,0 2,userid, mydb,table_name,INT UNSIGNED,,10,5,0 3,transctionid, mydb,table_name,...
supriya mishra's user avatar
1 vote
0 answers
746 views

Magento 2 : Get Data From Two Tables or Model

I have created ui component and it works fine, I added data provider file and customized my getData function:- public function getData() { if (!$this->getCollection()->isLoaded()) { ...
arushi's user avatar
  • 790
0 votes
1 answer
428 views

Product collection join with custom table undefined column

I am working with some product collection join with custom table, I've a custom product attribute, need to add a join condition with the product custom attribute with the custom table attribute. The ...
senthil's user avatar
  • 1,707
0 votes
1 answer
168 views

Magento 2 Admin - Base table or view not found

I have 5 different domains for a Magento 2 installation - 4 websites and 1 admin side. I got a spontaneous exception when I'm trying to get access to an admin login form by admin URL(it was ok before, ...
Duddy Woody's user avatar
0 votes
1 answer
97 views

Magento 2: After product collection join getting Allowed memory size exhausted error

I am trying to join "catalog_category_product" table custom column to product collection like this, public function beforeSetCollection( \Magento\Catalog\Block\Product\ProductList\...
Pratik Dhamane's user avatar
0 votes
1 answer
163 views

Magento 2: How to Show different quantity for specific product type in product grid?

I have a custom table for specific product type to store the product qty, the query to select the qty is like this for example: SELECT a.qty FROM custom_product_table WHERE product_id = 1; i noticed ...
blue's user avatar
  • 118
0 votes
0 answers
128 views

Assoicated Products relation with Main Products, SQL Query

Our magento store products have three drop downs like color, size & weight. The price of main product changes when we select from size or weight etc. Stuck to run a query to get assoicated ...
ahmed's user avatar
  • 43
0 votes
1 answer
1k views

Use join table to display data in admin grid column

How can I use join table to display second table data in admin grid? Admin grid is created using layout & block in proper manner. I used this link (how to create a grid without using ui component ...
Arjun's user avatar
  • 3,556
0 votes
2 answers
292 views

Magento 2 Product Listing Issue:- You cannot define a correlation name 'mp' more than once

I'm trying to join custom table on product listing page,here is the Class and method:- Class:- vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php Method:- setCollection() Here is ...
Wakar Ahamad's user avatar
0 votes
1 answer
49 views

How can get custom table columns on product listing page using product_id of the custom table

On product listing page, I need to show visitor nearest product first. I've a marketplace site and each product have different seller and there is a custom table having seller_id and product_id ...
Wakar Ahamad's user avatar
0 votes
1 answer
1k views

Magento 2 Convert backend admin grid to use joint table

What are the step I need to take to convert my backend admin grid to use a joint table I have my grid example with column id and name id comes from the mainTable and name from the secondtable: I ...
Juliano Vargas's user avatar
0 votes
0 answers
463 views

Join a calculated column from a table to a collection

I am creating custom admin grid in Magento 1. I want to show all wishlist with some data like id, date_created etc. and also total value of each wishlist. I am working with some modified Magento 1 ...
puntable's user avatar
  • 518
0 votes
1 answer
168 views

Magento 1: How to join these tables to get the result

$collection = $this->_prepareEntityCollection(Mage::getResourceModel('customer/customer_collection')); foreach($collection as $customer){ $_orders = Mage::getModel('sales/order')-&...
Rita Jose's user avatar
  • 1,842
0 votes
1 answer
130 views

M2.1.9- I used the method which joining table when adding column to order grid. But it is so slow and filter function disappear

There, I used the method which joining table when adding new column to order grid. A new column is for company name and its information is from sales_order_address, not sales_order. I succeeded to ...
3CE's user avatar
  • 594
0 votes
1 answer
562 views

join group_price to product collection

When I get the product collection with : $collection = Mage::getModel('catalog/product')->getCollection(); I get the group_price key but it's empty. Array ( [entity_id] => 1 [...
vhanahrni's user avatar
  • 111
0 votes
1 answer
510 views

Sort product collection by select attribute's option value sort_order - how?

I am trying to sort a product collection by an attribute that is of the 'select' type with lots of option values, all of which have sort order positions set. My attribute is called 'style'. When I ...
Henry's Cat's user avatar
  • 2,045
0 votes
2 answers
972 views

After join the customer name with custom module, i can't filter the grid by customer name

I create a custom module for product question. I added in my db the customer_id, but in the grid I want to show the name of customer. For that I did a join with customer_entity_varchar and got the ...
Claudiu's user avatar