Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
New version OC 3 1.1.0
  • Loading branch information
Chris707 committed Nov 19, 2019
1 parent 1652537 commit 46bd4ca
Show file tree
Hide file tree
Showing 24 changed files with 2,131 additions and 41 deletions.
Binary file added upload/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion upload/admin/controller/extension/module/myparcelnl.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function index()
$data['order_status'] = $this->model_localisation_order_status->getOrderStatuses();
$data['log_dir_is_file'] = is_file(MyParcel()->getLogsDir());
$data['log_url'] = MyParcel()->getLogsUrl();

$data['custom_field_address'] = MyParcel()->helper->getAddressCustomFields();
$this->response->setOutput($this->load->view(MyParcel()->getMyparcelModulePath(), $data));
}

Expand Down
20 changes: 17 additions & 3 deletions upload/admin/language/en-gb/extension/module/myparcelnl.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Heading
$heading_title = 'Myparcel NL v1.0.5';
$heading_title = 'Myparcel NL v1.1.0';
$_['heading_title'] = $heading_title;
// Text
$_['text_module'] = 'Modules';
Expand Down Expand Up @@ -50,12 +50,13 @@
$_['entry_tab_1_checkbox_keep_old_shipments'] = 'With this option enabled, data from previous shipments (track & trace links) will be kept in the order when you export more than once.';
$_['entry_tab_1_label_use_addition_address_as_number_suffix'] = 'Use addition address as number suffix';
$_['entry_tab_1_checkbox_use_address1_and_address2'] = "'Address field 1' and 'address field 2' will both be used for the full address";
$_['entry_tab_1_checkbox_use_address2_as_number_suffix'] = 'With this option enabled, value inputted in address 2 will be considered as number suffix in the customer address';
$_['entry_tab_1_checkbox_use_address2_as_number_suffix'] = 'Use address field 1 for \'street\', address field 2 for \'house number\'';
$_['entry_tab_1_checkbox_use_address3_as_number_suffix_1'] = 'Use address field 1 for \'street\', address field 2 for \'house number\' and ';
$_['entry_tab_1_checkbox_use_address3_as_number_suffix_2'] = ' for \'housenumber suffix\'';
$_['entry_tab_1_diagnostic_tools'] = 'Diagnostic tools';
$_['entry_tab_1_log_api_communication'] = 'Log API communication';
$_['entry_tab_1_checkbox_log_api_communication'] = 'Only enable this option when debugging!';
$_['entry_tab_1_download_log_file'] = 'Download log file';
$_['entry_tab_1_checkbox_use_address3_as_number_suffix'] = 'With this option enabled, value inputted in address 3 will be considered as number suffix in the customer address';


$_['entry_tab_2_title_export_settings'] = 'Default export settings';
Expand Down Expand Up @@ -124,6 +125,18 @@
$_['entry_tab_3_label_belgium_default_fee'] = 'Belgium standard fee';
$_['entry_tab_3_label_belgium_pickup_fee'] = 'Standard pickup fee';
$_['entry_tab_3_label_cut_off_weekday'] = 'Weekdays';
$_['entry_tab_3_label_only_apply_for_xtension_checkout']= 'Only apply for Xtension Best Checkout';
$_['entry_tab_3_label_time_format'] = 'Time format';
$_['entry_tab_3_label_time_format_description'] = 'H: hour, i: minute, s: second';
$_['entry_tab_3_label_distance'] = 'Distance format';
$_['entry_tab_3_label_rounding_distance'] = 'Rounding distance format';
$_['entry_tab_3_label_rounding_distance_description'] = 'The optional number of decimal digits to round to if the distance format is kilometer';
$_['entry_tab_3_distance_format_kilometer'] = 'Kilometer';
$_['entry_tab_3_distance_format_meter'] = 'Meter';
$_['entry_tab_3_label_default_price_0_text'] = 'Default Price Text';
$_['entry_tab_3_label_default_price_0_text_description']= 'The text is shown when price is 0';



$_['entry_unknown_error'] = 'Unknown error';
$_['entry_api_error_with_order_id'] = 'Order #%s api error:';
Expand Down Expand Up @@ -224,6 +237,7 @@
$_['error_cannot_save_order_shipment'] = 'Cannot save order #%s shipment #%s';
$_['error_create_related_return_shipment_for_order'] = 'An error occurred while creating return shipment for order #%s';
$_['error_return_options_is_empty'] = 'Options for related return shipment is empty';
$_['error_cannot_export_order_shipment'] = 'Cannot export order #%s ';
// Error mailbox settings
$_['error_mailbox_title_empty'] = 'Mailbox title cannot be empty';
$_['error_mailbox_fee_empty'] = 'Mailbox fee cannot be empty and must be numeric';
Expand Down
9 changes: 9 additions & 0 deletions upload/admin/model/extension/myparcelnl/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ function installDatabase()
`prices` text,
PRIMARY KEY (`order_id`)
);");
//add field to *_myparcel_shipment table
$query = $this->db->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '". DB_PREFIX ."myparcel_shipment' AND table_schema = '". DB_DATABASE ."' AND column_name = 'external_id'");
if(count($query->row) == 0 ){
$this->db->query("ALTER TABLE `" .DB_PREFIX. "myparcel_shipment` ADD COLUMN `external_id` VARCHAR(50) NULL DEFAULT NULL;");
}
$query = $this->db->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '". DB_PREFIX ."myparcel_shipment' AND table_schema = '". DB_DATABASE ."' AND column_name = 'type'");
if(count($query->row) == 0 ){
$this->db->query("ALTER TABLE `" .DB_PREFIX. "myparcel_shipment` ADD COLUMN `type` VARCHAR(50) NULL DEFAULT NULL;");
}
}

