Today we are going to share that how to get the actual salable quantity on the product detail page?
Let’s say our requirement is to show available qty on the site
You can use the below code by using object manager directly use in your phtml file.
1 2 3 4 5 6 7 |
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); echo __('Quantity available: '); $StockState = $objectManager->get('\Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku'); $qty = $StockState->execute($_product->getSku()); echo $qty[0]['qty']; ?> |
That’s it.
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-6287695564967878456447/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...