Skip to content

Commit

Permalink
Upload new version
Browse files Browse the repository at this point in the history
Versie 1.0.5.A
  • Loading branch information
Chris707 committed Oct 25, 2019
1 parent 88125ad commit 1652537
Show file tree
Hide file tree
Showing 8 changed files with 1,741 additions and 2,087 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function total_details()

$order_id = isset($_POST['myparcel_order_id']) ? $_POST['myparcel_order_id'] : null;

$total_array = $checkout_helper->getTotalArray($data, true, $order_id, 'incl ', false); // Get total with prices saved in myparcel_shipment
$total_array = $checkout_helper->getTotalArray($data, true, $order_id, 'excl ', false); // Get total with prices saved in myparcel_shipment

ob_start();
foreach ($total_array as $total_code => $total_item) {
Expand Down
7 changes: 6 additions & 1 deletion upload/system/library/myparcelnl/assets/js/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ var MYPARCEL_CHECKOUT = MYPARCEL_CHECKOUT || {};

// For journal theme
if (settings.url.indexOf('route=journal2/checkout/shipping') > 0) {
$("#myparcel-iframe").css({'height': '650px'});
var height = '450px';
if($('#myparcel_delivery_iframe_height').length > 0){
height = $('#myparcel_delivery_iframe_height').val();
}

$("#myparcel-iframe").css({'height': height});
var a = MYPARCEL_CHECKOUT.activateIframe();
return true;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,23 @@ public function getTaxRate($tax_rate_id){
return false;
}
}

public function getHeightMyparcelIframe($sub_total,$iso_code_2){
$height = 250; //default height

$shipment_class = MyParcel()->shipment;
/** @var MyParcel_Shipment_Checkout $checkout_helper **/
$checkout_helper = $shipment_class->checkout;
$delivery_prices = $checkout_helper->getDeliveryPrices(false, true, '', true, 0,$sub_total);
if(isset($delivery_prices[$iso_code_2])){
foreach ($delivery_prices[$iso_code_2] as $key => $value){
if($value != 'disabled'){
$height += 25;
}
}
}
return $height.'px';
}
}

return new MyParcel_Helper();
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ function appliedByParcel($total)
**/
function setSessionOrderDeliveryOptions($order_id)
{
if (!MyParcel()->helper->isModuleExist('module_myparcelnl')) {
if (!MyParcel()->helper->isModuleExist('myparcelnl')) {
return;
}

Expand Down
3,712 changes: 1,634 additions & 2,078 deletions upload/system/library/myparcelnl/includes/ssl/ca-bundle.pem

Large diffs are not rendered by default.

31 changes: 30 additions & 1 deletion upload/system/library/myparcelnl/myparcel.checkout.ocmod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<version>1.0.0</version>
<code>MyParcelNL_default_checkout</code>
<author>MyParcel NL</author>
<link>http://www.myparcelnl.com</link>
<link>http://www.myparcel.nl</link>

<!-- ________________ SYSTEM\LIBRARY\CART\CART.PHP ________________ -->
<!-- _________________________ CART CLASS _________________________ -->
Expand Down Expand Up @@ -152,6 +152,11 @@
$this->model_extension_myparcelnl_helper->initMyParcel();
$this->data['myparcel_delivery_iframe'] = $this->model_extension_myparcelnl_helper->getContent('iframe_delivery_options');
$this->data['myparcel_delivery_checkout_header'] = $this->model_extension_myparcelnl_helper->getContent('iframe_delivery_checkout_header');
if (!class_exists('MyParcel')) {
require_once DIR_SYSTEM . 'library/myparcelnl/class_myparcel.php';
MyParcel($this->registry);
}
$this->data['myparcel_delivery_iframe_height'] = MyParcel()->helper->getHeightMyparcelIframe($this->cart->getSubTotal(),$this->session->data['shipping_address']['iso_code_2']);
/* MyParcel Ocmod End */
]]></add>
</operation>
Expand Down Expand Up @@ -195,6 +200,30 @@
}
]]></add>
</operation>
<operation>
<search><![CDATA['postcode' => Journal2Utils::getProperty($this->request->post, 'shipping_postcode'),]]></search>
<add position="after"><![CDATA[
'address_1' => Journal2Utils::getProperty($this->request->post, 'shipping_address_1'),
'address_2' => Journal2Utils::getProperty($this->request->post, 'shipping_address_2'),
]]></add>
</operation>
</file>

