Skip to content

Commit

Permalink
Версия 0.8.8 (#17)
Browse files Browse the repository at this point in the history
* Версия 0.8.8
	- Исправление ошибки при отсутствии code.
	- Для каждой из СД добавлена возможность выбора нужна ли отгрузка от двери и нужна ли отгрузка от ПВЗ.
	- Добавлено кеширование.
	- Добавлен флаг показывать заглушку в корзине об ошибке или нет.
  • Loading branch information
acevodo authored Jan 22, 2024
1 parent 4e10ce2 commit f5f5a1d
Show file tree
Hide file tree
Showing 22 changed files with 926 additions and 509 deletions.
7 changes: 5 additions & 2 deletions 2.1/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<name>ApiShip</name>
<code>ApiShip</code>
<version>0.8.7 (OpenCart 2.0 - 2.2)</version>
<version>0.8.8 (OpenCart 2.0 - 2.2)</version>
<author>ApiShip</author>
<link>https://apiship.ru</link>

Expand Down Expand Up @@ -731,7 +731,10 @@
$this->_templateData['shipping_apiship_providers_keys'] = json_encode(array_keys($providers));
$this->_templateData['shipping_apiship_group_points'] = $this->config->get('shipping_apiship_group_points') ? 'true' : 'false';
$code = $this->_templateData['shipping_method']['code'];
$code = "";
if (is_array($this->_templateData['shipping_method']) && isset($this->_templateData['shipping_method']['code'])) {
$code = $this->_templateData['shipping_method']['code'];
}
if ((strpos($code, 'apiship')!==false) && (strpos($code, 'error')!==false))
{
Expand Down
10 changes: 9 additions & 1 deletion 2.1/upload/admin/controller/shipping/apiship.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function index() {
$data['text_none'] = $this->language->get('text_none');
$data['text_shipping_apiship_cron_url_copy'] = $this->language->get('text_shipping_apiship_cron_url_copy');

$data['shipping_apiship_version'] = '0.8.7 (OpenCart 2.0 - 2.2)';
$data['shipping_apiship_version'] = '0.8.8 (OpenCart 2.0 - 2.2)';
$data['shipping_apiship_version_js_mod'] = rand();

$data['button_save'] = $this->language->get('button_save');
Expand Down Expand Up @@ -90,6 +90,7 @@ public function index() {
$data['entry_shipping_apiship_tax_class'] = $this->language->get('entry_shipping_apiship_tax_class');
$data['entry_shipping_apiship_geo_zone'] = $this->language->get('entry_shipping_apiship_geo_zone');
$data['entry_shipping_apiship_icon_show'] = $this->language->get('entry_shipping_apiship_icon_show');
$data['entry_shipping_apiship_error_stub_show'] = $this->language->get('entry_shipping_apiship_error_stub_show');
$data['entry_shipping_apiship_group_points'] = $this->language->get('entry_shipping_apiship_group_points');
$data['entry_shipping_apiship_prefix'] = $this->language->get('entry_shipping_apiship_prefix');
$data['entry_shipping_apiship_export_status'] = $this->language->get('entry_shipping_apiship_export_status');
Expand All @@ -110,6 +111,7 @@ public function index() {
$data['entry_extra_settings'] = $this->language->get('entry_extra_settings');
$data['entry_providers_points'] = $this->language->get('entry_providers_points');
$data['entry_providers_point'] = $this->language->get('entry_providers_point');
$data['entry_providers_courier'] = $this->language->get('entry_providers_courier');

$data['entry_events_mapping'] = $this->language->get('entry_events_mapping');
$data['entry_events_mapping_notify'] = $this->language->get('entry_events_mapping_notify');
Expand Down Expand Up @@ -414,6 +416,12 @@ public function index() {
$data['shipping_apiship_prefix'] = $this->config->get('shipping_apiship_prefix');
}

if (isset($this->request->post['shipping_apiship_error_stub_show'])) {
$data['shipping_apiship_error_stub_show'] = $this->request->post['shipping_apiship_error_stub_show'];
} else {
$data['shipping_apiship_error_stub_show'] = $this->config->get('shipping_apiship_error_stub_show');
}

if (isset($this->request->post['shipping_apiship_mode'])) {
$data['shipping_apiship_mode'] = $this->request->post['shipping_apiship_mode'];
} else {
Expand Down
2 changes: 2 additions & 0 deletions 2.1/upload/admin/language/english/shipping/apiship.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

$_['entry_shipping_apiship_icon_show'] = 'Show icon';
$_['entry_shipping_apiship_prefix'] = 'Order prefix';
$_['entry_shipping_apiship_error_stub_show'] = 'Show a stub in the cart about an error';

$_['entry_shipping_apiship_mode'] = 'Working mode';
$_['entry_shipping_apiship_mode_normal'] = 'Normal';
Expand All @@ -100,6 +101,7 @@
$_['entry_extra_settings'] = 'Extra settings';
$_['entry_providers_points'] = 'DC points';
$_['entry_providers_point'] = 'DC point';
$_['entry_providers_courier'] = 'Picked up by courier';

$_['entry_events_mapping'] = 'Status mapping table';
$_['entry_events_mapping_notify'] = 'Notify';
Expand Down
2 changes: 2 additions & 0 deletions 2.1/upload/admin/language/russian/shipping/apiship.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

$_['entry_shipping_apiship_icon_show'] = 'Показывать иконку';
$_['entry_shipping_apiship_prefix'] = 'Префикс номера заказа';
$_['entry_shipping_apiship_error_stub_show'] = 'Показывать заглушку в корзине об ошибке';

$_['entry_shipping_apiship_mode'] = 'Режим работы';
$_['entry_shipping_apiship_mode_normal'] = 'Нормальный';
Expand All @@ -100,6 +101,7 @@
$_['entry_extra_settings'] = 'Дополнительные параметры';
$_['entry_providers_points'] = 'Параметры отгрузки в службы доставки';
$_['entry_providers_point'] = 'Привоз на склад';
$_['entry_providers_courier'] = 'Забирает курьер';

$_['entry_events_mapping'] = 'Параметры сопоставления статусов';
$_['entry_events_mapping_notify'] = 'Оповестить';
Expand Down
38 changes: 34 additions & 4 deletions 2.1/upload/admin/view/template/shipping/apiship.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@
<div class="checkbox col-sm-1">
<label>
<?php if (isset($shipping_apiship_provider[$provider['key']]['pickup_type'])) { ?>
<input class="shipping_apiship_provider_checkbox" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" value="1" checked="checked" />
<input class="shipping_apiship_provider_point" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" value="1" checked="checked" />
<?php } else { ?>
<input class="shipping_apiship_provider_checkbox" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" value="1" />
<input class="shipping_apiship_provider_point" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][pickup_type]" value="1" />
<?php } ?>
</label>
</div>
Expand All @@ -397,6 +397,21 @@
</select>
</div>
</div>

<div class="row">

<label class="col-sm-4 control-label" for="shipping_apiship_provider[<?php echo $provider['key'];?>][courier_type]"><?php echo $entry_providers_courier; ?> <?php echo $provider['name']; ?></label>
<div class="checkbox col-sm-1">
<label>
<?php if (isset($shipping_apiship_provider[$provider['key']]['courier_type'])) { ?>
<input class="shipping_apiship_provider_courier" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][courier_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][courier_type]" value="1" checked="checked" />
<?php } else { ?>
<input class="shipping_apiship_provider_courier" data-id="<?php echo $provider['key']; ?>" type="checkbox" name="shipping_apiship_provider[<?php echo $provider['key']; ?>][courier_type]" id="shipping_apiship_provider[<?php echo $provider['key']; ?>][courier_type]" value="1" />
<?php } ?>
</label>
</div>
</div>

</div>
</div>
<?php } ?>
Expand Down Expand Up @@ -519,6 +534,21 @@
</div>
</div>

<div class="form-group">
<label class="col-sm-4 control-label" for="shipping_apiship_error_stub_show"><?php echo $entry_shipping_apiship_error_stub_show; ?></label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<?php if ($shipping_apiship_error_stub_show) { ?>
<input type="checkbox" name="shipping_apiship_error_stub_show" id="shipping_apiship_error_stub_show" value="1" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="shipping_apiship_error_stub_show" id="shipping_apiship_error_stub_show" value="1" />
<?php } ?>
</label>
</div>
</div>
</div>

<div class="form-group">
<label class="col-sm-4 control-label" for="shipping_apiship_export_status"><?php echo $entry_shipping_apiship_export_status; ?></label>
<div class="col-sm-8">
Expand Down Expand Up @@ -704,12 +734,12 @@ function set_providers_checkbox(checked, provider) {
}
$(".shipping_apiship_provider_checkbox").on("click", function () {
$(".shipping_apiship_provider_point").on("click", function () {
provider = $(this).attr('data-id')
set_providers_checkbox(this.checked, provider)
});
jQuery('.shipping_apiship_provider_checkbox').each(function() {
jQuery('.shipping_apiship_provider_point').each(function() {
provider = $(this).attr('data-id')
set_providers_checkbox(this.checked, provider)
});
Expand Down
Loading

0 comments on commit f5f5a1d

Please sign in to comment.