$this->data = array_merge($this->data, $this->load->language('openbay/amazonus_subscription'));
$this->document->setTitle($this->language->get('lang_title'));
$this->document->addStyle('view/stylesheet/openbay.css');
$this->document->addScript('view/javascript/openbay/faq.js');
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array(
'href' => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],
'text' => $this->language->get('text_home'),
'separator' => false
);
$this->data['breadcrumbs'][] = array(
'href' => HTTPS_SERVER . 'index.php?route=extension/openbay&token=' . $this->session->data['token'],
'text' => $this->language->get('lang_openbay'),
'separator' => ' :: '
);
$this->data['breadcrumbs'][] = array(
'href' => HTTPS_SERVER . 'index.php?route=openbay/amazonus/overview&token=' . $this->session->data['token'],
'text' => $this->language->get('lang_overview'),
'separator' => ' :: '
);
$this->data['breadcrumbs'][] = array(
'href' => HTTPS_SERVER . 'index.php?route=openbay/amazonus/subscription&token=' . $this->session->data['token'],
'text' => $this->language->get('lang_my_account'),
'separator' => ' :: '
);
$this->data['link_overview'] = $this->url->link('openbay/amazonus/overview', 'token=' . $this->session->data['token'], 'SSL');
$response = simplexml_load_string($this->openbay->amazonus->callWithResponse('plans/getPlans'));
$plans = array();
if ($response) {
foreach ($response->Plan as $plan) {
$plans[] = array(
'title' => (string)$plan->Title,
'description' => (string)$plan->Description,
'order_frequency' => (string)$plan->OrderFrequency,
'product_listings' => (string)$plan->ProductListings,
'bulk_listing' => (string)$plan->BulkListing,
'price' => (string)$plan->Price,
);
}
}
$this->data['plans'] = $plans;
$response = simplexml_load_string($this->openbay->amazonus->callWithResponse('plans/getUsersPlans'));
$plan = false;
if ($response) {
$plan = array(
'merchant_id' => (string)$response->MerchantId,
'user_status' => (string)$response->UserStatus,
'title' => (string)$response->Title,
'description' => (string)$response->Description,
'price' => (string)$response->Price,
'order_frequency' => (string)$response->OrderFrequency,
'product_listings' => (string)$response->ProductListings,
'listings_remain' => (string)$response->ListingsRemain,
'listings_reserved' => (string)$response->ListingsReserved,
'bulk_listing' => (string)$response->BulkListing,
);
}
$this->data['user_plan'] = $plan;
$this->data['server'] = $this->openbay->amazonus->getServer();
$this->data['token'] = $this->config->get('openbay_amazonus_token');
$this->template = 'openbay/amazonus_subscription.tpl';
$this->children = array(
'common/header',
'common/footer'
);
$this->response->setOutput($this->render());