<file path="catalog/view/theme/journal2/template/journal2/checkout/checkout.twig">
<operation>
<search><![CDATA[data[type + '_zone_id'] = $('select[name="' + type + '_zone_id"]').val();]]></search>
<add position="after"><![CDATA[
data[type + '_address_1'] = $('input[name="' + type + '_address_1"]').val();
data[type + '_address_2'] = $('input[name="' + type + '_address_2"]').val();
]]></add>
</operation>
<operation>
<search><![CDATA[data['shipping_zone_id'] = $('select[name="' + type + '_zone_id"]').val();]]></search>
<add position="after"><![CDATA[
data['shipping_address_1'] = $('input[name="' + type + '_address_1"]').val();
data['shipping_address_2'] = $('input[name="' + type + '_address_2"]').val();
]]></add>
</operation>
</file>

<!-- ____________ SHIPPING_METHOD.TWIG _____________ -->
Expand Down
52 changes: 48 additions & 4 deletions upload/system/library/myparcelnl/myparcel.ocmod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,17 @@
<!-- ************************************************************************* -->

<file path="admin/controller/common/header.php"><!-- checked -->
<operation><!-- yes -->
<search><![CDATA[
<operation><!-- yes -->
<search><![CDATA[
public function index() {
]]></search>
<add position="after"><![CDATA[
<add position="after"><![CDATA[
/* MyParcel Ocmod Start */
$this->load->model('extension/myparcelnl/helper');
$data['myparcel_order_header'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_order_header');
/* MyParcel Ocmod End */
]]></add>
</operation>
</operation>
</file>

<!-- ****** CATALOG COMMON HEADER CONTROLLER CATALOG/CONTROLLER/COMMON/HEADER.PHP ****** -->
Expand Down Expand Up @@ -280,6 +280,28 @@
$data['tracktrace'] = $this->model_extension_myparcelnl_helper->getContent('myparcel_email_tracktrace', array('order_id' => $order_info['order_id']));
]]></add>
</operation>
<operation><!-- no -->
<search><![CDATA[// Vouchers]]></search>
<add position="before"><![CDATA[
if(isset($this->session->data['myparcel']['data'])){
$myparcel = str_replace('&quot;','"',$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("<br>", 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("<br>", array($myparcel_delivery_options['location'],$myparcel_delivery_options['street'] . ' ' . $myparcel_delivery_options['number'], $myparcel_delivery_options['city'] . ' (' . $myparcel_delivery_options['distance'] . 'm)'));
}
}
]]></add>
</operation>
</file>

<file path="catalog/view/theme/*/template/mail/order_add.twig"><!-- checked -->
Expand All @@ -290,6 +312,22 @@
{% if tracktrace %} <p>{{ tracktrace.text }} {{ tracktrace.code|join(', ') }}</p> {% endif %}
]]></add>
</operation>
<operation><!-- no -->
<search><![CDATA[<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_shipping_address }}</td>]]></search>
<add position="after"><![CDATA[
{% if pickup_location %}
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_pickup_location }}</td>
{% endif %}
]]></add>
</operation>
<operation><!-- no -->
<search><![CDATA[<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ shipping_address }}</td>]]></search>
<add position="after"><![CDATA[
{% if pickup_location %}
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ pickup_location }}</td>
{% endif %}
]]></add>
</operation>
</file>
<file path="catalog/model/checkout/order.php">
<operation>
Expand Down Expand Up @@ -401,6 +439,12 @@
{% endif %}
]]></add>
</operation>
<operation>
<search><![CDATA[$('#button-save').button('reset');]]></search>
<add position="after"><![CDATA[
$('#button-refresh').click();
]]></add>
</operation>
</file>

<!-- ________________ catalog/view/theme/journal2/template/journal2/checkout/address_form.twig ________________ -->
Expand Down

0 comments on commit 1652537

Please sign in to comment.