Skip to content

Commit

Permalink
https://github.com/opencart/opencart/issues/12661
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Apr 21, 2024
1 parent 68f8948 commit 17db7cf
Show file tree
Hide file tree
Showing 7 changed files with 365 additions and 144 deletions.
85 changes: 42 additions & 43 deletions upload/admin/view/template/sale/order_info.twig
Expand Up @@ -32,6 +32,7 @@
{% endif %}
</div>
</div>

<div class="col">
<div class="input-group mb-3">
<div class="form-control border rounded-start">
Expand All @@ -47,6 +48,7 @@
<button type="button" data-bs-toggle="modal" data-bs-target="#modal-customer" class="btn btn-outline-primary"><i class="fa-solid fa-cog"></i></button>
</div>
</div>

<div class="col">
<div class="form-control p-0 border rounded mb-3">
<div class="lead p-2"><strong>{{ text_date_added }}</strong>
Expand All @@ -55,6 +57,46 @@
</div>
</div>
</div>

<div class="col">
<form id="form-store" class="mb-3">
<div class="form-floating">
<select name="store_id" id="input-store" class="form-select">
{% for store in stores %}
<option value="{{ store.store_id }}"{% if store.store_id == store_id %} selected{% endif %}>{{ store.name }}</option>
{% endfor %}
</select>
<label for="input-store">{{ entry_store }}</label>
</div>
</form>
</div>

<div class="col">
<form id="form-language" class="mb-3">
<div class="form-floating">
<select name="language" id="input-language" class="form-select">
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == language_code %} selected{% endif %}>{{ language.name }}</option>
{% endfor %}
</select>
<label for="input-language">{{ entry_language }}</label>
</div>
</form>
</div>

<div class="col">
<form id="form-currency" class="mb-3">
<div class="form-floating">
<select name="currency" id="input-currency" class="form-select">
{% for currency in currencies %}
<option value="{{ currency.code }}"{% if currency.code == currency_code %} selected{% endif %}>{{ currency.title }}</option>
{% endfor %}
</select>
<label for="input-currency">{{ entry_currency }}</label>
</div>
</form>
</div>

</div>
<table class="table table-bordered">
<thead>
Expand Down Expand Up @@ -137,43 +179,6 @@
<div id="collapse-order" class="collapse">
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4">

<div class="col">
<form id="form-store" class="mb-3">
<div class="form-floating">
<select name="store_id" id="input-store" class="form-select">
{% for store in stores %}
<option value="{{ store.store_id }}"{% if store.store_id == store_id %} selected{% endif %}>{{ store.name }}</option>
{% endfor %}
</select> <label for="input-store">{{ entry_store }}</label>
</div>
</form>
</div>

<div class="col">
<form id="form-language" class="mb-3">
<div class="form-floating">
<select name="language" id="input-language" class="form-select">
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == language_code %} selected{% endif %}>{{ language.name }}</option>
{% endfor %}
</select> <label for="input-language">{{ entry_language }}</label>
</div>
</form>
</div>

<div class="col">
<form id="form-currency" class="mb-3">
<div class="form-floating">
<select name="currency" id="input-currency" class="form-select">
{% for currency in currencies %}
<option value="{{ currency.code }}"{% if currency.code == currency_code %} selected{% endif %}>{{ currency.title }}</option>
{% endfor %}
</select>
<label for="input-currency">{{ entry_currency }}</label>
</div>
</form>
</div>

<div class="col">
<form id="form-coupon" class="mb-3">
<div class="input-group form-floating">
Expand Down Expand Up @@ -270,32 +275,26 @@
{{ payment_firstname }} {{ payment_lastname }}
<br/>
{% endif %}

{% if payment_company %}
{{ payment_company }}
<br/>
{% endif %}

{% if payment_address_1 %}
{{ payment_address_1 }}
<br/>
{% endif %}

{% if payment_address_2 %}
{{ payment_address_2 }}
<br/>
{% endif %}

{% if payment_city %}
{{ payment_city }}
<br/>
{% endif %}

{% if payment_postcode %}
{{ payment_postcode }}
<br/>
{% endif %}

{% if payment_zone %}
{{ payment_zone }}
<br/>
Expand Down
13 changes: 0 additions & 13 deletions upload/catalog/controller/api/affiliate.php
Expand Up @@ -55,19 +55,6 @@ public function index(): void {
$json['success'] = $this->language->get('text_success');

$this->session->data['affiliate_id'] = $affiliate_id;

// If order already created then update
if (isset($this->session->data['order_id'])) {
$order_data = [
'affiliate_id' => $affiliate_info['customer_id'],
'commission' => ($subtotal / 100) * $affiliate_info['commission'],
'tracking' => $affiliate_info['tracking']
];

$this->load->model('checkout/order');

$this->model_checkout_order->editOrder($this->session->data['order_id'], $order_data);
}
}

$this->response->addHeader('Content-Type: application/json');
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/api/language.php
Expand Up @@ -22,7 +22,7 @@ public function index(): void {

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

$language_info = $this->model_localisation_currency->getCurrencyByCode($language);
$language_info = $this->model_localisation_language->getLanguageByCode($language);

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

0 comments on commit 17db7cf

Please sign in to comment.