Questions tagged [join-table]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
68 views

Magento2 join product details in sales order grid as filterable column

We have added some additional sortable / filterable columns to sales order grid using some basic joins. This would be the relevant code regarding data app/code/Vendor/Module/etc/di.xml <?xml ...
Raul Sanchez's user avatar
  • 3,174
0 votes
1 answer
375 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
152 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
639 views

how to join sales_order_address table with sales collection factory

If I already have the function (last 30 minutes order cron job)below to get sales_order_grid table data, how can I join table to get sales_order_address table and get country_id, city and postal_code? ...
Paul Fan's user avatar
  • 614
0 votes
1 answer
91 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
1 vote
1 answer
590 views

How to add columns to customer address grid in admin?

I have to add two fields to the customer's address grid, for this I have to add a left join to the Magento collection. I have created the following custom module: Vendor/Module/registration.php <?...
Noty's user avatar
  • 66
0 votes
1 answer
159 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
1 vote
0 answers
404 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
0 votes
1 answer
53 views

Magento 2.3.4 Custom uiComponent admin form joint table Add New gives ambiguous query

Collection: protected function _initSelect() { parent::_initSelect(); $this->getSelect()->joinLeft( ['secondTable' => $this->getTable('...
Juliano Vargas's user avatar
1 vote
1 answer
625 views

Use of sub query within collection in Magento

I am using a subquery in Magento collection, Here is my code. $websiteId = $this->storeManager->getStore()->getWebsiteId(); $collection = $this->_productCollectionFactory->create(); $...
Jafar Pinjar's user avatar
  • 1,889
1 vote
1 answer
110 views

join() is not working

I am trying to show data of order/sales by country into admin grid, so I am joining two tables sales_order_grid and sales_order_address in my Collection.php Here is my code use Magento\Framework\...
Sagar Parikh's user avatar
1 vote
1 answer
69 views

How to join tables and retrive data

I want to join entity_id column from customer_entity table with customer_id from new_info table and want to get department column value of given customer.
Akash Killedar's user avatar
0 votes
0 answers
124 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
1 vote
0 answers
265 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
97 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
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,526
0 votes
1 answer
760 views

Magento2 : How To Get First Table Column From Join Query Result(From Duplicate Columns)

Table1 - col_name col_city col_tid Table 2 - col_id col_city In Magento2 i want col_name,col_city from Table1 And col_id from Table2 Using Join Query And col_city is in both table so i just want ...
Sanjay Shiyal's user avatar
2 votes
1 answer
675 views

Join from custom table to customer_entity table and get all data customer in Magento 2

I used this code but it not working. Please help me! $customerEntity = $locationList->getTable('customer_entity'); $locationList = $this->mpSellerMapLocatorModel->getCollection(); $...
TN98's user avatar
  • 923
1 vote
1 answer
2k views

Magento 2: How to join product collection to custom table?

example: i have a table "table_1" i want to join product collection to get the product data? but I don't know how to join product collection? so everybody can help me pls? List item
NewBie's user avatar
  • 365
1 vote
1 answer
468 views

How to add product attribute value in custom collection?

I have a custom table which contains product id, I want to add an extra attribute column. so how can I get dropdown attribute value of the product in my custom table? if the dropdown attribute is not ...
user avatar
0 votes
2 answers
288 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
1 vote
1 answer
793 views

Magento 1: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous

I am getting the Error: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous SELECT `main_table`.*, CONCAT(soa.firstname,' ', soa.lastname,'', soa.street,'', soa....
Mastafis's user avatar
  • 187
0 votes
1 answer
631 views

Join in magento 2 Ratings and Review

I am trying to fecth data form review and rating_option_vote. i need all values of rating and all Rating count group by Rating Id. public function getRatingSummeryByAttribute($currentProductId) { ...
sudo55's user avatar
  • 994
0 votes
1 answer
1k views

Magento2 use Multiple LIKE operator in Join Query

I have used Join query,in which i'm able to fetch only one row by below query where $productId = 10 $collection->getSelect()->where('paproduct.product_id = (?)', $productId); I want to use ...
Ketan Borada's user avatar
  • 2,593
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
2 votes
0 answers
109 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
3 votes
2 answers
3k views

Error Filtering grid from joined table collection

I successfully create a custom customer grid which use select join, the problem is i concat customer first name and customer last name as a new column alias, and when i filter the column it shows ...
Idham Choudry's user avatar
0 votes
1 answer
2k views

Magento 2 Join table customer entity and customer address entity

I am trying to join customer entity table and customer address entity table. I am getting error in below code. What could be the issue $agency_name=$customerData->getDefaultShippingAddress(...
Melvin's user avatar
  • 43
0 votes
1 answer
636 views

How to get customer ID in Collection _initSelect method in magento2?

I want customerId in _initselect method. How can I achieve this ? protected function _initSelect() { parent::_initSelect(); $this->getSelect()->joinLeft( ['cp1' => $this->...
Rutvee Sojitra's user avatar
0 votes
1 answer
84 views

Getting issues while export Attribute Description in Magento 2

Export Script to export attribute and its options. It exports attribute and its options perfectly. But I am trying to get the attribute description by joining this $select_attribs = $connection->...
Jaisa's user avatar
  • 2,522
0 votes
2 answers
773 views

Magento 2.2 - Load eav attribute data for every product on collection load

I've created a multiselect custom eav attribute based on a flat table, so I used a dataSource, for a product everything is working fine, API (SOAP & REST), display on the product page etc but I'd ...
Shot's user avatar
  • 1
2 votes
3 answers
4k views

How to JOIN TABLES with WHERE clause in Magento 1.9?

I want to join two tables, the customer_entity, and customer_entity_varchar. but I have no idea how to do it. This is my current query: Let's assume I the entity_id is 5 and attribute_id is 139. $...
larp's user avatar
  • 281
0 votes
1 answer
273 views

Magento 2: What's best way to convert MySql to Magento

I've below MySql query, I would like to change use it in Magento format. How can i do that ? SELECT customer_entity_varchar.value, customer_entity_text.value from customer_entity INNER JOIN ...
anonymous's user avatar
  • 3,724
0 votes
1 answer
2k views

Magento 2 : Join 2 tables in Existing collection

I've been trying to join 2 tables with the existing collection of Customers (customer_entity). I've added like below. $items->getSelect()->join('customer_entity_text as second', 'main_table....
anonymous's user avatar
  • 3,724
0 votes
1 answer
757 views

Magento 1.9 join table issue

I'm having an issue with Magento 1.9.2.4 trying to make a join on my collection, here's the problem: Actually I've got a custom table named product_banner which I'm getting by: $collection = Mage::...
Pedro de Albuquerque's user avatar
0 votes
2 answers
435 views

Update database query Magento 1.9

I have following DB Query which is coming as expected. This Query came from the plugin Abandon Carts and I echoed the select Query. I have to edit this query to get the qty of each product in the cart....
Melvin's user avatar
  • 43
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,454
2 votes
2 answers
1k 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
0 votes
0 answers
446 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
4 answers
783 views

Join Query in magento 2

The below code entry is already in DB, Now I need to add one field to customer id and want to rerun this code via programmatically. $this->getSelect()->join( ['detail' =&...
Jaisa's user avatar
  • 2,522
0 votes
1 answer
894 views

Left join order grid collection using observer method. Magento 1.9

I'm trying to add a grid to order listing table following this awesome blog which works if all code copied but I'm unable to customize it. And I want to show the data from my custom table. I've ...
P S's user avatar
  • 1,983
2 votes
1 answer
1k views

Magento 2.2 - custom product sorting issue

I have override toolbar.php for custom sorting attribute. <?php namespace Vendor\Module\Block\Product\ProductList; class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar ...
Jigar Dhaduk's user avatar
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
128 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
1 vote
1 answer
590 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
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
3 votes
1 answer
2k views

Magento 2: Join EAV attribute from product attribute set on a custom flat table

Hi fellow programmers, I would like to know how to do a join on my custom flat table (i.e. discountrules), I've implemented a generic Repository based on the Pestle archive, which implements the ...
Merijn's user avatar
  • 152
0 votes
1 answer
561 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
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