Skip to content

Commit

Permalink
Add bulk Renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Dec 22, 2015
1 parent 9820938 commit 69b9a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/AddToCartAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace hiqdev\yii2\cart\actions;

use hipanel\modules\domain\models\Domain;
use hiqdev\hiart\Collection;
use hiqdev\yii2\cart\Module;
use Yii;
Expand All @@ -34,13 +35,12 @@ public function run()
$model = new $this->productClass();
$collection = new Collection();
$collection->setModel($model);
// $data = $request->isPost ? $request->post() : $request->get();

if ($this->bulkLoad) {
$data = [];
$selection = $request->post('selection');
foreach ($selection as $id) {
$data[$id] = [reset($collection->first->primaryKey()) => $id];
$data[$id] = [reset($model->primaryKey()) => $id];
}
} else {
$data = [$request->post() ?: $request->get()];
Expand Down

0 comments on commit 69b9a1f

Please sign in to comment.