/** * Renders the entity form for the given attributes. * * @return \Illuminate\View\View|null */ protected function renderForm($entity, $view = null) { $view = $view ?: 'sanatorium/shoppricing::widgets/form'; // @todo make dynamic $types = ['vat' => 'S daní', 'plain' => 'Bez daně']; $currencies = Currency::all(); $primary_currency = Currency::where('unit', 1)->first(); return view($view, compact('entity', 'types', 'currencies', 'primary_currency')); }
/** * {@inheritDoc} */ public function boot() { // Register the attributes namespace $this->app['platform.attributes.manager']->registerNamespace($this->app['Sanatorium\\Shoppricing\\Models\\Currency']); // Subscribe the registered event handler $this->app['events']->subscribe('sanatorium.shoppricing.currency.handler.event'); $this->registerCartalystConverterPackage(); // Set the measurements $measurements = ['currency' => []]; foreach (Currency::all() as $currency) { $measurements['currency'][$currency->code] = ['format' => $currency->format, 'unit' => $currency->unit]; } Converter::setMeasurements($measurements); // Register the Blade @pricing widget $this->registerBladePricingWidget(); }