Questions tagged [join-table]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
24 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 ...
0
votes
0answers
13 views

Magento 2 : Join customer collection with custom collection

\Block\Account\Message\Message.php public function getAffiliateCustomerCollection() { $customerId = $this->customerSession->getCustomer()->getId(); $...
0
votes
0answers
26 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\...
0
votes
1answer
74 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 ...
0
votes
1answer
32 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 ...
2
votes
1answer
43 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(); $...
1
vote
1answer
380 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
54 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
75 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
45 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
78 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
101 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
112 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
43 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
30 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
328 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
60 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 ...
3
votes
2answers
885 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
976 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
170 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
54 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
263 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 ...
1
vote
3answers
1k 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
63 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
568 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
262 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
109 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....
6
votes
0answers
385 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: ...
2
votes
2answers
264 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
197 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
342 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
387 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
727 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
125 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
85 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
254 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
761 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
828 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
408 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
256 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
514 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
454 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
12k 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
921 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 ...
6
votes
1answer
9k 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
924 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
376 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 ...