From d3ef0173b05a0f672980b16b71aa0d8720169221 Mon Sep 17 00:00:00 2001 From: Robin de Laater Date: Tue, 14 Jul 2020 12:24:51 +0200 Subject: [PATCH] Update new version --- install.xml | 1090 ++++++++++++++++- upload/.DS_Store | Bin 6148 -> 0 bytes .../extension/module/myparcelnl.php | 1 + .../extension/shipping/myparcel_shipping.php | 0 .../extension/total/myparcel_total.php | 0 .../en-gb/extension/module/myparcelnl.php | 8 +- .../extension/shipping/myparcel_shipping.php | 0 .../en-gb/extension/total/myparcel_total.php | 0 .../model/extension/myparcelnl/helper.php | 0 .../admin/model/extension/myparcelnl/init.php | 10 +- .../model/extension/myparcelnl/shipment.php | 0 .../model/extension/myparcelnl/shipping.php | 0 .../template/extension/module/myparcelnl.twig | 20 +- .../extension/shipping/myparcel_shipping.twig | 0 .../extension/total/myparcel_total.twig | 0 .../myparcelnl/myparcel_delivery.php | 202 ++- .../extension/myparcelnl/myparcel_order.php | 0 .../myparcelnl/myparcel_xtension_delivery.php | 143 ++- .../controller/extension/myparcelnl/test.php | 0 .../en-gb/extension/module/myparcelnl.php | 5 + .../nl-nl/extension/module/myparcelnl.php | 7 +- .../model/extension/myparcelnl/helper.php | 0 .../model/extension/myparcelnl/shipment.php | 0 .../extension/shipping/myparcel_shipping.php | 0 .../model/extension/total/myparcel_total.php | 0 .../myparcel_xtension_delivery.twig | 0 .../myparcel_xtension_delivery_change.twig | 0 .../myparcel_xtension_pickup_change.twig | 0 .../library/myparcelnl/assets/.htaccess | 0 .../myparcelnl/assets/css/checkout.css | 6 +- .../myparcelnl/assets/css/colorpicker.css | 0 .../myparcelnl/assets/css/magnific-popup.css | 0 .../myparcelnl/assets/css/myparcel_global.css | 0 .../myparcelnl/assets/css/myparcelnl.css | 0 .../library/myparcelnl/assets/css/order.css | 0 .../library/myparcelnl/assets/css/select2.css | 0 .../myparcelnl/assets/css/sweetalert.min.css | 1 + .../assets/img/colorpicker/blank.gif | Bin .../colorpicker/colorpicker_background.png | Bin .../img/colorpicker/colorpicker_hex.png | Bin .../img/colorpicker/colorpicker_hsb_b.png | Bin .../img/colorpicker/colorpicker_hsb_h.png | Bin .../img/colorpicker/colorpicker_hsb_s.png | Bin .../img/colorpicker/colorpicker_indic.gif | Bin .../img/colorpicker/colorpicker_overlay.png | Bin .../img/colorpicker/colorpicker_rgb_b.png | Bin .../img/colorpicker/colorpicker_rgb_g.png | Bin .../img/colorpicker/colorpicker_rgb_r.png | Bin .../img/colorpicker/colorpicker_select.gif | Bin .../img/colorpicker/colorpicker_submit.png | Bin .../img/colorpicker/custom_background.png | Bin .../assets/img/colorpicker/custom_hex.png | Bin .../assets/img/colorpicker/custom_hsb_b.png | Bin .../assets/img/colorpicker/custom_hsb_h.png | Bin .../assets/img/colorpicker/custom_hsb_s.png | Bin .../assets/img/colorpicker/custom_indic.gif | Bin .../assets/img/colorpicker/custom_rgb_b.png | Bin .../assets/img/colorpicker/custom_rgb_g.png | Bin .../assets/img/colorpicker/custom_rgb_r.png | Bin .../assets/img/colorpicker/custom_submit.png | Bin .../assets/img/colorpicker/select.png | Bin .../assets/img/colorpicker/select2.png | Bin .../assets/img/colorpicker/slider.png | Bin .../myparcelnl/assets/img/download-pdf.png | Bin .../library/myparcelnl/assets/img/icon.png | Bin .../assets/img/icon_delivery_details.png | Bin .../assets/img/icon_delivery_options.png | Bin .../assets/img/icon_track_trace.png | Bin .../library/myparcelnl/assets/img/loading.gif | Bin .../myparcelnl/assets/img/myparcel-pdf.png | Bin .../myparcelnl/assets/img/myparcel-retour.png | Bin .../myparcelnl/assets/img/myparcel-spin.gif | Bin .../myparcelnl/assets/img/myparcel-up.png | Bin .../myparcelnl/assets/js/checkout.aqc.js | 0 .../library/myparcelnl/assets/js/checkout.js | 87 +- .../myparcelnl/assets/js/colorpicker.js | 0 .../assets/js/delivery-iframe/moment.min.js | 0 .../js/delivery-iframe/myparcel-iframe.js | 0 .../assets/js/delivery-iframe/myparcel.js | 4 +- .../assets/js/delivery-iframe/myparcel_old.js | 0 .../js/delivery-iframe/webcomponents.min.js | 0 .../assets/js/magnific-popup.min.js | 0 .../myparcelnl/assets/js/myparcel_global.js | 0 .../myparcelnl/assets/js/myparcelnl.js | 0 .../library/myparcelnl/assets/js/order.js | 133 +- .../myparcelnl/assets/js/select2.min.js | 0 .../myparcelnl/assets/js/sweetalert.min.js | 1 + .../library/myparcelnl/class_myparcel.php | 3 +- .../includes/class_myparcel_api.php | 0 .../includes/class_myparcel_curl.php | 0 .../includes/class_myparcel_helper.php | 165 ++- .../includes/class_myparcel_log.php | 0 .../includes/class_myparcel_notice.php | 0 .../includes/class_myparcel_session.php | 0 .../includes/class_myparcel_setting.php | 0 .../includes/class_myparcel_shipment.php | 0 .../class_myparcel_shipment_checkout.php | 18 +- .../class_myparcel_shipment_helper.php | 125 +- .../includes/class_myparcel_url.php | 0 .../includes/class_myparcel_view.php | 54 +- .../includes/class_myparcel_view_core.php | 0 .../myparcelnl/includes/ssl/ca-bundle.pem | 0 .../system/library/myparcelnl/logs/.htaccess | 0 .../library/myparcelnl/logs/myparcel_log.txt | 0 .../library/myparcelnl/myparcel.aqc.ocmod.xml | 0 .../myparcelnl/myparcel.checkout.ocmod.xml | 83 +- .../library/myparcelnl/myparcel.ocmod.xml | 202 ++- .../library/myparcelnl/myparcel_trait.php | 0 .../myparcelnl/views/myparcel_packet_type.php | 0 .../view_admin_checkout_delivery_details.php | 0 .../view_admin_checkout_delivery_options.php | 0 .../myparcelnl/views/view_column_myparcel.php | 0 .../views/view_column_myparcel_popup.php | 0 .../myparcelnl/views/view_export_batch.php | 0 .../views/view_export_print_batch.php | 0 .../view_iframe_base_delivery_options.php | 5 + .../view_iframe_delivery_checkout_header.php | 0 .../views/view_iframe_delivery_options.php | 0 .../views/view_myparcel_order_header.php | 0 .../view_order_details_myparcel_actions.php | 0 .../myparcelnl/views/view_print_batch.php | 0 .../views/view_ship_to_myparcel.php | 370 +++--- .../views/view_shipment_summary_myparcel.php | 0 .../view_tracktrace_myaccount_myparcel.php | 0 .../views/view_tracktrace_myparcel.php | 0 125 files changed, 2282 insertions(+), 461 deletions(-) mode change 100755 => 100644 install.xml delete mode 100644 upload/.DS_Store mode change 100755 => 100644 upload/admin/controller/extension/module/myparcelnl.php mode change 100755 => 100644 upload/admin/controller/extension/shipping/myparcel_shipping.php mode change 100755 => 100644 upload/admin/controller/extension/total/myparcel_total.php mode change 100755 => 100644 upload/admin/language/en-gb/extension/module/myparcelnl.php mode change 100755 => 100644 upload/admin/language/en-gb/extension/shipping/myparcel_shipping.php mode change 100755 => 100644 upload/admin/language/en-gb/extension/total/myparcel_total.php mode change 100755 => 100644 upload/admin/model/extension/myparcelnl/helper.php mode change 100755 => 100644 upload/admin/model/extension/myparcelnl/init.php mode change 100755 => 100644 upload/admin/model/extension/myparcelnl/shipment.php mode change 100755 => 100644 upload/admin/model/extension/myparcelnl/shipping.php mode change 100755 => 100644 upload/admin/view/template/extension/module/myparcelnl.twig mode change 100755 => 100644 upload/admin/view/template/extension/shipping/myparcel_shipping.twig mode change 100755 => 100644 upload/admin/view/template/extension/total/myparcel_total.twig mode change 100755 => 100644 upload/catalog/controller/extension/myparcelnl/myparcel_delivery.php mode change 100755 => 100644 upload/catalog/controller/extension/myparcelnl/myparcel_order.php mode change 100755 => 100644 upload/catalog/controller/extension/myparcelnl/myparcel_xtension_delivery.php mode change 100755 => 100644 upload/catalog/controller/extension/myparcelnl/test.php mode change 100755 => 100644 upload/catalog/language/en-gb/extension/module/myparcelnl.php mode change 100755 => 100644 upload/catalog/language/nl-nl/extension/module/myparcelnl.php mode change 100755 => 100644 upload/catalog/model/extension/myparcelnl/helper.php mode change 100755 => 100644 upload/catalog/model/extension/myparcelnl/shipment.php mode change 100755 => 100644 upload/catalog/model/extension/shipping/myparcel_shipping.php mode change 100755 => 100644 upload/catalog/model/extension/total/myparcel_total.php mode change 100755 => 100644 upload/catalog/view/theme/default/template/extension/myparcelnl/myparcel_xtension_delivery.twig mode change 100755 => 100644 upload/catalog/view/theme/default/template/extension/myparcelnl/myparcel_xtension_delivery_change.twig mode change 100755 => 100644 upload/catalog/view/theme/default/template/extension/myparcelnl/myparcel_xtension_pickup_change.twig mode change 100755 => 100644 upload/system/library/myparcelnl/assets/.htaccess mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/checkout.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/colorpicker.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/magnific-popup.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/myparcel_global.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/myparcelnl.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/order.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/css/select2.css create mode 100644 upload/system/library/myparcelnl/assets/css/sweetalert.min.css mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/blank.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_background.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_hex.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_hsb_b.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_hsb_h.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_hsb_s.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_indic.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_overlay.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_rgb_b.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_rgb_g.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_rgb_r.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_select.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/colorpicker_submit.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_background.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_hex.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_hsb_b.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_hsb_h.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_hsb_s.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_indic.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_rgb_b.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_rgb_g.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_rgb_r.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/custom_submit.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/select.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/select2.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/colorpicker/slider.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/download-pdf.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/icon.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/icon_delivery_details.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/icon_delivery_options.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/icon_track_trace.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/loading.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/myparcel-pdf.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/myparcel-retour.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/myparcel-spin.gif mode change 100755 => 100644 upload/system/library/myparcelnl/assets/img/myparcel-up.png mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/checkout.aqc.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/checkout.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/colorpicker.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/delivery-iframe/moment.min.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/delivery-iframe/myparcel-iframe.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/delivery-iframe/myparcel.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/delivery-iframe/myparcel_old.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/delivery-iframe/webcomponents.min.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/magnific-popup.min.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/myparcel_global.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/myparcelnl.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/order.js mode change 100755 => 100644 upload/system/library/myparcelnl/assets/js/select2.min.js create mode 100644 upload/system/library/myparcelnl/assets/js/sweetalert.min.js mode change 100755 => 100644 upload/system/library/myparcelnl/class_myparcel.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_api.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_curl.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_helper.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_log.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_notice.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_session.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_setting.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_shipment.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_shipment_checkout.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_shipment_helper.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_url.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_view.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/class_myparcel_view_core.php mode change 100755 => 100644 upload/system/library/myparcelnl/includes/ssl/ca-bundle.pem mode change 100755 => 100644 upload/system/library/myparcelnl/logs/.htaccess mode change 100755 => 100644 upload/system/library/myparcelnl/logs/myparcel_log.txt mode change 100755 => 100644 upload/system/library/myparcelnl/myparcel.aqc.ocmod.xml mode change 100755 => 100644 upload/system/library/myparcelnl/myparcel.checkout.ocmod.xml mode change 100755 => 100644 upload/system/library/myparcelnl/myparcel.ocmod.xml mode change 100755 => 100644 upload/system/library/myparcelnl/myparcel_trait.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/myparcel_packet_type.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_admin_checkout_delivery_details.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_admin_checkout_delivery_options.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_column_myparcel.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_column_myparcel_popup.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_export_batch.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_export_print_batch.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_iframe_base_delivery_options.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_iframe_delivery_checkout_header.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_iframe_delivery_options.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_myparcel_order_header.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_order_details_myparcel_actions.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_print_batch.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_ship_to_myparcel.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_shipment_summary_myparcel.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_tracktrace_myaccount_myparcel.php mode change 100755 => 100644 upload/system/library/myparcelnl/views/view_tracktrace_myparcel.php diff --git a/install.xml b/install.xml old mode 100755 new mode 100644 index 707c1e6..34701cf --- a/install.xml +++ b/install.xml @@ -5,7 +5,7 @@ --> MyParcel NL - 1.0.5 + 1.1.2 MyParcelNL MyParcel NL https://www.myparcel.nl/ @@ -20,13 +20,13 @@ Ship To - + - + ]]> - + /]]> @@ -41,14 +41,14 @@ - {{ order.column_myparcel }} + {{ order.column_myparcel }} ]]> /]]> + ]]> @@ -145,16 +145,18 @@ - + - + load->model('extension/myparcelnl/helper'); - $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); - $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); + $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); + $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'sweetalert.min.css'); + $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); + $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'sweetalert.min.js'); ]]> @@ -164,8 +166,8 @@ ]]> load->model('extension/myparcelnl/helper'); - $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); - $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); + $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); + $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); ]]> @@ -175,9 +177,9 @@ ]]> load->model('extension/myparcelnl/helper'); - $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); - $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); - $data['use_addition_address'] = Myparcel($this->registry)->settings->general->use_addition_address_as_number_suffix; + $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'order.css'); + $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); + $data['use_addition_address'] = Myparcel($this->registry)->settings->general->use_addition_address_as_number_suffix; ]]> @@ -185,18 +187,18 @@ \$result\['customer'],/]]> $result['customer'], - 'column_myparcel' => $this->model_extension_myparcelnl_helper->getContent('column_myparcel', array('order_id' => $result['order_id'])), - 'ship_to_myparcel' => $this->model_extension_myparcelnl_helper->getContent('ship_to_myparcel', array('order_id' => $result['order_id'])), + 'column_myparcel' => $this->model_extension_myparcelnl_helper->getContent('column_myparcel', array('order_id' => $result['order_id'])), + 'ship_to_myparcel' => $this->model_extension_myparcelnl_helper->getContent('ship_to_myparcel', array('order_id' => $result['order_id'])), 'mp_packet_type' => $this->model_extension_myparcelnl_helper->getContent('myparcel_packet_type', array('order_id' => $result['order_id'])), ]]> - + model_extension_myparcelnl_helper->getContent('column_header_myparcel'); - $data['myparcel_popup_modal'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_popup_modal'); + $data['column_header_myparcel'] = $this->model_extension_myparcelnl_helper->getContent('column_header_myparcel'); + $data['myparcel_popup_modal'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_popup_modal'); ]]> @@ -238,17 +240,17 @@ - - + - load->model('extension/myparcelnl/helper'); $data['myparcel_order_header'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_order_header'); /* MyParcel Ocmod End */ ]]> - + @@ -280,6 +282,43 @@ $data['tracktrace'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_email_tracktrace', array('order_id' => $order_info['order_id'])); ]]> + + + session->data['myparcel']['data'])){ + $myparcel = str_replace('"','"',$this->session->data['myparcel']['data']); + $myparcel = json_decode($myparcel,true); + if(isset($myparcel['location'])){ + $language->load('extension/module/myparcel'); + $data['text_pickup_location'] = 'Pickup Location'; + $data['pickup_location'] = implode("
", array($myparcel['location'],$myparcel['street'] . ' ' . $myparcel['number'], $myparcel['city'] . ' (' . $myparcel['distance'] . 'm)')); + } + } + else if(isset($this->session->data['myparcel_order_id'])){ + $this->load->model('extension/myparcelnl/shipment'); + $myparcel_delivery_options = $this->model_extension_myparcelnl_shipment->getMyParcelDeliveryOptions($this->session->data['myparcel_order_id']); + if(isset($myparcel_delivery_options['location'])){ + $data['text_pickup_location'] = 'Pickup Location'; + $data['pickup_location'] = implode("
", array($myparcel_delivery_options['location'],$myparcel_delivery_options['street'] . ' ' . $myparcel_delivery_options['number'], $myparcel_delivery_options['city'] . ' (' . $myparcel_delivery_options['distance'] . 'm)')); + } + } + if(!isset($data['pickup_location'])){ + if(isset($this->session->data['myparcel_shipping_choosed'])){ + $myparcel_delivery_options = $this->session->data['myparcel_shipping_choosed']; + if(isset($myparcel_delivery_options['location'])){ + $data['text_pickup_location'] = 'Pickup Location'; + $data['pickup_location'] = implode("
", array($myparcel_delivery_options['location'],$myparcel_delivery_options['street'] . ' ' . $myparcel_delivery_options['number'], $myparcel_delivery_options['city'] . ' (' . $myparcel_delivery_options['distance'] . 'm)')); + } + } + } + ]]>
+
+ + $order_total['title'],]]> + strip_tags($order_total['title']), + ]]> + @@ -290,6 +329,22 @@ {% if tracktrace %}

