5

We don't use any feature of Mage_CatalogInventory and I disabled some of it in the system configuration, but there are still a lot MySQL Queries especially in the checkout, which took very long.

My first thought was to disable the Module, but the following core Modules depends on CatalogInventory: Mage_Checkout, Mage_Rss, Mage_XmlConnect.

My second thought was to disable all Observer, but I'am not sure if there are some correlation in the core, because the Module have 21 observed events.

Has anyone ever disable CatalogInventory and/or could share there experience?

//edit 1
I removed the <event> node from CatalogInventory to test it. The Message Not in stock appears. It looks like isSaleable returns false. Even if I hardcoded a return true; in isSaleable it didn't work.

//edit 2
All queries which are executed in the checkout process:

SELECT cataloginventory_stock_status`.`product_id, cataloginventory_stock_status`.`stock_status FROM cataloginventory_stock_status WHERE (product_id IN ([..])) AND (stock_id=?) AND (website_id=?)

SELECT `main_table`.*, cp_table`.`type_id, [..] FROM cataloginventory_stock_item AS main_table
INNER JOIN catalog_product_entity AS cp_table ON main_table.product_id = cp_table.entity_id
LEFT JOIN cataloginventory_stock_status AS status_table ON main_table.product_id=status_table.product_id AND main_table.stock_id=status_table.stock_id AND status_table.website_id=? WHERE (main_table`.`stock_id = ?) AND (main_table`.`product_id IN ([..]))

SELECT `main_table`.*, cp_table`.`type_id, [..] FROM cataloginventory_stock_item AS main_table
INNER JOIN catalog_product_entity AS cp_table ON main_table.product_id = cp_table.entity_id
LEFT JOIN cataloginventory_stock_status AS status_table ON main_table.product_id=status_table.product_id AND main_table.stock_id=status_table.stock_id AND status_table.website_id=? WHERE (main_table`.`stock_id = ?) AND (main_table`.`product_id IN ([..]))

SELECT `main_table`.*, cp_table`.`type_id, [..] FROM cataloginventory_stock_item AS main_table
INNER JOIN catalog_product_entity AS cp_table ON main_table.product_id = cp_table.entity_id
LEFT JOIN cataloginventory_stock_status AS status_table ON main_table.product_id=status_table.product_id AND main_table.stock_id=status_table.stock_id AND status_table.website_id=? WHERE (main_table`.`stock_id = ?) AND (main_table`.`product_id IN ([..]))

SELECT e`.`entity_id, cw`.`website_id, [..] FROM catalog_product_entity AS e
CROSS JOIN core_website AS cw
INNER JOIN core_store_group AS csg ON csg.group_id = cw.default_group_id
INNER JOIN core_store AS cs ON cs.store_id = csg.default_store_id
INNER JOIN catalog_product_website AS pw ON pw.product_id = e.entity_id AND pw.website_id = cw.website_id
CROSS JOIN cataloginventory_stock AS cis
LEFT JOIN cataloginventory_stock_item AS cisi ON cisi.stock_id = cis.stock_id AND cisi.product_id = e.entity_id
LEFT JOIN catalog_product_entity_int AS tad_status ON tad_status.entity_id = e.entity_id AND tad_status.attribute_id = ? AND tad_status.store_id = ?
LEFT JOIN catalog_product_entity_int AS tas_status O

INSERT INTO cataloginventory_stock_status (product_id,website_id,stock_id, [..] VALUES [..]

SELECT e`.`entity_id, cw`.`website_id, [..] FROM catalog_product_entity AS e
CROSS JOIN core_website AS cw
INNER JOIN core_store_group AS csg ON csg.group_id = cw.default_group_id
INNER JOIN core_store AS cs ON cs.store_id = csg.default_store_id
INNER JOIN catalog_product_website AS pw ON pw.product_id = e.entity_id AND pw.website_id = cw.website_id
CROSS JOIN cataloginventory_stock AS cis
LEFT JOIN cataloginventory_stock_item AS cisi ON cisi.stock_id = cis.stock_id AND cisi.product_id = e.entity_id
LEFT JOIN catalog_product_bundle_stock_index AS o ON o.entity_id = e.entity_id AND o.website_id = cw.website_id AND o.stock_id = cis.stock_id
INNER JOIN catalog_product_entity_int AS tad_status ON tad_status.entity_id = e.entity_id AND tad_status.attribute_i

INSERT INTO cataloginventory_stock_status (product_id,website_id,stock_id, [..] VALUES [..]

//edit 3
There are just a couple blocks in the frontend which didn't need a lot of ressources. There is a block for the qty limitation and inventory message. I disabled the output but can't measure a difference.

Here is my configuration. I tried to disable everything. Is there something I missed?

enter image description here

7
  • by disabling cataloginventory, do you want to stop using stock? – MTM Sep 23 '16 at 8:28
  • yes, that's my goal – Pawel Sep 23 '16 at 8:53
  • if you set default setting in configurations to manage stock to NO, you dont have to fill in the stock for products. – MTM Sep 23 '16 at 9:59
  • That's right, but Magento execute a lot sql queries and code, even if there is no stock for the products and that's a performance issue that bothers me. – Pawel Sep 23 '16 at 10:42
  • well magento is actually a shopping cart, if you want to skip a very base part of shopping cart then you will have to do lot of work. – MTM Sep 24 '16 at 14:29
2

@Pawel some of dependencies you mention are fake ones. For example, Mage_Checkout and Mage_XmlConnect modules don't use any logic from Mage_CatalogInventory module. Mage_Rss uses only one class constant from the inventory module.

You may try with Zookal Mock module. It removes fake dependency definitions and provides mocks for some classes. One of these mocks is Mage_CatalogInventory_Model_Stock_Item, class which is used in many places.

I've used that module in two projects and it helped me to disable a few modules. I didn't need to disable inventory one, but after looking into code I think it may work.

https://github.com/Zookal/magento-mock

1

The only thing you can disable via system config is block output and layout XML for that given module.

Set the module's activation flag to false.

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.