Ecommerce Shopify WordPress Discussion

I have issue with custom stock quantity on the checkout page

I am having issue with the custom stock quantity, i have used following code to set the custom stock quantity according to my logic. Now lets say using code it sets the stock quantity 6 for that specific product and in product edit page the stock quantity is 4. Now the updated stock works fine until the checkout. When i click place order it shows the error message that "Not enough units of Cap are available in stock to fulfil this order.". Please let me know how to use the updated stock in checkout so it does not show this type of error. add_filter( 'woocommerce_product_get_stock_quantity', 'moshin_msp_get_stock_quantity_curr_role', 9999, 2 ); function mohsin_msp_get_stock_quantity_curr_role( $value, $product ) { if (mohsin_check_is_default_store($_SESSION['mssp_storeeee_idd'])) { return $value; } if (isset($_SESSION['mssp_storeeee_idd'])) { $meta_value = get_post_meta( $product->get_id(), 'msp_stock_qtyyy_' . $_SESSION['mssp_storeeee_idd'], true ); if ( ! empty( $meta_value ) && is_numeric( $meta_value ) ) { $value = $meta_value; } } return $value; }
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.