46 lines
963 B
PHP
46 lines
963 B
PHP
|
|
<?php namespace TPS\Birzha\Components;
|
||
|
|
|
||
|
|
use Cms\Classes\ComponentBase;
|
||
|
|
use TPS\Birzha\Models\Product;
|
||
|
|
use TPS\Birzha\Models\Comment;
|
||
|
|
use TPS\Birzha\Models\OrderItems;
|
||
|
|
use RainLab\User\Facades\Auth;
|
||
|
|
use Flash;
|
||
|
|
|
||
|
|
class OrderDetail extends ComponentBase
|
||
|
|
{
|
||
|
|
public $order;
|
||
|
|
|
||
|
|
public function componentDetails()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'name' => 'Single order',
|
||
|
|
'description' => 'Selected order'
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function defineProperties()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'id' => [
|
||
|
|
'title' => 'Order id',
|
||
|
|
'description' => 'Order id',
|
||
|
|
'type' => 'string',
|
||
|
|
'default' => '{{ :id }}'
|
||
|
|
]
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public function onRun() {
|
||
|
|
$this->order = $this->loadOrder();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
protected function loadOrder() {
|
||
|
|
$order = OrderItems::where('order_id', $this->property('id'))->first();
|
||
|
|
return $order;
|
||
|
|
}
|
||
|
|
}
|