protected function load() { $this->event = $event = Sp4kAppsEventApp::getInstance(new Joomla\Registry\Registry(['id' => $this->getState()->get('event_id')]))->getItem(); $this->venue = $venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $event->venue_id]))->getItem(); //how to get venue modifiers? $this->product = Sp4kAppsProductApp::getInstance(new Registry(['id' => $event->product_id]))->getItem(); }
public function getEventPrice($event_id, $startDate) { $this->event = Sp4kAppsEventApp::getInstance(new Registry(['id' => $event_id]))->getItem(); $this->venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $this->event->venue_id]))->getItem(); $this->getState()->set('event.rrule', Sp4kAppsRruleApp::getInstance(new Registry(['id' => $this->event->rrule_id]))->getItem()); $daysinbilling = $this->getNumDates(strftime('%Y%m%dT115959Z', $startDate), strftime('%Y%m%dT115959Z', strtotime('+30 days', $startDate))); $total = $daysinbilling * $this->getState()->get('pricing')->unit_price; return $total; }
/** * Show venues for the selected parent product. */ private function setVenues() { $products = Sp4kAppsProductApp::getInstance(new Registry(['filters' => ['parent_id' => $this->state->get('id')]]))->getItems(); foreach ($products as $product) { //build array of unique venue ids $venues[$product->venue_id] = $product->venue_id; } $this->venues = Sp4kAppsVenueApp::getInstance(new Registry(['keys' => $venues]))->getItems(); $this->layout = 'venues'; }
public function execute() { $filters = new stdClass(); if ($product_id = $this->state->get('product_id', false)) { $filters->product_id = $product_id; } if ($venue_id = $this->state->get('venue_id', false)) { $filters->venue_id = $venue_id; } if ($category_id = $this->state->get('vategory_id', false)) { $filters->category_id = $category_id; } $model = new Sp4kModulesEventModelsItems(new Joomla\Registry\Registry(['filters' => $filters])); $this->items = $model->items; foreach ($this->items as &$event) { $productApp = new Sp4kAppsProductApp(new Joomla\Registry\Registry(['id' => $event->product_id])); $venueApp = new Sp4kAppsVenueApp(new Joomla\Registry\Registry(['id' => $event->venue_id])); $event->product_title = $productApp->getItem()->title; $event->venue_title = $venueApp->getItem()->title; } }
protected function load() { $this->event = $event = Sp4kAppsEventApp::getInstance(new Joomla\Registry\Registry(['id' => $this->getState()->get('event_id')]))->getItem(); $this->venue = $venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $event->venue_id]))->getItem(); //how to get venue modifiers? $this->product = Sp4kAppsProductApp::getInstance(['id' => $event->product_id])->getItem(); $this->datestart = $this->getState()->get('datestart'); //get the rate based on the event venue and the product. $rate = Sp4kAppsCartPricingApp::getInstance(new Registry($this))->process(); $this->qty = $qty = count($this->getState()->get('children')); $this->lineTotal = $rate * $qty; // set the state to the table data so // that any empty variables in the incoming data are populated with table data. $this->getState()->loadArray(get_object_vars($this->_table), true); }
public function getItem() { //the cart is in the session, or in state. //We start with getting the cart items, then enumerating them to get each cart item type, so we can process //it through its plugin. $cart = $this->getState()->toObject(); $this->event = $event = Sp4kAppsEventApp::getInstance(new Registry(['id' => $this->getState()->get('event_id')]))->getItem(); $this->venue = $venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $event->venue_id]))->getItem(); //how to get venue modifiers? $this->product = Sp4kAppsProductApp::getInstance(new Registry(['id' => $event->product_id]))->getItem(); $this->datestart = $this->getState()->get('datestart'); //get the rate based on the event venue and the product. //$rate = Sp4kAppsCartPricingApp::getInstance( // new Registry($this) //)->process(); //$this->qty = $qty = count($this->getState()->get('children')); //$this->lineTotal = $rate * $qty; // set the state to the table data so // that any empty variables in the incoming data are populated with table data. //$this->getState()->loadArray(get_object_vars($this->_table),true); return $this->item = $this->getItemInstance($this->getState()); }
private function setVenue() { $this->venue_id = $this->event->venue_id; $this->venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $this->venue_id]))->getItem(); }
private function init() { $this->event = Sp4kAppsEventApp::getInstance(new Registry(['id' => $this->getState()->get('event_id')]))->getItem(); $this->venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $this->event->venue_id]))->getItem(); $this->product = Sp4kAppsProductApp::getInstance(new Registry(['id' => $this->event->product_id]))->getItem(); }
public function execute() { $app = new Sp4kAppsVenueApp(new Joomla\Registry\Registry($this->state->toObject())); $this->item = $app->getItem(); }
protected function execute() { $this->items = Sp4kAppsVenueApp::getInstance($this->state)->getItems(); }