Skip to content

Commit

Permalink
Merge pull request #109 from myparcelnl/mailbox-package-title-under-w…
Browse files Browse the repository at this point in the history
…eight

Mailbox package title under 2 kg
  • Loading branch information
Reindert authored Aug 17, 2016
2 parents be0c984 + 6275527 commit e045390
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
&& 'NL' === $request->getDestCountryId()
&& $this->getConfigFlag('pakjegemak_active')
&& $this->_pakjeGemakValidOrderAmount()
&& ($request->getPackageWeight() > 2 || $this->getConfigData('mailbox_title') == '')
) {
$currentRate = current($result->getRatesByCarrier($this->_code));

Expand Down Expand Up @@ -413,7 +414,12 @@ protected function _getTableRate(Mage_Shipping_Model_Rate_Request $request)
$method->setCarrierTitle($this->getConfigData('title'));

$method->setMethod('tablerate');
$method->setMethodTitle($this->getConfigData('name'));

if($oldWeight < 2 && $this->getConfigData('mailbox_title') !== '') {
$method->setMethodTitle($this->getConfigData('mailbox_title'));
} else {
$method->setMethodTitle($this->getConfigData('name'));
}

$method->setPrice($price);
$method->setCost($cost);
Expand Down
2 changes: 1 addition & 1 deletion 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.5.9</version>
<version>1.5.10</version>
</TIG_MyParcel2014>
</modules>
<global>
Expand Down
9 changes: 9 additions & 0 deletions app/code/community/TIG/MyParcel2014/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@
<pakjegemak_min_order_enabled>1</pakjegemak_min_order_enabled>
</depends>
</pakjegemak_min_order_total>
<mailbox_title translate="label,comment" module="tig_myparcel">
<label>Mailbox title</label>
<comment>Mailbox title under 2 kg. Leave empty to don't use it.</comment>
<frontend_type>text</frontend_type>
<sort_order>135</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</mailbox_title>
<!-- allow specific countries -->
<sallowspecific translate="label" module="tig_myparcel">
<label>Ship to Applicable Countries</label>
Expand Down

0 comments on commit e045390

Please sign in to comment.