/** * {@inheritdoc} */ private function registerClientScript() { $view = $this->getView(); DataTablesAsset::register($view); iCheckAsset::register($view); $view->registerJs(<<<'JS' $(function () { var checkAll = $('input.select-on-check-all'); var checkboxes = $('input.icheck'); $('input.icheck, input.select-on-check-all ').iCheck({ checkboxClass: 'icheckbox_minimal-blue', radioClass: 'iradio_minimal-blue' }); checkAll.on('ifChecked ifUnchecked', function(event) { if (event.type == 'ifChecked') { checkboxes.iCheck('check'); } else { checkboxes.iCheck('uncheck'); } }); checkboxes.on('ifChanged', function(event){ if (checkboxes.filter(':checked').length == checkboxes.length) { checkAll.prop('checked', true); } else { checkAll.prop('checked', false); } checkAll.iCheck('update'); }); }); JS , \yii\web\View::POS_READY); }
</div> <!-- /.row --> <!-- this row will not appear when printing --> <div class="row no-print"> <div class="col-xs-4"> <?php echo Html::a('<i class="fa fa-trash"></i> ' . Yii::t('cart', 'Clear cart'), ['clear'], ['class' => 'btn btn-default']); ?> </div> <div class="col-xs-8"><span class="pull-right"> <?php if ($module->termsPage) { ?> <?php \hiqdev\assets\icheck\iCheckAsset::register($this); ?> <?php $this->registerJs("\n jQuery('input').iCheck({\n checkboxClass: 'icheckbox_minimal-blue',\n radioClass: 'iradio_minimal'\n }).on('ifToggled', function() {\n jQuery('#make-order-button').toggleClass('disabled');\n });"); ?> <label> <input type="checkbox" id="term-of-use"> <?php echo Yii::t('cart', 'I have read and agree to the'); ?> <?php echo Html::a(Yii::t('cart', 'terms of use'), $module->termsPage); ?> </label> <?php }
</div> <!-- /.row --> <!-- this row will not appear when printing --> <div class="row no-print"> <div class="col-xs-4"> <?php echo Html::a('<i class="fa fa-trash"></i> ' . Yii::t('cart', 'Clear cart'), ['clear'], ['class' => 'btn btn-default']); ?> </div> <div class="col-xs-8"><span class="pull-right"> <?php if ($module->termsPage) { ?> <?php iCheckAsset::register($this); ?> <?php $this->registerJs("\n jQuery('input').iCheck({\n checkboxClass: 'icheckbox_minimal-blue',\n radioClass: 'iradio_minimal'\n }).on('ifToggled', function() {\n jQuery('#make-order-button').toggleClass('disabled');\n });"); ?> <label> <input type="checkbox" id="term-of-use"> <?php echo Yii::t('cart', 'I have read and agree to the {termsLink}', ['termsLink' => Html::a(Yii::t('cart', 'terms of use'), $module->termsPage)]); ?> </label> <?php } ?> <?php if ($module->orderButton) {