Skip to content

Commit

Permalink
Merge pull request #450 from myparcelnl/MY-8978-generic-text
Browse files Browse the repository at this point in the history
My 8978 generic text
  • Loading branch information
RichardPerdaan authored Jan 31, 2019
2 parents f5b4090 + 5a913e7 commit 28ef7c9
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,23 @@ public function getIsInsured()
$orderTotalShipped = $this->getOrderTotal();

//get the insured values
$insuredType50 = $helper->getConfig('insured_50', 'shipment', $storeId);
$insuredType100 = $helper->getConfig('insured_100', 'shipment', $storeId);
$insuredType250 = $helper->getConfig('insured_250', 'shipment', $storeId);
$insuredType500 = $helper->getConfig('insured_500', 'shipment', $storeId);

//check if the values are not empty/zero
$insuredType50 = (!empty($insuredType50) && $insuredType50 > 0)? $insuredType50 : false;
$insuredType100 = (!empty($insuredType100) && $insuredType100 > 0)? $insuredType100 : false;
$insuredType250 = (!empty($insuredType250) && $insuredType250 > 0)? $insuredType250 : false;
$insuredType500 = (!empty($insuredType500) && $insuredType500 > 0)? $insuredType500 : false;

//if nothing is filled in, then set the default values, but do not pre-select
$selected = 'checked="checked"';
if(
false === $insuredType50 &&
false === $insuredType100 &&
false === $insuredType250 &&
false === $insuredType500
){
$insuredType50 = 50;
$insuredType100 = 100;
$insuredType250 = 250;
$insuredType500 = 500;
$selected = 0;
Expand All @@ -304,9 +304,9 @@ public function getIsInsured()
}elseif(false !== $insuredType250 && $orderTotalShipped > $insuredType250){
$insuredValue = $insuredType250;
$insuredUpTo = 250;
}elseif(false !== $insuredType50 && $orderTotalShipped > $insuredType50){
$insuredValue = $insuredType50;
$insuredUpTo = 50;
}elseif(false !== $insuredType100 && $orderTotalShipped > $insuredType100){
$insuredValue = $insuredType100;
$insuredUpTo = 100;
}else{
$insuredValue = 0;
$insuredUpTo = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,23 @@ public function getIsInsured()
$orderTotalShipped = $this->getOrderTotal();

//get the insured values
$insuredType50 = $helper->getConfig('insured_50', 'shipment', $storeId);
$insuredType100 = $helper->getConfig('insured_100', 'shipment', $storeId);
$insuredType250 = $helper->getConfig('insured_250', 'shipment', $storeId);
$insuredType500 = $helper->getConfig('insured_500', 'shipment', $storeId);

//check if the values are not empty/zero
$insuredType50 = (!empty($insuredType50) && $insuredType50 > 0)? $insuredType50 : false;
$insuredType100 = (!empty($insuredType100) && $insuredType100 > 0)? $insuredType100 : false;
$insuredType250 = (!empty($insuredType250) && $insuredType250 > 0)? $insuredType250 : false;
$insuredType500 = (!empty($insuredType500) && $insuredType500 > 0)? $insuredType500 : false;

//if nothing is filled in, then set the default values, but do not pre-select
$selected = 'checked="checked"';
if(
false === $insuredType50 &&
false === $insuredType100 &&
false === $insuredType250 &&
false === $insuredType500
){
$insuredType50 = 50;
$insuredType100 = 100;
$insuredType250 = 250;
$insuredType500 = 500;
$selected = 0;
Expand All @@ -314,9 +314,9 @@ public function getIsInsured()
}elseif(false !== $insuredType250 && $orderTotalShipped > $insuredType250){
$insuredValue = $insuredType250;
$insuredUpTo = 250;
}elseif(false !== $insuredType50 && $orderTotalShipped > $insuredType50){
$insuredValue = $insuredType50;
$insuredUpTo = 50;
}elseif(false !== $insuredType100 && $orderTotalShipped > $insuredType100){
$insuredValue = $insuredType100;
$insuredUpTo = 100;
}else{
$insuredValue = 0;
$insuredUpTo = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,9 @@ public function getCurrentOrderOptionsHtml()
/** @var $myParcelShipment TIG_MyParcel2014_Model_Shipment */
foreach ($this->_myParcelShipments as $myParcelShipment) {
$shipmentUrl = Mage::helper('adminhtml')->getUrl("*/sales_shipment/view", array('shipment_id'=>$myParcelShipment->getShipment()->getId()));
$editUrl = "https://backoffice.myparcel.nl/shipmentform?shipment=" . $myParcelShipment->getConsignmentId();
if ($myParcelShipment->getStatus() == 1) {
$editLink = '<a href="' . $editUrl . '" target="myparcel">' . $this->__("Edit options") . '</a>';
} else {
$editLink = '';
}

$linkText = $myParcelShipment->getBarcode() ? $myParcelShipment->getBarcode() : $this->__('Shipment');
$optionsHtml .= '<p><a href="'.$shipmentUrl.'">' . $linkText . '</a>: ' . $this->_helper->getCurrentOptionsHtml($myParcelShipment) . '</a> ' . $editLink . '</p>';
$optionsHtml .= '<p><a href="'.$shipmentUrl.'">' . $linkText . '</a>: ' . $this->_helper->getCurrentOptionsHtml($myParcelShipment) .'</p>';
}

return $optionsHtml;
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/TIG/MyParcel2014/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ protected function _getSplitStreetData($fullStreet, $throwException = true)

if (strlen($fullStreet) > 40 && $throwException) {
throw new TIG_MyParcel2014_Exception(
$this->__('Address is too long. Make the delivery address less than 40 characters. Click on send (in the order detail page) to create a concept. And then edit the shipment in the backoffice of MyParcel.'),
$this->__('Address is too long. Make the delivery address less than 40 characters. Click on send (in the order detail page) to create a concept. And then edit the shipment in the backoffice.'),
'MYPA-0026'
);
}
Expand Down
8 changes: 4 additions & 4 deletions app/code/community/TIG/MyParcel2014/Model/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ public function getInsuredOption()
$orderTotalShipped = $this->getOrderTotal();

//get the insured values
$insuredType50 = $helper->getConfig('insured_50','shipment',$storeId);
$insuredType100 = $helper->getConfig('insured_100','shipment',$storeId);
$insuredType250 = $helper->getConfig('insured_250','shipment',$storeId);
$insuredType500 = $helper->getConfig('insured_500','shipment',$storeId);

//check if the values are not empty/zero.
$insuredType50 = (!empty($insuredType50) && $insuredType50 > 0)? $insuredType50 : false;
$insuredType100 = (!empty($insuredType100) && $insuredType100 > 0)? $insuredType100 : false;
$insuredType250 = (!empty($insuredType250) && $insuredType250 > 0)? $insuredType250 : false;
$insuredType500 = (!empty($insuredType500) && $insuredType500 > 0)? $insuredType500 : false;

Expand All @@ -467,8 +467,8 @@ public function getInsuredOption()
$insuredValue = 500;
}elseif(false !== $insuredType250 && $orderTotalShipped > $insuredType250){
$insuredValue = 250;
}elseif(false !== $insuredType50 && $orderTotalShipped > $insuredType50){
$insuredValue = 50;
}elseif(false !== $insuredType100 && $orderTotalShipped > $insuredType100){
$insuredValue = 100;
}else{
$insuredValue = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/TIG/MyParcel2014/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<TIG_MyParcel2014>
<version>1.17.3-beta.1</version>
<version>1.17.3-beta.2</version>
</TIG_MyParcel2014>
</modules>
<global>
Expand Down Expand Up @@ -260,7 +260,7 @@
<return_if_no_answer>0</return_if_no_answer>
<automatically_next_status>1</automatically_next_status>
<is_xl>0</is_xl>
<insured_50>0</insured_50>
<insured_100>0</insured_100>
<insured_250>0</insured_250>
<insured_500>0</insured_500>
<customs_type>1</customs_type>
Expand Down
12 changes: 6 additions & 6 deletions app/code/community/TIG/MyParcel2014/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,11 @@
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>To get your personal API credentials you should contact MyParcel.</comment>
<comment>To get your personal API credentials you should contact us.</comment>
<fields>
<username translate="label comment">
<label>API Username</label>
<comment>Your MyParcel username.</comment>
<comment>Your username.</comment>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
Expand All @@ -763,7 +763,7 @@
</username>
<key translate="label comment">
<label>API Key</label>
<comment>The API Key given by MyParcel.</comment>
<comment>The API Key.</comment>
<frontend_type>text</frontend_type>
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
<sort_order>20</sort_order>
Expand Down Expand Up @@ -922,16 +922,16 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_xl>
<insured_50 translate="label comment">
<label><![CDATA[Insured up to &euro; 50]]></label>
<insured_100 translate="label comment">
<label><![CDATA[Insured up to &euro; 100]]></label>
<comment>Only for dutch shipments</comment>
<frontend_type>text</frontend_type>
<validate>validate-number validate-zero-or-greater</validate>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</insured_50>
</insured_100>
<insured_250 translate="label">
<label><![CDATA[Insured up to &euro; 250]]></label>
<comment><![CDATA[For NL shipping only, shipments outside the EU insured default is &euro; 200]]></comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if(true == $_isPakjegemak){
<p>
<label for="tig_myparcel_insured" class="normal">(<?php echo $this->__('Total order value: &euro; %s',$this->getOrderTotal());?>) <?php echo $this->__('Insured up to:');?> </label>
<select id="tig_myparcel_insured_amount" name="tig_myparcel[insured_amount]" >
<option value="50" <?php echo $_insuredUpTo == 50 ? 'selected="selected"' : '';?>>&euro; 50</option>
<option value="100" <?php echo $_insuredUpTo == 100 ? 'selected="selected"' : '';?>>&euro; 100</option>
<option value="250" <?php echo $_insuredUpTo == 250 ? 'selected="selected"' : '';?>>&euro; 250</option>
<option value="500" <?php echo $_insuredUpTo == 500 && $_insuredUpTo < 1000 ? 'selected="selected"' : '';?>>&euro; 500</option>
<?php while($tmpInsured <= 5000) :?>
Expand Down Expand Up @@ -159,7 +159,7 @@ if(true == $_isPakjegemak){
<?php endif;?>
</div>
</div>
<p><?php echo $this->__('By creating this shipment, you create a concept in MyParcel.<br>In the backoffice of MyParcel you can further customize the options.');?></p>
<p><?php echo $this->__('By creating this shipment, you create a concept in MyParcel.<br>In the backoffice you can further customize the options.');?></p>
</div>
<script type ="text/javascript">
/*<![CDATA[*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<td colspan="3">
<div class="text-box">
<?php $url = 'https://myparcelnl.github.io/magento1/';?>
<h4><?php echo $_helper->__('To read the instructions for the MyParcel Magento extension, click <a target="_blank" href="%s">here</a>.',$url); ?></h4>
<h4><?php echo $_helper->__('To read the instructions for the Magento extension, click <a target="_blank" href="%s">here</a>.',$url); ?></h4>
</div>
</td>
</tr>
Expand All @@ -58,7 +58,7 @@
<h3><?php echo $_helper->__('When using the extension please note:');?></h3>
<ol>
<li>
<?php echo $_helper->__('To be able to configure the extension you need to possess and use an active MyParcel account.');?>
<?php echo $_helper->__('To be able to configure the extension you need to possess and use an active account.');?>
</li>
<li>
<?php echo $_helper->__('During the transition phase the old Magento MyParcel extension can remain active. However, you do need to turn off PakjeGemak in the old MyParcel extension.');?>
Expand All @@ -67,7 +67,7 @@
</div>
<div class="text-box">
<h3><?php echo $_helper->__('Magento &amp; 3rd party version compatibility');?></h3>
<p><?php echo $_helper->__('We cannot guarantee perfect functionality of the MyParcel extension when you intend to use the extension on a version of Magento that is not supported or when you intend to use the extension together with a 3rd part extension that is not supported. If you have any questions please contact MyParcel.<br><br>Supported extensions:'); ?></p>
<p><?php echo $_helper->__('We cannot guarantee perfect functionality of the extension when you intend to use the extension on a version of Magento that is not supported or when you intend to use the extension together with a 3rd part extension that is not supported. If you have any questions please contact us.<br><br>Supported extensions:'); ?></p>
<ul>
<li><?php echo $_helper->__('Magento Community Edition version');?> v1.6, v1.7, v1.8 &amp; v1.9</li>
<li><?php echo $_helper->__("Idev's OneStepCheckout version");?> v4.0, v4.1 &amp; v4.5</li>
Expand All @@ -82,8 +82,8 @@
<td class="col-right">
<div class="text-box">
<h3><?php echo $_helper->__('Support');?></h3>
<h4><?php echo $_helper->__('Questions and information about your MyParcel account');?></h4>
<p><?php echo $_helper->__('For questions related to your MyParcel account, configuration problems, extension conflicts and bugs, please contact MyParcel.');?></p>
<h4><?php echo $_helper->__('Questions and information about your account');?></h4>
<p><?php echo $_helper->__('For questions related to your account, configuration problems, extension conflicts and bugs, please contact us.');?></p>
<table class="contact tig">
<tr>
<td class="first"><?php echo $_helper->__('MyParcel');?>:</td>
Expand Down Expand Up @@ -135,11 +135,6 @@
<?php echo $_helper->__('Overview articles in knowledge base');?>
</a>
</li>
<li>
<a class="link" target="_blank" href="https://backoffice.myparcel.nl/settings" title="<?php echo $_helper->__('MyParcel backoffice');?>">
<?php echo $_helper->__('MyParcel backoffice');?>
</a>
</li>
</ul>
</div>
</td>
Expand Down
Loading

0 comments on commit 28ef7c9

Please sign in to comment.