Commit f36d238b3e08bac6aa385a02f17427b2670a4eb6

Authored by Alexey Boroda
1 parent 4ee1bc37

-Order publish finished

Showing 2 changed files with 18 additions and 0 deletions   Show diff stats
controllers/OrderController.php
@@ -471,4 +471,10 @@ @@ -471,4 +471,10 @@
471 $model->edit_id = 0; 471 $model->edit_id = 0;
472 $model->save(); 472 $model->save();
473 } 473 }
  474 +
  475 + public function actionPublishOrder($id) {
  476 + $model = Order::findOne($id);
  477 + $model->published = true;
  478 + $model->save();
  479 + }
474 } 480 }
views/order/_form.php
@@ -98,6 +98,18 @@ JS; @@ -98,6 +98,18 @@ JS;
98 98
99 $js = <<< JS 99 $js = <<< JS
100 $(document).on('click', '#page-submit', function() { 100 $(document).on('click', '#page-submit', function() {
  101 + $.ajax({
  102 + url: "/admin/ecommerce/order/publish-order",
  103 + type: "GET",
  104 + data: {
  105 + id: {$model->id}
  106 + },
  107 + success: function (data) {
  108 +
  109 + },
  110 + error: function () {
  111 + }
  112 + });
101 $('#main-form').trigger('submit'); 113 $('#main-form').trigger('submit');
102 }); 114 });
103 JS; 115 JS;