Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [join-table]

The tag has no usage guidance.

1
vote
1answer
44 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
1
vote
1answer
36 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 ...
0
votes
0answers
39 views

Get custom join query using for order items collection of particular order magento 2

I want to get order items collection of particular order from custom join query magento 2 for User Order History Page.
0
votes
0answers
18 views

For heavier category(having 2000 products) ,category page takes 4-5 min to load, while for a small category( few products) it's working properly

I've used following two joins on product listing page due to which heavier category page taking 4-5 minutes to load:- Class:- vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php ...
0
votes
1answer
21 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 ...
0
votes
1answer
30 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 ...
1
vote
1answer
39 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....
0
votes
1answer
35 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) { ...
0
votes
1answer
44 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 ...
0
votes
0answers
32 views

Magento 2.2.3 Backend Admin Save.php Where Gird/Form Is a join table

How do To save data where grid and form has joint table? Ok. So I have 2 tables. employee +---------+------------------------+ | employee_id |employee_contact_id | +-------------+-------------------...
0
votes
0answers
29 views

Where can i find the device_name from which the order is placed in magento 2 db?

Need to know the list of the device names appended in the Magento platform and in which table is it rendering from? for example: "device_name": "Smartphone", "device_name": "Desktop"
0
votes
1answer
141 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 ...
2
votes
0answers
44 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 ...
2
votes
2answers
540 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 ...
0
votes
1answer
709 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(...
0
votes
1answer
121 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->...
0
votes
1answer
35 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->...
0
votes
2answers
219 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 ...
0
votes
0answers
101 views

How to add use index for join in magento left join

I have two queries - 1. Query $select = $this->_getReadAdapter()->select()->from(array('main_table' => $this->getMainStoreTable($category->getStoreId())), array('...
1
vote
3answers
752 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. $...
0
votes
1answer
58 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 ...
0
votes
1answer
387 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....
0
votes
1answer
167 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::...
0
votes
2answers
72 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....
7
votes
0answers
312 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: ...
3
votes
2answers
184 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, ...
0
votes
0answers
148 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 ...
0
votes
3answers
250 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' =&...
0
votes
1answer
293 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 ...
2
votes
1answer
679 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 ...
0
votes
1answer
108 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')-&...
0
votes
1answer
76 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 ...
0
votes
1answer
202 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 ...
1
vote
1answer
645 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. ...
2
votes
1answer
708 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 ...
0
votes
1answer
390 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 [...
1
vote
0answers
224 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,...
1
vote
1answer
420 views

Magento-2 : How to set admin form data by join tables

I have a custom admin module which store customer related data. My custom table created foreign key with customer_id. I displayed customer name, email in my module grid by join query, It's working ...
1
vote
2answers
1k views

Joining Products Table with Custom Module Table (Adding Product Thumbnails to Custom Grid)

I created a custom module with a grid and needed to display product thumbnail images there. Tried codes from the answer below and the thumbnails were added, BUT ALL MY OTHER COLUMNS IN THE GRID ARE ...
1
vote
0answers
398 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()) { ...
2
votes
3answers
10k views

Magento 2: join custom table with product collection while sql query is running fine

I trying to join custom table with product collection but I am not getting result. But printed SQL query is running fine namespace Vendor\Module\Block\Product; use Magento\Catalog\Api\...
1
vote
1answer
854 views

Magento 1.9.x - I want to join first name and last name in customer grid

I want to get fullname of customers in magento back-end server. I already brought the first name in index "NAME" and i want to join the lastname after first name. protected function ...
7
votes
1answer
8k views

How to join product collection of magento 2 to a custom table?

I have a custom table user_product_table with a field sku(this field join to product collection) and user. How can I join this table with product collection, so that I don't have to loop my custom ...
0
votes
1answer
846 views

join tables for get payment method of order id

I need to join 3 tables to get payment method of specific order id Let me explain my query. I have to load a custom_id and take saved order id from my table 'custom_data'. Now I want to find which ...
0
votes
1answer
356 views

How to LEFT-JOIN 'catalog/category' fields to 'sales/order_item' collection?

I'm trying to left-join some of the 'catalog/category' attributes to a 'sales/order_item' collection. For example: a satisfying result will let me add the category-name to the order-item data. *I ...
0
votes
1answer
409 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 ...
0
votes
1answer
703 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 ...
1
vote
2answers
1k views

How to Join an EAV to a Flat Table & Import Flat Table and Update EAV

This will be two parts 1.) Join an EAV to a Flat Table the Magento way 2.) Import into Flat Table that will update the EAV Table. Basically be able to Export(Flat Table) and Import(with flat table) ...
3
votes
2answers
615 views

joinLeft escape string from ON condition

I am wondering if it is possible to escape string inside ON condition, something like binding params inside where condition. This is my code $this->getSelect()->joinLeft( array('...
1
vote
1answer
99 views

How to join three tables for filteration?

I am applying filter on order collection. I am stuck in a situation, I have added a custom attribute to "customer address". that is in table "customer_address_entity_varchar", now I have to join ...