|
|
|
|
|
|
|
|
public function actionAjaxProcessProductQuantityMax($idDistribution, $idProduct, $quantityMax) |
|
|
public function actionAjaxProcessProductQuantityMax($idDistribution, $idProduct, $quantityMax) |
|
|
{ |
|
|
{ |
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
|
|
|
|
|
$orderModule = $this->getOrderModule(); |
|
|
$productDistributionModule = $this->getProductDistributionModule(); |
|
|
$productDistributionModule = $this->getProductDistributionModule(); |
|
|
$productDistribution = $this->getProductDistribution($idProduct, $idDistribution); |
|
|
$productDistribution = $this->getProductDistribution($idProduct, $idDistribution); |
|
|
$productDistributionModule->updateProductDistributionQuantityMax($productDistribution, (float) $quantityMax); |
|
|
$productDistributionModule->updateProductDistributionQuantityMax($productDistribution, (float) $quantityMax); |
|
|
return [ |
|
|
return [ |
|
|
'quantity_remaining' => $this->getOrderModule()->getResolver() |
|
|
|
|
|
|
|
|
'quantity_max' => $orderModule->getResolver() |
|
|
|
|
|
->getProductQuantityMax( |
|
|
|
|
|
$productDistribution->product, |
|
|
|
|
|
$productDistribution->distribution |
|
|
|
|
|
), |
|
|
|
|
|
'quantity_remaining' => $orderModule->getResolver() |
|
|
->getProductQuantityRemaining( |
|
|
->getProductQuantityRemaining( |
|
|
$productDistribution->product, |
|
|
$productDistribution->product, |
|
|
$productDistribution->distribution |
|
|
$productDistribution->distribution |