Current product increment for each product is set to 24, I want to allow admin to create a order from backend without any increment,any qty should be added, but right now it gives error "The fewest you may purchase is 24"
I have tried to change function get Config qty increment,to disable the qty increment for admin but not worked, sharing code:
di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\CatalogInventory\Model\Configuration">
<plugin name="custom_get_QtyIncrement" type="Vendor\Module\Plugin\QtyIncrement" sortOrder="1" disabled="false"/>
</type>
Vendor/Module/Plugin/QtyIncrement.php
<?php
namespace Vendor\Module\Plugin;
use Magento\Backend\Model\Auth\Session as BackendSession;
class QtyIncrement
{
/**
* @var BackendSession
*/
protected $_backendSession;
public function __construct(
BackendSession $backendSession
)
{
$this->_backendSession = $backendSession;
}
public function afterGetEnableQtyIncrements(\Magento\CatalogInventory\Model\Configuration $subject, $result)
{
if ($this->_backendSession->isLoggedIn()) {
$result = 0;
}
return $result;
}
}
any help would be greatly appreciated. Thanks.