tuyennn / magento2-outofstockatlast

Magento 2.4.x module Sort Out Of Stock Product At last the product list
GNU General Public License v3.0
55 stars 12 forks source link

Feature request: stock status of Configurable Product would be indexed based on child products. #46

Closed AlperenYavuz closed 1 year ago

AlperenYavuz commented 1 year ago

Preconditions (*)

  1. Magento 2.4.5-p2

Steps to reproduce (*)

  1. Login to Magento
  2. Go to Catalog > Products
  3. Edit a configurable product
  4. Go to Advanced inventory
  5. Set Manage stock to: no
  6. bin/magento ind:reindex

Expected result (*)

  1. stock status of Configurable products is indexed by child products and shown last in the list.

Actual result (*)

  1. stock status of Configurable products cannot be indexed by child products and is not shown last in the list.
tuyennn commented 1 year ago

@AlperenYavuz Set Manage Stock to No means this product can never be Out of Stock, set it to Yes before we can determine it's Instock or Out of stock. I think in this case you were wrong with the Manage Stock option, rather this would be a feature request.

Alperen3wa commented 1 year ago

@tuyennn The idea is that the configurable product itself should not have a stock status, but based on the stock status of the child products, it should be determined whether the configurable product is out of stock. So the configurable itself has no status, but if, for example, 2 out of 2 child products of this configurable product are out of stock, then this configurable product should be considered "out of stock" and should be shown last in the catalog list.

Manage stock should be set to no due to business criteria, unfortunately that's why I need such a workaround.

tuyennn commented 1 year ago

I understand, but while setting it to Yes, your expectation would be fulfilled.

As I've tested it works correctly with child products - configure product relationships. But with the Manage Stock: Yes.

Setting it to No means it's always In Stock, then how could it be an Out of Stock product?

Alperen3wa commented 1 year ago

@tuyennn Yes that is true and that makes it complicated. But can't it be ensured with a workaround that in this situation the configurable product is also shown at the end of the list just like the out of stock products?

tuyennn commented 1 year ago

@AlperenYavuz @Alperen3wa I close this issue since it was not in current scope we supported