Skip to content

Commit

Permalink
more subscription work
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Mar 12, 2023
1 parent beb64cd commit 30ba1ae
Show file tree
Hide file tree
Showing 15 changed files with 808 additions and 113 deletions.
1 change: 0 additions & 1 deletion upload/admin/model/catalog/product.php
Expand Up @@ -769,7 +769,6 @@ public function editVariants(int $master_id, array $data): void {
}
}
}

}

$this->model_catalog_product->editProduct($product['product_id'], $product_data);
Expand Down
10 changes: 5 additions & 5 deletions upload/admin/view/template/sale/subscription_info.twig
Expand Up @@ -147,7 +147,7 @@
<div class="card-body">
<ul class="nav nav-tabs">
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link active">{{ tab_history }}</a></li>
<li class="nav-item"><a href="#tab-transaction" data-bs-toggle="tab" class="nav-link">{{ tab_transaction }}</a></li>
<li class="nav-item"><a href="#tab-log" data-bs-toggle="tab" class="nav-link">{{ tab_log }}</a></li>
{% for tab in tabs %}
<li class="nav-item"><a href="#tab-{{ tab.code }}" data-bs-toggle="tab" class="nav-link">{{ tab.title }}</a></li>
{% endfor %}
Expand Down Expand Up @@ -204,12 +204,12 @@
</form>
</div>

<div id="tab-transaction" class="tab-pane">
<div id="tab-log" class="tab-pane">
<fieldset>
<legend>{{ text_transaction }}</legend>
<div id="transaction">{{ transaction }}</div>
<legend>{{ text_log }}</legend>
<div id="log">{{ log }}</div>
</fieldset>
<form id="form-transaction">
<form id="form-log">
<fieldset>
<legend>{{ text_transaction_add }}</legend>
<div class="row mb-3">
Expand Down
8 changes: 4 additions & 4 deletions upload/catalog/controller/account/address.php
Expand Up @@ -67,7 +67,7 @@ protected function getList(): string {

$this->load->model('account/address');

$results = $this->model_account_address->getAddresses();
$results = $this->model_account_address->getAddresses($this->customer->getId());

foreach ($results as $result) {
$find = [
Expand Down Expand Up @@ -164,7 +164,7 @@ public function form(): void {
if (isset($this->request->get['address_id'])) {
$this->load->model('account/address');

$address_info = $this->model_account_address->getAddress($this->request->get['address_id']);
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $this->request->get['address_id']);
}

if (!empty($address_info)) {
Expand Down Expand Up @@ -361,15 +361,15 @@ public function save(): void {

// If address is in session update it.
if (isset($this->session->data['shipping_address']) && ($this->session->data['shipping_address']['address_id'] == $this->request->get['address_id'])) {
$this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->request->get['address_id']);
$this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->customer->getId(), $this->request->get['address_id']);

unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
}

// If address is in session update it.
if (isset($this->session->data['payment_address']) && ($this->session->data['payment_address']['address_id'] == $this->request->get['address_id'])) {
$this->session->data['payment_address'] = $this->model_account_address->getAddress($this->request->get['address_id']);
$this->session->data['payment_address'] = $this->model_account_address->getAddress($this->customer->getId(), $this->request->get['address_id']);

unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/account/login.php
Expand Up @@ -214,7 +214,7 @@ public function token(): void {
// Default Addresses
$this->load->model('account/address');

$address_info = $this->model_account_address->getAddress($this->customer->getAddressId());
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $this->customer->getAddressId());

if ($address_info) {
$this->session->data['shipping_address'] = $address_info;
Expand Down
8 changes: 4 additions & 4 deletions upload/catalog/controller/checkout/payment_address.php
Expand Up @@ -16,7 +16,7 @@ public function index(): string {
$this->load->model('account/address');

if ($this->customer->isLogged() && !isset($this->session->data['payment_address'])) {
$address_info = $this->model_account_address->getAddress($this->customer->getAddressId());
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $this->customer->getAddressId());

if ($address_info) {
$this->session->data['payment_address'] = $address_info;
Expand All @@ -29,7 +29,7 @@ public function index(): string {
$data['address_id'] = $this->config->get('config_country_id');
}

$data['addresses'] = $this->model_account_address->getAddresses();
$data['addresses'] = $this->model_account_address->getAddresses($this->customer->getId());

$this->load->model('localisation/country');

Expand Down Expand Up @@ -164,7 +164,7 @@ public function save(): void {

$json['address_id'] = $this->model_account_address->addAddress($this->customer->getId(), $this->request->post);

$json['addresses'] = $this->model_account_address->getAddresses();
$json['addresses'] = $this->model_account_address->getAddresses($this->customer->getId());

if ($country_info) {
$country = $country_info['name'];
Expand Down Expand Up @@ -266,7 +266,7 @@ public function address(): void {
if (!$json) {
$this->load->model('account/address');

$address_info = $this->model_account_address->getAddress($address_id);
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $address_id);

if (!$address_info) {
$json['error'] = $this->language->get('error_address');
Expand Down
8 changes: 4 additions & 4 deletions upload/catalog/controller/checkout/shipping_address.php
Expand Up @@ -15,7 +15,7 @@ public function index(): string {
$this->load->model('account/address');

if ($this->customer->isLogged() && !isset($this->session->data['shipping_address'])) {
$address_info = $this->model_account_address->getAddress($this->customer->getAddressId());
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $this->customer->getAddressId());

if ($address_info) {
$this->session->data['shipping_address'] = $address_info;
Expand All @@ -28,7 +28,7 @@ public function index(): string {
$data['address_id'] = $this->config->get('config_country_id');
}

$data['addresses'] = $this->model_account_address->getAddresses();
$data['addresses'] = $this->model_account_address->getAddresses($this->customer->getId());

$this->load->model('localisation/country');

Expand Down Expand Up @@ -163,7 +163,7 @@ public function save(): void {

$json['address_id'] = $this->model_account_address->addAddress($this->customer->getId(), $this->request->post);

$json['addresses'] = $this->model_account_address->getAddresses();
$json['addresses'] = $this->model_account_address->getAddresses($this->customer->getId());

if ($country_info) {
$country = $country_info['name'];
Expand Down Expand Up @@ -266,7 +266,7 @@ public function address(): void {
if (!$json) {
$this->load->model('account/address');

$address_info = $this->model_account_address->getAddress($address_id);
$address_info = $this->model_account_address->getAddress($this->customer->getId(), $address_id);

if (!$address_info) {
$json['error'] = $this->language->get('error_address');
Expand Down

0 comments on commit 30ba1ae

Please sign in to comment.