{{ tracktrace.text }} {{ tracktrace.code|join(', ') }}

{% endif %} ]]> + + {{ text_shipping_address }}]]> + {{ text_pickup_location }} + {% endif %} + ]]> + + + {{ shipping_address }}]]> + {{ pickup_location }} + {% endif %} + ]]> +
@@ -304,8 +359,21 @@ - ]]> - {{ order.tracktrace_myaccount }}]]> + {{ column_date_added }}]]> + {{ entry_track_trace }} + {% endif %} + ]]> + + + {{ order.date_added }}]]> + {{ order.tracktrace_myaccount }} + {% endif %} + + ]]> @@ -336,7 +404,16 @@ $order_total = $this->model_account_order->getTotalOrders(); ]]> registry); + } $this->load->model('extension/myparcelnl/helper'); + $this->load->language('extension/module/myparcelnl'); + if(MyParcel()->settings->general->trackandtrace_myaccount){ + $data['is_show_track_trace'] = MyParcel()->settings->general->trackandtrace_myaccount; + $data['entry_track_trace'] = $this->language->get('entry_track_trace'); + } ]]> @@ -344,7 +421,7 @@ load->model('extension/myparcelnl/helper'); $data['myparcel_order_header'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_order_header'); - $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); + $this->document->addScript($this->model_extension_myparcelnl_helper->getJsUrl() . 'order.js'); ]]> @@ -401,6 +478,12 @@ {% endif %} ]]> + + + + @@ -420,6 +503,33 @@ + + + + + + + + + + + + + + @@ -462,6 +572,734 @@ + + + request->get['showpayment'])) {]]> + cart->hasShipping() && isset($this->session->data['shipping_method']['code']) && ($this->session->data['shipping_method']['code'] == 'myparcel_delivery.myparcel_delivery' || $this->session->data['shipping_method']['code'] == 'myparcel_pickup.myparcel_pickup')){ + if (!class_exists('MyParcel')) { + require_once DIR_SYSTEM . 'library/myparcelnl/class_myparcel.php'; + MyParcel($this->registry); + } + $myparcel_error = $this->load->controller(MyParcel()->getMyparcelXtensionControllerPath().'/externalValidate'); + if($myparcel_error){ + $json['error'] = $myparcel_error; + } + } + //Myparcel plugin - end + ]]> + + + template = $this->config->get('xtensions_view_path').'xpayment_address';]]> + session->data['myparcel_api_errors'])){ + $this->data['myparcel_api_errors'] = $this->session->data['myparcel_api_errors']; + } + ]]> + + + + + + request->get['direct'])){]]> + cart->hasShipping() && isset($this->session->data['shipping_method']['code']) && ($this->session->data['shipping_method']['code'] == 'myparcel_delivery.myparcel_delivery' || $this->session->data['shipping_method']['code'] == 'myparcel_pickup.myparcel_pickup')){ + if (!class_exists('MyParcel')) { + require_once DIR_SYSTEM . 'library/myparcelnl/class_myparcel.php'; + MyParcel($this->registry); + } + $myparcel_error = $this->load->controller(MyParcel()->getMyparcelXtensionControllerPath().'/externalValidate'); + if($myparcel_error){ + $json['error'] = $myparcel_error; + } + } + //Myparcel plugin - end + ]]> + + + + + + session->data['shipping_address'])){ + $json['address_exit'] = 1; + } + ]]> + + + + + + + session->data['myparcel_price_pickup']) + && isset($this->session->data['shipping_method']['code']) && strpos($this->session->data['shipping_method']['code'],$this->session->data['myparcel_price_pickup']['shipping_method_code']) !== false){ + $myparcel_delivery_options = $this->session->data['myparcel_price_pickup']['myparcel_shipping_choosed']; + if(isset($myparcel_delivery_options['location'])){ + $this->language->load('extension/module/myparcelnl'); + $this->data['myparcel_pickup_price_summary']['title'] = $this->language->get('entry_title_location'); + $this->data['myparcel_pickup_price_summary']['location'] = $myparcel_delivery_options['location']. ', ' .$myparcel_delivery_options['street'] . ' ' . $myparcel_delivery_options['number'] .', ' . $myparcel_delivery_options['city']; + $this->data['myparcel_pickup_price_summary']['shipping_title'] = $value['title']; + } + } + //Myparcel plugin - end + ]]> + + + + + + + + + load->model('extension/myparcelnl/helper'); + $this->document->addStyle($this->model_extension_myparcelnl_helper->getCssUrl() . 'checkout.css'); + ]]> + + + + registry); + } + if(isset($this->session->data['shipping_method'])){ + if(isset($this->session->data['myparcel_shipping_choosed'])){ + $shipping_method = $this->session->data['shipping_method']; + $myparcel_shipping_choosed = $this->session->data['myparcel_shipping_choosed']; + if(explode('.',$shipping_method['code'])[0] != $myparcel_shipping_choosed['code']){ + unset($this->session->data['myparcel_shipping_choosed']); + } + } + } + else{ + if(isset($this->session->data['myparcel_shipping_choosed'])){ + unset($this->session->data['myparcel_shipping_choosed']); + } + } + if (!empty($shipping_address) && ($shipping_address['iso_code_2'] == 'NL' || $shipping_address['iso_code_2'] == 'BE')) { + $api = MyParcel()->api; + $registry = MyParcel::$registry; + /** @var \Cart\Currency $currency **/ + $currency = $registry->get('currency'); + $current_currency_code = $this->session->data['currency']; + $shipment_class = MyParcel()->shipment; + /** @var MyParcel_Shipment_Checkout $checkout_helper **/ + $checkout_helper = $shipment_class->checkout; + $config = $registry->get('config'); + $myparcelnl_checkout_settings = $config->get('module_myparcelnl_fields_checkout'); + $default_price_0_text = isset($myparcelnl_checkout_settings['default_price_0_text']) ? $myparcelnl_checkout_settings['default_price_0_text'] : ''; + if(isset($myparcelnl_checkout_settings['enable_delivery']) && $myparcelnl_checkout_settings['enable_delivery'] == 1){ + $delivery_params = MyParcel()->helper->getDeliveryParams($shipping_address); + $myparcel_delivery = $api->getDeliveryOptions($delivery_params); + + if(isset($myparcel_delivery['code']) && $myparcel_delivery['code'] == 200 && !isset($myparcel_delivery['body']['errors'])){ + $myparcel_delivery = MyParcel()->helper->formatDeliveryPrice($myparcel_delivery, $shipping_address ,$this->cart->getSubTotal(),$this->language,$current_currency_code); + + + $shipping_method_code = null; + $myparcel_option_title = []; + if (isset($this->session->data['shipping_method']['code'])){ + $shipping_method_code = $this->session->data['shipping_method']['code']; + $shipping_method_code = explode('.',$shipping_method_code)[0]; + } + $this->data['myparcel_option_title'] = array(); + $arrMyparcelShippingKey = []; + foreach ($myparcel_delivery['body']['data'] as $key => $value){ + if(count($value)) { + $sort_order = count($quote_data); + $key_delivery = 'myparcel_' . $key; + $cost = 0; + $cost_with_tax = 0; + $price_key = 'myparcel_price_' . $key; + if (!isset($this->session->data[$price_key])) { + MyParcel()->helper->saveDefaultMyparcelMethodXtension($value,$key); + } + if (isset($this->session->data[$price_key])) { + $myparcel_price = $this->session->data[$price_key]; + $text_price_detail = explode(' - ',$myparcel_price['text_myparcel_price_'.$key]); + //recalculate price choose + switch ($myparcel_price['shipping_method_code']){ + case 'delivery': + foreach ($value as $k => $v){ + if(date('Y-m-d',strtotime($v['date'])) == date('Y-m-d',strtotime($text_price_detail[0]))){ + foreach ($v['time'] as $time){ + if(date('H:i',strtotime($time['start'])) == date('H:i',strtotime($text_price_detail[1])) && date('H:i',strtotime($time['end'])) == date('H:i',strtotime($text_price_detail[2]))){ + $myparcel_price['amount'] = $time['price']['amount']; + $myparcel_price['amount_with_tax'] = $time['price']['amount_with_tax']; + break; + } + } + } + } + break; + case 'pickup': + foreach ($value as $k => $v){ + if($v['location'] == trim($text_price_detail[0])){ + foreach ($v['time'] as $time){ + if(date('H:i',strtotime($time['start'])) == date('H:i',strtotime($text_price_detail[2])) ){ + $myparcel_price['amount'] = $time['price']['amount']; + $myparcel_price['amount_with_tax'] = $time['price']['amount_with_tax']; + break; + } + } + } + } + break; + } // end recalculate price choose + + if ($myparcel_price['shipping_method_code'] == $key) { + $cost = $currency->convert($myparcel_price['amount'], $myparcel_price['currency'], $current_currency_code); + $cost_with_tax = $currency->convert($myparcel_price['amount_with_tax'], $myparcel_price['currency'], $current_currency_code); + }; + if ($shipping_address['iso_code_2'] == 'NL' && isset($this->session->data['additional_service_checked'][$key])) { + if (isset($this->session->data['additional_service'])) { + $additional_service = $this->session->data['additional_service']; + + $delivery_prices = $checkout_helper->getDeliveryPrices(false, true, '', false, 0,$this->cart->getSubTotal()); + $delivery_prices_format = $checkout_helper->getDeliveryPrices(false, true, '', true, 0,$this->cart->getSubTotal()); + foreach ($additional_service as $service_name => $service_value) { + if(isset($delivery_prices[$shipping_address['iso_code_2']][$service_name]) && $delivery_prices[$shipping_address['iso_code_2']][$service_name] !== 'disable'){ + $additional_service[$service_name]['amount'] = round($currency->convert($delivery_prices[$shipping_address['iso_code_2']][$service_name],'EUR',$current_currency_code),2); + $additional_service[$service_name]['amount_with_tax'] = round($currency->convert($delivery_prices_format[$shipping_address['iso_code_2']][$service_name],'EUR',$current_currency_code),2); + $additional_service[$service_name]['text_amount'] = $currency->format($delivery_prices_format[$shipping_address['iso_code_2']][$service_name],$current_currency_code); + } + } + $additional_service_checked = $this->session->data['additional_service_checked'][$key]; + foreach ($additional_service_checked as $service_name => $service_value) { + if ($service_value) { + $cost += $additional_service[$service_name]['amount']; + $cost_with_tax += $additional_service[$service_name]['amount_with_tax']; + } + } + } + } + } + else{ + //delivery default select standard for delivery or first location for pickup if not selected + switch ($key){ + case 'delivery': + foreach ($value as $k => $v){ + foreach ($v['time'] as $k => $time){ + if($time['price_comment'] == 'standard'){ + $cost = $time['price']['amount']; + $cost_with_tax = $time['price']['amount_with_tax']; + break; + } + } + } + break; + case 'pickup': + $pickup = $value[0]; + $time = $pickup['time'][0]; + $cost = $time['price']['amount']; + $cost_with_tax = $time['price']['amount_with_tax']; + break; + } + + } + + $arrQuote = array( + 'code' => $key_delivery . '.' . $key_delivery, + 'title' => $this->language->get('entry_myparcel_' . $key), + 'cost' => $cost, + 'tax_class_id' => $checkout_helper->getTaxFromCart(), + 'text' => ($cost_with_tax == 0 && $default_price_0_text != '') ? $default_price_0_text :$currency->format($cost_with_tax, $current_currency_code), + ); + $arrShipping = array( + 'title' => $this->language->get('entry_myparcel_' . $key), + 'sort_order' => $sort_order, + 'error' => '' + ); + if ($shipping_method_code == $key_delivery) { + $arrQuote['headingtitle'] = $this->language->get('entry_select_myparcel_' . $key); + } + $myparcel_option_title['title_heading_myparcel_' . $key] = $this->language->get('entry_select_myparcel_' . $key); + $myparcel_option_title['text_edit_myparcel_' . $key] = (isset($myparcel_price['text_myparcel_price_'.$key])) ? $myparcel_price['text_myparcel_price_'.$key] : $this->language->get('entry_edit_myparcel_' . $key); + $arrShipping['quote'][$key_delivery] = $arrQuote; + $quote_data[$key_delivery] = $arrShipping; + $arrMyparcelShippingKey[] = $key_delivery; + } + } + $this->session->data['myparcel_option_title'] = $myparcel_option_title; + $this->session->data['myparcel_delivery'] = $myparcel_delivery['body']['data']; + if(isset($this->session->data['myparcel_api_errors'])){ + unset($this->session->data['myparcel_api_errors']); + } + + //make myparcel shipping method to first. + if(count($arrMyparcelShippingKey)){ + $arrMyparcelShippingKey = array_reverse($arrMyparcelShippingKey); + foreach ($arrMyparcelShippingKey as $key){ + if(isset($quote_data[$key])) { + $value = $quote_data[$key]; + unset($quote_data[$key]); + $quote_data = array($key => $value) + $quote_data; + } + } + } + } + else{ + if(isset($myparcel_delivery['body']['errors'])){ + $myparcel_errors = $myparcel_delivery['body']['errors']; + $error_message = []; + if(is_array($myparcel_errors) && count($myparcel_errors)){ + foreach($myparcel_errors as $error){ + $error_language_key = 'entry_myparcel_api_error_code_' . $error['code']; + $error_message[] = ($this->language->get($error_language_key) != $error_language_key) ? $this->language->get($error_language_key) : $error['message']; + } + $this->session->data['myparcel_api_errors'] = htmlspecialchars(implode('.',$error_message), ENT_QUOTES); + } + } + }} + else{ + if(isset($this->session->data['myparcel_api_errors'])){ + unset($this->session->data['myparcel_api_errors']); + } + } + } + else{ + if(isset($this->session->data['myparcel_api_errors'])){ + unset($this->session->data['myparcel_api_errors']); + } + } + ]]> + + + template = $this->config->get('xtensions_view_path').'xshipping_method';]]> + registry); + } + if(isset($this->session->data['myparcel_api_errors'])){ + $this->data['myparcel_api_errors'] = $this->session->data['myparcel_api_errors']; + } + if(isset($this->session->data['myparcel_option_title'])){ + $this->data['myparcel_option_title'] = $this->session->data['myparcel_option_title']; + } + ($_SERVER['HTTPS'] && defined(HTTPS_SERVER)) ? $url_server = HTTPS_SERVER : $url_server = HTTP_SERVER; + $this->data['myparcel_action'] = $url_server . 'index.php?route=' . MyParcel()->getMyparcelXtensionControllerPath(); + ]]> + + + + + + + '+json['error']['date']+''); + } + if(json['error']['timeslot']){ + loadSlots(); + $('#xdeltimeslots').before('
'+json['error']['timeslot']+'
'); + } + }else if(json['success']){ + $('.myparcel-pickup-table').html(json['html']); + loadShippingMethods(true); + } + hideLoader(); + } + }); + }); + function changeAdditionalService(obj,name) { + var element = obj; + var id = obj.id.toString(); + console.log(id); + $.ajax({ + url: 'index.php?route='+$(obj).attr('action')+'/save', + type: 'post', + data: { + 'addition_name' : name, + 'addition_value': obj.checked + }, + dataType: 'json', + beforeSend: function() { + $('.xdeldateandtimeslots .alert').remove(); + $('.xdelslotselected').removeClass('xdelslotselected'); + $(element).closest('tr').addClass('xdelslotselected'); + }, + success: function(json) { + if(json['error']){ + if(json['error']['date']){ + $('#xdeltimeslots').before('
'+json['error']['date']+'
'); + } + if(json['error']['timeslot']){ + loadSlots(); + $('#xdeltimeslots').before('
'+json['error']['timeslot']+'
'); + } + }else if(json['success']){ + loadShippingMethods(); + } + + } + }); + }; + function loadMyparcelDelivery(action,headingtitle){ + $('#modal-shipping-dependancy').remove(); + $('.bootstrap-datetimepicker-widget').remove(); + $.ajax({ + url: action, + type: 'post', + data: $('#shipping_method input[type=\'radio\']:checked'), + dataType: 'html', + beforeSend: function() { + + }, + success: function(data) { + html = '