, */ /** * Klasa zawierajaca komponenty * * @package stAllegroPlugin * @subpackage actions */ class stAllegroBackendComponents extends autoStAllegroBackendComponents { public function executeCategoryParameters() { $api = stAllegroApi::getInstance(); $this->parameters = $api->getCategoryParameters($this->offer->getCategory()->id); $this->values = $this->offer->getParameters() ? $this->offer->getParameters() : array(); } public function executeOfferForm() { } public function executePricingFeePreview() { $api = stAllegroApi::getInstance(); $this->quotes = array(); try { $this->fees = $api->getPricingFeePreview(array( 'includeQuotingBundles' => true, 'offer' => array( 'category' => array( 'id' => $this->category ), 'quantity' => intval($this->quantity ? $this->quantity : 1), 'type' => 'OFFER', 'unitPrice' => $this->price, "bold" => $this->bold, "highlight" => $this->highlight, "departmentPage" => $this->departmentPage, "emphasized" => $this->emphasized, "emphasizedHighlightBoldPackage" => $this->emphasizedHighlightBoldPackage, ) )); if ($this->offerId) { $this->quotes = $api->getOfferQuotes($this->offerId); } } catch(stAllegroException $e) { $this->fees = stAllegroApi::arrayToObject(array( 'quotes' => array( array( 'name' => 'Wystawienie przedmiotu', 'fee' => array( 'amount' => 0, 'currency' => 'PLN', ), 'cycleDuration' => 'PT240H', ), ) )); } } public function executeDescription() { $this->config = stConfig::getInstance('stAllegroPlugin'); } public function executeAllegroPlState() { $i18n = $this->getContext()->getI18n(); $this->default = $this->config->get('allegro_pl_state'); $this->states = array(); $states = array( 'dolnoslaskie' => 'dolnośląskie', 'kujawsko_pomorskie' => 'kujawsko-pomorskie', 'lubelskie' => 'lubelskie', 'lubuskie' => 'lubuskie', 'lodzkie' => 'łódzkie', 'malopolskie' => 'małopolskie', 'mazowieckie' => 'mazowieckie', 'opolskie' => 'opolskie', 'podkarpackie' => 'podkarpackie', 'podlaskie' => 'podlaskie', 'pomorskie' => 'pomorskie', 'slaskie' => 'śląskie', 'swietokrzyskie' => 'świętokrzyskie', 'warminsko_mazurskie' => 'warmińsko-mazurskie', 'wielkopolskie' => 'wielkopolskie', 'zachodniopomorskie' => 'zachodniopomorskie', ); if (is_array($states)) foreach ($states as $id => $state) $this->states[$id] = $i18n->__($state, null, 'stAllegroMessages'); } }