woocommerce/woocommerce

New hook needed on \WC_Product_Data_Store_CPT::get_query_for_stock()

Chiusa

#27.040 aperta il 15 lug 2020

 (8 commenti) (0 reazioni) (0 assegnatari)PHP (10.695 fork)batch import
Data Structure/CRUD/Backend ProcessingEnhancementFluxGood First IssueProduct/Inventory Managementplugin: woocommerce

Metriche repository

Star
 (10.294 stelle)
Metriche merge PR
 (Merge medio 9g 12h) (423 PR mergiate in 30 g)

Descrizione

Since WC 4.3 and its new "reserved stock" functionality (that's great, btw), the \WC_Product_Data_Store_CPT::get_query_for_stock() method is being used internally to compare stock against the reserved stock table, but we have some plugins that are altering the stock sources and the value stored in the '_stock' meta is not the total available for these cases, so it would be great to have a filter over this SQL query to be able to change it when needed and get the correct stock there and avoid errors at checkout due to insufficient stock (when is not always correct).

Thanks.

Guida contributor