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 the code of this method:-

 public function setCollection($collection)
        $this->_collection = $collection;

       //My Custom Code

         $mpJoinConditions = 'mp.mageproduct_id = e.entity_id';

                ['mp' => $this->_collection->getTable('marketplace_product')],

       // End of My Custom Code


        // we need to set pagination only if passed value integer and more that 0
        $limit = (int)$this->getLimit();
        if ($limit) {
        if ($this->getCurrentOrder()) {
            $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
        return $this;

But getting following issue:-

"You cannot define a correlation name 'mp' more than once"

Please help me to resolve the issue!!!

2 Answers 2


Used Tablename "marketplace_product" instead of using alias "mp" and it's working fine now.


This is very odd, although mp was defined only once, I tried your solution but didn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.