elasticsuite icon indicating copy to clipboard operation
elasticsuite copied to clipboard

Configurable products shown in virtual category as discounted products, when they are not

Open dverkade opened this issue 7 years ago • 13 comments

Configurable products shown in virtual category as discounted products, when they are not

Preconditions

Magento Version : 2.2.3 ElasticSuite Version : 2.5.4 Environment : Production mode

Steps to reproduce

  1. Create a configurable product with different sizes. The price needs to be different per simple product.
  2. Create a virtual category where you have all products which are in stock & are discounted.

Expected result

  1. Configurable products where the simple price is different and which do not have a special price should not be shown in the virtual category.

Actual result

  1. Products are shown in the virtual category.

image image

dverkade avatar Apr 13 '18 19:04 dverkade

Confirmed when simple price are not all equals.

afoucret avatar Apr 16 '18 11:04 afoucret

Not sure how we could fix this one easily.

For now we rely on the catalog_product_index_price table and this does not seem to be enough to differentiate these 2 cases :

  • product has many children of different prices. These children have no special price. => should NOT have is_discounted. This is the case submitted in this issue.

  • one of the children product has a special price. => product should have is_discounted

any advice @afoucret ?

romainruaud avatar Apr 17 '18 14:04 romainruaud

Hello, any fix planned for this? or any work around available for now ?

moejoee91 avatar May 12 '18 02:05 moejoee91

Hi @moejoee91,

I am currently braimstorming on this one. The technical part is quite easy but this bug highlight a functional issue I will explained later. Without a clean functional solution it will be useless to solve this issue.

afoucret avatar May 14 '18 08:05 afoucret

We had this issues mentioned in #1140 and https://magento.stackexchange.com/questions/247097/price-filter-returns-wrong-results-price-ist-stored-as-0-insteal-of-null-and-i with the price index in 2.1.6 -- now we are on 2.1.8 and believe the price index is in a bit better shape

Simples work fine now, but configurables are wrongly tagged as is_discounted

  • min_price and max_price seem to be right
  • but price is now 0 in the index for configurables.

and is_discounted becomes true, which it should not.

The question we are asking ourselves now is, what should be the price for configurables in the price index -- actually I think "0" is quite correct, because normally a configurable does not have a price. But how could the is_discounted indexing then work of elastic suite?

amenk avatar May 15 '19 14:05 amenk

ping @romainruaud ;-)

amenk avatar May 21 '19 13:05 amenk

ElasticSuite is assuming that the price (actual price) is in min_price in the index and original price is in max_price in the index.

I think this is a basic design problem: If I have a configurable T-Shirts where S cost 9 € and M costs 10€ of course min_price is 9 and max_price is 10 --> then elasticsuite is assuming we have a discounted product.

amenk avatar May 22 '19 09:05 amenk

I am currently braimstorming on this one. The technical part is quite easy but this bug highlight a functional issue I will explained later. Without a clean functional solution it will be useless to solve this issue.

@afoucret Was there any result of the brainstorming :-D

amenk avatar May 22 '19 10:05 amenk

I am trying to tackle this but have problems to debug into

 \Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\PriceData::addData

Does anybody have a hint to to write a test which triggers that one? Currently I am saving a product and run the cron which is super cumbersome.... Trying to write an integration test for that but have to understand the architecture more

amenk avatar May 22 '19 10:05 amenk

@romainruaud @dverkade I developed a patch for this https://github.com/Smile-SA/elasticsuite/pull/1411

amenk avatar May 22 '19 11:05 amenk

Hello @afoucret,

I'm currently facing this issue, and I saw that you mentioned braimstorming about the problem (https://github.com/Smile-SA/elasticsuite/issues/866#issuecomment-388730916)

It's a bit old, but do you remember the conclusion?

Have a good weekend,

gkueny avatar Dec 19 '20 16:12 gkueny

Maybe a stupid question, but why you don't look inside the table catalogrule_product or catalogrule_product_price to get if a product has a catalog rule applied?

Mbertu avatar Jun 23 '21 16:06 Mbertu

Can someone reviewing my pull request? I think is better than previous one and for now works as expected on few production environments.

Bashev avatar Aug 19 '22 10:08 Bashev