Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

observer for production collection load #9

Open
akkermanronald opened this issue Jun 27, 2016 · 1 comment
Open

observer for production collection load #9

akkermanronald opened this issue Jun 27, 2016 · 1 comment

Comments

@akkermanronald
Copy link

Hi Robert,

In app/code/community/Etailer/Backorders/etc/config.xml there is an observer for product collection load.

You add the field min_qty to the collection, for ANY product collection load. That's not good:

public function joinFieldsToCollection($observer)
{
    $collection = $observer->getCollection();
    $collection->joinField('min_qty',
            'cataloginventory/stock_item',
            'min_qty',
            'product_id=entity_id',
            '{{table}}.stock_id=1',
            'left');
}

This is causing an error "You cannot define a correlation name 'mycustomattribute' more than once"; see also http://stackoverflow.com/questions/10524017/magento-layered-navigation-you-cannot-define-a-correlation-name-mycustomattrib

Happy to sponsor module development; this functionality is crucial for one of our business cases. Are you considering to develop this module for M2?

Regards
Ronald

@rjocoleman
Copy link
Member

Hi Ronald,

https://github.com/etailer/Etailer_Backorders/blob/master/app/code/community/Etailer/Backorders/etc/config.xml#L41-L48

joinFieldsToCollection should only be invoked by that observer.

I'm not using this module in production myself and not intending to port it to Magento 2. I'm happy to take PRs but can't commit to active maintenance.

That said I'm happy to discuss your needs and if I'm able to help out creating something more appropriate for you - my email address is on my GitHub profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants