Skip to content

Commit

Permalink
Merge pull request #107 from myparcelnl/hotfix-status-orderlist
Browse files Browse the repository at this point in the history
1.5.9
  • Loading branch information
Reindert authored Aug 12, 2016
2 parents aa082b7 + f9163f0 commit be0c984
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ public function render(Varien_Object $row)
* Check if any data is available.
* If not available, show send link and country code
*/
$value = $row->getData($this->getColumn()->getIndex());
$order = Mage::getModel('sales/order')->load($row->getId());
$value = $row->getData($this->getColumn()->getIndex());
$barcodes = explode(',', $row->getData(self::BARCODE_COLUMN));
$barcodeData = array();
$statusses = explode(',', $value);

if (!$value) {
if (empty($barcodes[0])) {
if($order->canShip()) {

$orderSendUrl = Mage::helper('adminhtml')->getUrl("adminhtml/sales_order_shipment/start", array('order_id' => $row->getId()));
Expand All @@ -100,16 +103,16 @@ public function render(Varien_Object $row)
'postcode' => $postcode,
);

$barcodeData = array();
$barcodes = explode(',', $row->getData(self::BARCODE_COLUMN));
$statusses = explode(',', $value);
foreach ($statusses as $key => $status) {
if (!empty($barcodes[$key])) {
$barcodeUrl = Mage::helper('tig_myparcel')->getBarcodeUrl($barcodes[$key], $destinationData, false, true);
$oneBarcodeData = "<a href='{$barcodeUrl}' target='_blank'>{$barcodes[$key]}</a> - <small>{$status}</small>";
if(!in_array($oneBarcodeData, $barcodeData)) {
$barcodeData[] = $oneBarcodeData;
}
foreach ($barcodes as $key => $barcode) {
if (!empty($statusses[$key])) {
$status = " - <small>{$statusses[$key]}</small>";
} else {
$status = '';
}
$barcodeUrl = Mage::helper('tig_myparcel')->getBarcodeUrl($barcode, $destinationData, false, true);
$oneBarcodeData = "<a href='{$barcodeUrl}' target='_blank'>{$barcode}</a>$status";
if(!in_array($oneBarcodeData, $barcodeData)) {
$barcodeData[] = $oneBarcodeData;
}
}

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.8</version>
<version>1.5.9</version>
</TIG_MyParcel2014>
</modules>
<global>
Expand Down

0 comments on commit be0c984

Please sign in to comment.