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

Not working at all in Magento 1.9 #3

Open
sasoriza opened this issue May 28, 2015 · 11 comments
Open

Not working at all in Magento 1.9 #3

sasoriza opened this issue May 28, 2015 · 11 comments

Comments

@sasoriza
Copy link

I see no change in my catalog if this extension is running.

@tavinus
Copy link

tavinus commented Apr 8, 2016

Working here on Magento 1.9.1, but not working on searches. Is there any backend at all for this?
Actually, it was now breaking my site when searching.
Removing the extension fixed it.
Tried a few extensions and they either do nothing on the search or break everything all together.

Ok, so my problem seems to be a conflict with the Smartwave_AJAXCatalog. Checking both modules I can confirm they rewrite the same files for Catalogs and Searches. On catalog there are no methods conflicting, but on search they both redefine prepareProductCollection($collection). The Smartwave one doesn't use the parent function at all.

I also noticed that you guys return $this and they return $catalog.

So far I tried extending one another, disabling them, integrating the code, all with no success. I think the Smartwave thing came with my theme, but I am not sure because I was not the one to install it.

@billyparker6
Copy link

Unfortunately I am having the same issue as tavinus. I am also running Smartwave_AJAXCatalog. I have tried to delete the extension but breaks the site :(

@billyparker6
Copy link

also using false in the RicardoMartins_OutofstockLast.xml is not working for me

@billyparker6
Copy link

Update, managed to disable using false in RicardoMartins_OutofstockLast.xml

@popovserhii
Copy link

popovserhii commented May 22, 2017

Core magento developers have improved code in 1.9.3.
That mean you can change method in app/code/community/RicardoMartins/OutofstockLast/Model/CatalogSearch/Mysql4/Fulltext/Collection.php

<?php
public function setOrder($attribute, $dir = 'desc')
{
	if ($attribute == 'relevance') {
		$this->getSelect()->order("on_top DESC")->order("relevance {$dir}");
	}
	else {
		parent::setOrder('on_top', 'DESC');
		parent::setOrder($attribute, $dir);
	}
	return $this;
}

to

public function setOrder($attribute, $dir = 'desc')
{
	parent::setOrder('on_top', 'DESC');
	parent::setOrder($attribute, $dir);

	return $this;
}

After this modification all should work fine.

@willgoulding
Copy link

Hi @popovsergiy

I made the change you suggested. But it's not working.

Magento 1.9.3.1

Link: https://www.pood.com.br/feminino/roupas/tops.html

Would you have another tip?

Thank you!

@gicelte
Copy link

gicelte commented Jul 12, 2017

@willgoulding : any solution for this? I have the same issue: this extension is broken on product searches in Magento 1.9.

I fixed the crash by modifying app/code/local/Mage/Catalog/Block/Product/List.php, changing the code of _getProductCollection() to:

 $this->_productCollection = $layer->getProductCollection()->joinField(
                    'inventory_in_stock',
                    'cataloginventory_stock_item',
                    'is_in_stock',
                    'product_id=entity_id',
                    '`at_inventory_in_stock`.`is_in_stock`>=0', // was 'is_in_stock>=0' here
                    'left')
                ->addAttributeToSort('inventory_in_stock', 'desc');

Now the searches return, but the Out of Stock products are still mixed with the In Stock ones...

Anyone knows why?

@alvaroGomides
Copy link
Contributor

This solved for me: fauzi-ar@41faf1b

@bohomagic
Copy link

Hi,
This works perfect on regular categories but not on search results.
I tried all fixes to solve the search issue, but nothings worked for me...
Any other ideas?

Thanks

@tavinus
Copy link

tavinus commented Dec 14, 2017

It is almost always because of a conflict between modules.
What happens is that you have two modules overriding the same method/function and then only one of them gets executed. So you will probably need to merge the methods somehow if you want to keep both extensions.

In this case, there are two modules overriding the search.

There are some modules that will check for conflicts (they will tell you what files override the same class for example). Otherwise you will have to do it manually or even using find or grep from cli.

This article explains a bit more and also have some links for some extensions for checking conflicts. If you are afraid to install these checkers on your site, you could use them at a separate clone, find the conflicts and then apply the same fix do the main site (without ever installing the checkers at the main site).

Your log may also point you to the files where the conflict occurs.

Hope this helps...
Cheers!

@bohomagic
Copy link

bohomagic commented Dec 18, 2017 via email

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

8 participants