3

After upgrading to Magento 2.3.3 product collections filtering with the is_saleable attribute no longer appears to work and the following error is seen in templates calling the collection :

The "is_saleable" attribute name is invalid. Reset the name and try again.

What is the correct way to filter product collections for saleable products in Magento 2.3.3?

3

When I raised similar question with theme devs for Porto theme which was getting error on the line

->addAttributeToFilter('is_saleable', 1, 'left')

citing 2nd attribute needed to be an array or null

they sent me back a patch simply removing the call to ->addAttributeToFilter('is_saleable', 1, 'left') and it seems to be working as before and shows only enabled products

go figure ...

1
  • sounds like something the porto devs would do... I guess it's a solution, but not the answer.
    – paj
    Oct 14 '19 at 12:32
0

can confirm this it seems is_saleable is no attribute in 2.3.3 .. the question is: what function had this attribute and what action did remove it? i have udpated to 2.3.3 on all my webshops and can not look if it was inside in 2.3.2 and before Best regards Markus

0

Try to change

magento/module-catalog/Model/ResourceModel/Product/Collection.php call addIsSaleableAttributeToFilter which require array argument.

->addAttributeToFilter('is_saleable', 1, 'left')

by

->addAttributeToFilter('is_saleable', ['eq' => 1], 'left')
1
  • Hello @Geraud issertes i am facing the same issue But does't solve problem Feb 14 '20 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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