function installMyParcelTotal()
Expand Down
11 changes: 11 additions & 0 deletions upload/admin/model/extension/myparcelnl/shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ class ModelExtensionMyparcelnlShipment extends Model
{
static $table_name = 'myparcel_shipment';

/**
* Get myparcel export settings saved from backoffice
* @param int $order_id
* @return array options
**/
public function getData($order_id, $column_name)
{
$order_query = $this->db->query("SELECT " . $column_name . " FROM `" . DB_PREFIX . self::$table_name . "` WHERE order_id = " . $order_id . " LIMIT 1");
return $this->getValueFromQuery($column_name, $order_query);
}

/**
* Get myparcel export settings saved from backoffice
* @param int $order_id
Expand Down
45 changes: 44 additions & 1 deletion upload/admin/view/template/extension/module/myparcelnl.twig
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@
</div>
<div class="radio">
<label>
<input type="radio" name="module_myparcelnl_fields_general[use_addition_address_as_number_suffix]" value="2" {{ (module_myparcelnl_fields_general.use_addition_address_as_number_suffix and module_myparcelnl_fields_general.use_addition_address_as_number_suffix==2)?'checked="checked"':"" }}/>{{ entry_tab_1_checkbox_use_address3_as_number_suffix }}
<input type="radio" name="module_myparcelnl_fields_general[use_addition_address_as_number_suffix]" value="2" {{ (module_myparcelnl_fields_general.use_addition_address_as_number_suffix and module_myparcelnl_fields_general.use_addition_address_as_number_suffix==2)?'checked="checked"':"" }}/>
<span>{{ entry_tab_1_checkbox_use_address3_as_number_suffix_1 }}</span>
<select class="form-control" id="select_homenumber_suffix" name="module_myparcelnl_fields_general[general_custom_field_homenumber_suffix]" >
{% for custom_field in custom_field_address %}
{% set selected = (module_myparcelnl_fields_general.general_custom_field_homenumber_suffix and custom_field.id == module_myparcelnl_fields_general.general_custom_field_homenumber_suffix) ? 'selected="selected"' : '' %}
<option {{ selected }} value="{{ custom_field.id }}">{{ custom_field.name }}</option>
{% endfor %}
</select>
<span>{{ entry_tab_1_checkbox_use_address3_as_number_suffix_2 }}</span>
</label>
</div>
</div>
Expand Down Expand Up @@ -739,6 +747,41 @@
{{ entry_tab_3_textbox_delivery_days_window }}
</div>
</div>
<div class="form-group">
<h4><strong>{{ entry_tab_3_label_only_apply_for_xtension_checkout }} </strong></h4>
</div>
<div class="form-group">
<label class="text-left col-sm-2 control-label" for="input-title" >{{ entry_tab_3_label_distance }}</label>
<div class="col-sm-10 col-md-6 col-lg-3">
<select name="module_myparcelnl_fields_checkout[distance_format]" class="form-control" style="width:100%;">
{% for key,value in distance_format %}
{% set selected = (module_myparcelnl_fields_checkout.distance_format and key == module_myparcelnl_fields_checkout.distance_format ) ? 'selected="selected"' : '' %}
<option {{ selected }} value="{{ key }}">{{ value }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="text-left col-sm-2 control-label" for="input-title" >{{ entry_tab_3_label_rounding_distance }}</label>
<div class="col-sm-10 col-md-6 col-lg-3">
<input type="" name="module_myparcelnl_fields_checkout[rounding_distance]" value="{{ (module_myparcelnl_fields_checkout.rounding_distance is not empty) ? module_myparcelnl_fields_checkout.rounding_distance:'' }}" class="form-control"/>
{{ entry_tab_3_label_rounding_distance_description }}
</div>
</div>
<div class="form-group">
<label class="text-left col-sm-2 control-label" for="input-title" >{{ entry_tab_3_label_default_price_0_text }}</label>
<div class="col-sm-10 col-md-6 col-lg-3">
<input type="" name="module_myparcelnl_fields_checkout[default_price_0_text]" value="{{ (module_myparcelnl_fields_checkout.default_price_0_text is not empty) ? module_myparcelnl_fields_checkout.default_price_0_text:'' }}" class="form-control"/>
{{ entry_tab_3_label_default_price_0_text_description }}
</div>
</div>
<div class="form-group">
<label class="text-left col-sm-2 control-label" for="input-title" >{{ entry_tab_3_label_time_format }}</label>
<div class="col-sm-10 col-md-6 col-lg-3">
<input type="" name="module_myparcelnl_fields_checkout[time_format]" value="{{ (module_myparcelnl_fields_checkout.time_format is not empty) ? module_myparcelnl_fields_checkout.time_format:'H:i:s' }}" class="form-control"/>
{{ entry_tab_3_label_time_format_description }}
</div>
</div>

<h2>{{ entry_tab_3_title_customizations }}</h2>

Expand Down
Loading

0 comments on commit 46bd4ca

Please sign in to comment.