Beispiel #1
0
 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();
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 /**
  * 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';
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 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());
 }
Beispiel #6
0
 private function setVenue()
 {
     $this->venue_id = $this->event->venue_id;
     $this->venue = Sp4kAppsVenueApp::getInstance(new Registry(['id' => $this->venue_id]))->getItem();
 }
Beispiel #7
0
 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();
 }
Beispiel #8
0
 protected function execute()
 {
     $this->items = Sp4kAppsVenueApp::getInstance($this->state)->getItems();
 }