Skip to content

Commit

Permalink
Merge pull request #310 from myparcelnl/develop
Browse files Browse the repository at this point in the history
useV2Endpoint only myparcel_print_labels
  • Loading branch information
Reindert authored Apr 10, 2017
2 parents af5548f + 64caff7 commit 3d6a0f6
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@
return;
}

var massActionSelect = $('sales_order_grid_massaction-select');
var selectedMassAction = massActionSelect[massActionSelect.selectedIndex];

/**
* Additional MyParcel functionality
*/
if (!skipMyParcelCheck) {
massActionSelect = $('sales_order_grid_massaction-select');
selectedMassAction = massActionSelect[massActionSelect.selectedIndex];
if (selectedMassAction.value == 'myparcel_print_labels') {

var paper_type = '<?php echo $helper->getConfig('print_orientation');?>';
Expand Down Expand Up @@ -250,7 +251,12 @@
return;
}

useV2Endpoint = $$('input:checked[name=order_ids]').length > <?=TIG_MyParcel2014_Model_Api_MyParcel::SHIPMENT_V2_ACTIVE_FROM;?>;

if (selectedMassAction.value == 'myparcel_print_labels') {
useV2Endpoint = $$('input:checked[name=order_ids]').length > <?=TIG_MyParcel2014_Model_Api_MyParcel::SHIPMENT_V2_ACTIVE_FROM;?>;
} else {
useV2Endpoint = false;
}

if ((this.useAjax || useV2Endpoint)&& item.url) {
new Ajax.Request(item.url, {
Expand Down

0 comments on commit 3d6a0f6

Please sign in to comment.